-
Notifications
You must be signed in to change notification settings - Fork 10
[WIP] add AODNet and support cityscape foggy dataset #15
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
Open
hewanru-bit
wants to merge
13
commits into
main
Choose a base branch
from
hwr
base: main
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 6 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
c92b3b7
[Feature] Add EDFFNet
hewanru-bit 96b1f03
update
hewanru-bit 1f3c3c8
[feature]AODNet
hewanru-bit 25eb0ee
Merge branch 'main' into hwr
hewanru-bit 85b7756
Merge branch 'main' into hwr
hewanru-bit 1e3c3ed
up
hewanru-bit 336bfdf
[feature] add AODnet and support cityscape_foggy dataset
hewanru-bit 3ede0b3
[Feature]add AODNet and support cityscape foggy dataset
hewanru-bit 01b950c
modify
hewanru-bit e3b4a60
change the AODnet
hewanru-bit e1aa346
up
hewanru-bit 771831c
change
hewanru-bit 067372a
del some files
hewanru-bit 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 hidden or 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 |
---|---|---|
|
@@ -34,7 +34,7 @@ | |
src_key='img', | ||
dst_key='gt_edge', | ||
transforms=[ | ||
dict(type='Resize', scale=(1333, 800), keep_ratio=True), | ||
dict(type='Resize', scale=(256, 256), keep_ratio=True), | ||
dict(type='RandomFlip', prob=0.5) | ||
]), | ||
dict(type='lqit.PackInputs', ) | ||
|
@@ -53,3 +53,7 @@ | |
milestones=[8, 11], | ||
gamma=0.1) | ||
] | ||
|
||
optim_wrapper = dict( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. delete |
||
type='OptimWrapper', | ||
optimizer=dict(type='SGD', lr=0.0025, momentum=0.9, weight_decay=0.0001)) |
75 changes: 75 additions & 0 deletions
75
configs/edit/_base_/datasets/cityscape_enhancement_with_anno.py
This file contains hidden or 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,75 @@ | ||
# dataset settings | ||
dataset_type = 'mmdet.CityscapesDataset' | ||
data_root = 'data/Datasets/' | ||
|
||
file_client_args = dict(backend='disk') | ||
|
||
train_pipeline = [ | ||
dict(type='LoadImageFromFile', file_client_args=file_client_args), | ||
dict(type='LoadGTImageFromFile', file_client_args=file_client_args), | ||
dict( | ||
type='TransBroadcaster', | ||
src_key='img', | ||
dst_key='gt_img', | ||
transforms=[ | ||
dict(type='Resize', scale=(512, 512), keep_ratio=True), | ||
dict(type='RandomFlip', prob=0.5), | ||
]), | ||
dict(type='PackInputs') | ||
] | ||
test_pipeline = [ | ||
dict(type='LoadImageFromFile', file_client_args=file_client_args), | ||
dict(type='LoadGTImageFromFile', file_client_args=file_client_args), | ||
dict( | ||
type='TransBroadcaster', | ||
src_key='img', | ||
dst_key='gt_img', | ||
transforms=[dict(type='Resize', scale=(512, 512), keep_ratio=True)]), | ||
dict( | ||
type='PackInputs', | ||
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', | ||
'scale_factor')) | ||
] | ||
train_dataloader = dict( | ||
batch_size=2, | ||
num_workers=2, | ||
persistent_workers=True, | ||
sampler=dict(type='DefaultSampler', shuffle=True), | ||
dataset=dict( | ||
type='lqit.DatasetWithClearImageWrapper', | ||
dataset=dict( | ||
type=dataset_type, | ||
data_root=data_root, | ||
ann_file='cityscape_foggy/annotations_json/instancesonly_filtered_gtFine_train.json', | ||
data_prefix=dict(img='cityscape_foggy/train/', gt_img_path='cityscape/train/'), | ||
filter_cfg=dict(filter_empty_gt=True, min_size=32), | ||
pipeline=train_pipeline), | ||
suffix='png' | ||
)) | ||
|
||
val_dataloader = dict( | ||
batch_size=1, | ||
num_workers=2, | ||
persistent_workers=True, | ||
drop_last=False, | ||
sampler=dict(type='DefaultSampler', shuffle=False), | ||
dataset=dict( | ||
type='lqit.DatasetWithClearImageWrapper', | ||
dataset=dict( | ||
type=dataset_type, | ||
data_root=data_root, | ||
test_mode=True, | ||
indices=100, | ||
ann_file='cityscape_foggy/annotations_json/instancesonly_filtered_gtFine_test.json', | ||
data_prefix=dict(img='cityscape_foggy/test/', gt_img_path='cityscape/test/'), | ||
filter_cfg=dict(filter_empty_gt=True, min_size=32), | ||
pipeline=test_pipeline), | ||
suffix='png' | ||
)) | ||
|
||
test_dataloader = val_dataloader | ||
|
||
val_evaluator = [ | ||
dict(type='MSE', gt_key='img', pred_key='pred_img'), | ||
] | ||
test_evaluator = val_evaluator |
76 changes: 76 additions & 0 deletions
76
configs/edit/_base_/datasets/cityscape_enhancement_with_txt.py
This file contains hidden or 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,76 @@ | ||
# dataset settings | ||
dataset_type = 'CityscapeFoggyImageDataset' | ||
data_root = 'data/Datasets/' | ||
|
||
file_client_args = dict(backend='disk') | ||
|
||
train_pipeline = [ | ||
dict(type='LoadImageFromFile', file_client_args=file_client_args), | ||
dict(type='LoadGTImageFromFile', file_client_args=file_client_args), | ||
dict( | ||
type='TransBroadcaster', | ||
src_key='img', | ||
dst_key='gt_img', | ||
transforms=[ | ||
dict(type='Resize', scale=(512, 512), keep_ratio=True), | ||
dict(type='RandomFlip', prob=0.5), | ||
]), | ||
dict(type='PackInputs') | ||
] | ||
test_pipeline = [ | ||
dict(type='LoadImageFromFile', file_client_args=file_client_args), | ||
dict(type='LoadGTImageFromFile', file_client_args=file_client_args), | ||
dict( | ||
type='TransBroadcaster', | ||
src_key='img', | ||
dst_key='gt_img', | ||
transforms=[dict(type='Resize', scale=(512, 512), keep_ratio=True)]), | ||
dict( | ||
type='PackInputs', | ||
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', | ||
'scale_factor')) | ||
] | ||
train_dataloader = dict( | ||
batch_size=2, | ||
num_workers=2, | ||
persistent_workers=True, | ||
sampler=dict(type='DefaultSampler', shuffle=True), | ||
dataset=dict( | ||
type=dataset_type, | ||
data_root=data_root, | ||
metainfo=dict( | ||
dataset_type='cityscape_enhancement', task_name='enhancement'), | ||
ann_file='cityscape_foggy/train/train.txt', | ||
data_prefix=dict(img='cityscape_foggy/train/', gt_img='cityscape/train/'), | ||
search_key='img', | ||
img_suffix=dict(img='png', gt_img='png'), | ||
file_client_args=file_client_args, | ||
pipeline=train_pipeline, | ||
split_str='_foggy' | ||
)) | ||
val_dataloader = dict( | ||
batch_size=1, | ||
num_workers=2, | ||
persistent_workers=True, | ||
drop_last=False, | ||
sampler=dict(type='DefaultSampler', shuffle=False), | ||
dataset=dict( | ||
type=dataset_type, | ||
data_root=data_root, | ||
test_mode=True, | ||
metainfo=dict( | ||
dataset_type='cityscape_enhancement', task_name='enhancement'), | ||
ann_file='cityscape_foggy/test/test.txt', | ||
data_prefix=dict(img='cityscape_foggy/test/', gt_img='cityscape/test/'), | ||
search_key='img', | ||
img_suffix=dict(img='png', gt_img='png'), | ||
file_client_args=file_client_args, | ||
pipeline=test_pipeline, | ||
split_str='_foggy' | ||
)) | ||
test_dataloader = val_dataloader | ||
|
||
val_evaluator = [ | ||
dict(type='MSE', gt_key='img', pred_key='pred_img'), | ||
] | ||
test_evaluator = val_evaluator |
This file contains hidden or 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,39 @@ | ||
_base_ = [ | ||
'../_base_/datasets/cityscape_enhancement_with_txt.py', | ||
'../_base_/schedules/schedule_1x.py', | ||
'../_base_/default_runtime.py' | ||
] | ||
model = dict( | ||
type='lqit.BaseEditModel', | ||
data_preprocessor=dict( | ||
type='lqit.EditDataPreprocessor', | ||
mean=[0.0, 0.0, 0.0], | ||
std=[255.0, 255.0, 255.0], | ||
bgr_to_rgb=True, | ||
pad_size_divisor=32, | ||
gt_name='img'), | ||
generator=dict( | ||
_scope_='lqit', | ||
hewanru-bit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
type='AODNetGenerator', | ||
model=dict(type='AODNet'), | ||
pixel_loss=dict(type='MSELoss', loss_weight=1.0) | ||
)) | ||
|
||
|
||
train_cfg = dict(type='EpochBasedTrainLoop', max_epochs=10, val_interval=1) | ||
param_scheduler = [ | ||
dict( | ||
type='LinearLR', start_factor=0.0001, by_epoch=False, begin=0, | ||
end=1000), | ||
dict( | ||
type='MultiStepLR', | ||
begin=0, | ||
end=10, | ||
by_epoch=True, | ||
milestones=[6, 9], | ||
gamma=0.1) | ||
] | ||
|
||
optim_wrapper = dict( | ||
type='OptimWrapper', | ||
optimizer=dict(type='SGD', lr=0.001, momentum=0.9, weight_decay=0.0001)) |
This file contains hidden or 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from .data_preprocessor import * # noqa: F401,F403 | ||
from .dataset_wrappers import DatasetWithGTImageWrapper | ||
from .dataset_wrappers import DatasetWithGTImageWrapper, DatasetWithClearImageWrapper | ||
from .structures import * # noqa: F401,F403 | ||
from .transforms import * # noqa: F401,F403 | ||
|
||
__all__ = ['DatasetWithGTImageWrapper'] | ||
__all__ = ['DatasetWithGTImageWrapper', 'DatasetWithClearImageWrapper'] |
This file contains hidden or 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 hidden or 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from .basic_image_dataset import BasicImageDataset | ||
from .cityscape_foggy_dataset import CityscapeFoggyImageDataset | ||
|
||
__all__ = ['BasicImageDataset'] | ||
__all__ = ['BasicImageDataset', 'CityscapeFoggyImageDataset'] |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.