Skip to content

Commit e82a858

Browse files
committed
add dataset class file for credit card segmentation
1 parent c5ec603 commit e82a858

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

mmseg/datasets/my_credicard.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright (c) OpenMMLab. All rights reserved.
2+
import os.path as osp
3+
4+
from .builder import DATASETS
5+
from .custom import CustomDataset
6+
7+
8+
@DATASETS.register_module()
9+
class MyCreditCardDataset(CustomDataset):
10+
"""credit card dataset. 0 stands for background,
11+
which is included in 2 categories.
12+
"""
13+
14+
CLASSES = ('background','credit card')
15+
16+
PALETTE = [[120,120,120],[128, 64, 128]]
17+
18+
def __init__(self,
19+
img_suffix='.jpg',
20+
seg_map_suffix='_mask2.png',
21+
**kwargs):
22+
super(MyCreditCardDataset, self).__init__(
23+
img_suffix=img_suffix,
24+
seg_map_suffix=seg_map_suffix,
25+
**kwargs)
26+
assert self.file_client.exists(self.img_dir)

0 commit comments

Comments
 (0)