Closed yc0619 closed 3 years ago
Thank you for your feedback. I think this feature is very important, but it is not currently supported. We will support no gt prediction mode ASAP.
ok, is it possible, to test with a not full labeled pic? And get the full segm result?
And how long might take the new version that support prediction with no labeled images? Sorry for asking that, i am making a project with a deadline. So ...
[fake prediction - per test]
./tools/dist_test.sh configs/models/mask_rcnn_r50_fpn_2x_coco.py work_dirs/saved.pth 1 --format-only --options "jsonfile_prefix=./mask_rcnn_test-dev_results"
I am still working on how to convert the segm.json from mmdetection result to labelme. It isn't not a beautiful way to do the prediction. But it works at least. Hope it could help someone, who need the prediction function.
Sorry! No specific time has been set for now, but if you are interested, you can create a PR.
Sure, no problem. I will try my best. Haha! Thanks again!
Looking forward to your contribution!
Hello, I'm also confused about predicting without label. After changing the config _base_/datasets/coco_detection.py
line 45 to ann_file=None
and line 46 to img_prefix=data_root + 'test2017/'
, it caused an error:
`
tools/test.py:96: UserWarning: --options is deprecated in favor of --eval-options
warnings.warn('--options is deprecated in favor of --eval-options')
Traceback (most recent call last):
File "/root/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/mmcv/utils/registry.py", line 179, in build_from_cfg
return obj_cls(**args)
File "/root/mmdetection/mmdet/datasets/custom.py", line 87, in init
self.data_infos = self.load_annotations(self.ann_file)
File "/root/mmdetection/mmdet/datasets/coco.py", line 58, in load_annotations
self.cat_ids = self.coco.get_cat_ids(cat_names=self.CLASSES)
File "/root/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/pycocotools/coco.py", line 206, in get_cat_ids
return self.getCatIds(cat_names, sup_names, cat_ids)
File "/root/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/pycocotools/coco.py", line 192, in getCatIds
cats = self.dataset['categories']
KeyError: 'categories'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "tools/test.py", line 220, in
Is this the correct way to predict without label?
Hi,
i have implemented on my own dataset. I think you can maybe use pytorch to load your trained model and write a predict line.
I have tried it on mmdetection as the same way as the testpipeline. Before the prediction, i have added on my data some fake labels and convert them to coco-format. Then i run the testpipeline to get the true predicted segmentation and bbox.
Hi,
i have implemented on my own dataset. I think you can maybe use pytorch to load your trained model and write a predict line.
I have tried it on mmdetection as the same way as the testpipeline. Before the prediction, i have added on my data some fake labels and convert them to coco-format. Then i run the testpipeline to get the true predicted segmentation and bbox.
Thank you for your reply. It's an effective way to generate fake labels and then predict. I will try it later.
@hhaAndroid this would be a very useful feature for high throughput prediction generation. Creating the dummy json files is also a viable solution, but more time consuming.
@hhaAndroid this would be a very useful feature for high throughput label generation. Creating the dummy json files is also a viable solution, but more time consuming.
I use labelme to annotate my data. So i have set a dict as the labelme.json and give every picture, which needs to be predicted an annotation at the middle of the picture in the same size and a class for it. Then convert it in batch as coco-format dataset. It's quite easy by making dummy json file. 👍 Good luck by implement!
@yc0619 Thank you! Yes it isn't bad to make the annotations, I did it similarly using a simple python script. The problem is when we want to run test on very large sets of data (100k+ or 1M+), where loading the dummy annotations can slow eval times.
Hi,
related to the issue #4768
what i want to do is:
i have tried your command to get segm_result and bbox_result from mask_rcnn.
./tools/dist_test.sh configs/_cfv/mask_rcnn_r50_fpn_2x_coco.py work_dir/r50best.pth 1 --format-only --options "jsonfile_prefix=./mask_rcnn_test-dev_results"
and i think the test is running, but at the end it comes, and the semg and bbox results are empty.
subprocess.CalledProcessError: Command '['/home/chao/anaconda3/envs/mmlab/bin/python', '-u', './tools/test.py', '--local_rank=0', 'configs/_cfv/mask_rcnn_r50_fpn_2x_coco.py', 'work_dir/r50best.pth', '--launcher', 'pytorch', '--format-only', '--options', 'jsonfile_prefix=./mask_rcnn_test-dev_results']' returned non-zero exit status 1.
What i've made before run the cmd:
I would like to ask, if i can use test.py to predict the no labeled images. And how can i do it?