-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom Bisenetv2 config for new dataset #1425
Open
JJLimmm
wants to merge
10
commits into
open-mmlab:master
Choose a base branch
from
JJLimmm:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b49db3a
Custom_config for waterpuddles dataset
JJLimmm 8822efa
Merge pull request #1 from JJLimmm/JJLimmm-waterpuddlesDataset
JJLimmm eb0a1ca
waterpuddles dataset base config
JJLimmm d197cdc
Update Bisenetv2 base config for waterpuddles
JJLimmm 38ace10
Add files via upload
JJLimmm d286b90
Custom Dataset Class
JJLimmm 4d4cd97
Update class names
JJLimmm c7a8e4b
Update bisenetv2_fcn_4x4_512x512_40k_waterpuddles.py
JJLimmm 017bb45
Merge branch 'open-mmlab:master' into master
JJLimmm 69560f6
Merge branch 'open-mmlab:master' into master
JJLimmm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# dataset settings | ||
dataset_type = 'waterpuddlesDataset' | ||
data_root = 'data/puddle-1000_chasedb_NEW' | ||
img_norm_cfg = dict( | ||
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=False) | ||
img_scale = (360, 640) | ||
crop_size = (128, 128) | ||
train_pipeline = [ | ||
dict(type='LoadImageFromFile'), | ||
dict(type='LoadAnnotations'), | ||
dict(type='Resize', img_scale=img_scale, ratio_range=(0.5, 2.0)), | ||
dict(type='RandomCrop', crop_size=crop_size, cat_max_ratio=0.75), | ||
dict(type='RandomFlip', prob=0.5), | ||
dict(type='PhotoMetricDistortion'), | ||
dict(type='Normalize', **img_norm_cfg), | ||
dict(type='Pad', size=crop_size, pad_val=0, seg_pad_val=255), | ||
dict(type='DefaultFormatBundle'), | ||
dict(type='Collect', keys=['img', 'gt_semantic_seg']) | ||
] | ||
test_pipeline = [ | ||
dict(type='LoadImageFromFile'), | ||
dict( | ||
type='MultiScaleFlipAug', | ||
img_scale=img_scale, | ||
# img_ratios=[0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0], | ||
flip=False, | ||
transforms=[ | ||
dict(type='Resize', keep_ratio=True), | ||
dict(type='RandomFlip'), | ||
dict(type='Normalize', **img_norm_cfg), | ||
dict(type='ImageToTensor', keys=['img']), | ||
dict(type='Collect', keys=['img']) | ||
]) | ||
] | ||
|
||
data = dict( | ||
samples_per_gpu=4, | ||
workers_per_gpu=4, | ||
train=dict( | ||
type='RepeatDataset', | ||
times=40000, | ||
dataset=dict( | ||
type=dataset_type, | ||
data_root=data_root, | ||
img_dir='images/training', | ||
ann_dir='annotations/training', | ||
pipeline=train_pipeline)), | ||
val=dict( | ||
type=dataset_type, | ||
data_root=data_root, | ||
img_dir='images/validation', | ||
ann_dir='annotations/validation', | ||
pipeline=test_pipeline), | ||
test=dict( | ||
type=dataset_type, | ||
data_root=data_root, | ||
img_dir='images/validation', | ||
ann_dir='annotations/validation', | ||
pipeline=test_pipeline)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
configs/bisenetv2/bisenetv2_fcn_4x4_512x512_40k_waterpuddles.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
_base_ = [ | ||
'../_base_/models/bisenetv2.py', # model settings | ||
'../_base_/datasets/waterpuddles.py', # dataset settings | ||
'../_base_/schedules/schedule_40k.py', # scheduler settings | ||
'../_base_/default_runtime.py' # other runtime settings | ||
] | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import os.path as osp | ||
|
||
from .builder import DATASETS | ||
from .custom import CustomDataset | ||
|
||
|
||
@DATASETS.register_module() | ||
class waterpuddlesDataset(CustomDataset): | ||
"""water puddles dataset. | ||
|
||
In segmentation map annotation for Chase_db1, 0 stands for background, | ||
which is included in 2 categories. ``reduce_zero_label`` is fixed to False. | ||
The ``img_suffix`` is fixed to '_img.png' and ``seg_map_suffix`` is fixed to | ||
'_anno.png'. | ||
""" | ||
|
||
CLASSES = ('background','waterpuddle') | ||
|
||
PALETTE = [[120, 120, 120], [6, 230, 230]] | ||
|
||
def __init__(self, **kwargs): | ||
super(waterpuddlesDataset, self).__init__( | ||
img_suffix='.png', | ||
seg_map_suffix='.png', | ||
reduce_zero_label=False, | ||
**kwargs) | ||
assert osp.exists(self.img_dir) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too many comment paragraphs. Just keep L4-L9.