-
Notifications
You must be signed in to change notification settings - Fork 9.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
reimplement cityscapes #2089
reimplement cityscapes #2089
Conversation
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.
In faster rcnn config, the type should change back to faster rcnn. Otherwise, it will cause error due to the lack of mask_head config.
The doc may indicate the users that it uses pre-trained models that need to be download from the remote servers thus the users can decide whether to download it before training or leave it for training. This might cause errors due to network or some other issues if the download is proceded in training.
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.
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.
I don't think it a good idea to read Read original Cityscapes dataset annotation since it's very slow compared to using genertated coco format annotation(about 5s). |
Thanks for your valuable advice. Actually, I just updated the comment of this PR. A user-friendly convert script is provided to generate COCO style annotations. You could check it out here. It would be merged into master recently. Btw, if there is any issue about this PR, you are very welcomed to point it out or make a PR in the future. |
Nice! Looking forward to the new implementation:) |
mmdet/datasets/cityscapes.py
Outdated
""" | ||
The correct CLASSES order in official cityscapes should be | ||
CLASSES = ('person', 'rider', 'car', 'truck', 'bus', 'train', 'motorcycle', | ||
'bicycle') |
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.
This comment can be removed.
tools/convert_datasets/cityscapes.py
Outdated
gt_dir = osp.join(cityscapes_path, args.gt_dir) | ||
|
||
set_name = dict( | ||
train='instance_train_gtFine.json', |
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.
We may also use instancesonly_filtered_gtFine_xxx.json
mmdet/datasets/cityscapes.py
Outdated
results, | ||
metric='bbox', | ||
logger=None, | ||
jsonfile_prefix=None, |
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.
Maybe renamed to outfile_prefix
since the output file may be a json or txt.
mmdet/datasets/cityscapes.py
Outdated
""" | ||
eval_results = dict() | ||
|
||
metrics = metric if isinstance(metric, list) else [metric] |
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.
Copy it if it is a list, because we remove cityscapes
from the list.
tools/convert_datasets/cityscapes.py
Outdated
|
||
def parse_args(): | ||
parser = argparse.ArgumentParser( | ||
description='Convert Cityscapes annotations to mmdetection format') |
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.
to COCO format
configs/cityscapes/README.md
Outdated
|
||
|
||
### Faster R-CNN | ||
|
||
| Backbone | Style | Lr schd | Scale | Mem (GB) | Train time (s/iter) | Inf time (fps) | box AP | Download | | ||
| :-------------: | :-----: | :-----: | :---: | :------: | :-----------------: | :------------: | :----: | :------: | | ||
| R-50-FPN | pytorch | 1x | 800-1024 | 4.9 | 0.345 | 8.8 | 36.0 | [model](https://open-mmlab.s3.ap-northeast-2.amazonaws.com/mmdetection/models/cityscapes/faster_rcnn_r50_fpn_1x_city_20190727-7b9c0534.pth) | | ||
| R-50-FPN | pytorch | 1x | 800-1024 | 4.9 | 0.345 | 8.8 | 41.6 | [model](https://open-mmlab.s3.ap-northeast-2.amazonaws.com/mmdetection/models/cityscapes/faster_rcnn_r50_fpn_1x_cityscapes_20200227-362cfbbf.pth) | |
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.
Train time and Inf time are outdated.
@@ -1,7 +1,7 @@ | |||
# model settings | |||
model = dict( | |||
type='FasterRCNN', | |||
pretrained='modelzoo://resnet50', | |||
pretrained='torchvision://resnet50', |
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.
Since we have specified load_from
, pretrained
can be left None.
The tools/test.py is running on the test set by default. mmdetection/configs/cityscapes/faster_rcnn_r50_fpn_1x_cityscapes.py Lines 149 to 154 in 51df8a9
Should it be changed to val? |
We usually submit |
* reimplement cityscapes * fixed gt bbox mode * convert cityscapes to coco style, add cityscapes eval * add cityscapes convert script * add doc * Update INSTALL.md * Update INSTALL.md * update fater rcnn * fix cityscapes eval * support format only in cityscapes * add docs * remove redundancy * resolve eval * update cityscapes md * more doc and rename * update doc and cfg * change to test set
* reimplement cityscapes * fixed gt bbox mode * convert cityscapes to coco style, add cityscapes eval * add cityscapes convert script * add doc * Update INSTALL.md * Update INSTALL.md * update fater rcnn * fix cityscapes eval * support format only in cityscapes * add docs * remove redundancy * resolve eval * update cityscapes md * more doc and rename * update doc and cfg * change to test set
* reimplement cityscapes * fixed gt bbox mode * convert cityscapes to coco style, add cityscapes eval * add cityscapes convert script * add doc * Update INSTALL.md * Update INSTALL.md * update fater rcnn * fix cityscapes eval * support format only in cityscapes * add docs * remove redundancy * resolve eval * update cityscapes md * more doc and rename * update doc and cfg * change to test set
This PR reimplemented Cityscapes dataset support.