mmdetection
mmdetection copied to clipboard
Running inference on subset of Coco
I'm trying to run inference on 100 images selected from the COCO validation set, instead of the whole thing. I want to do example 6 in https://mmdetection.readthedocs.io/en/latest/1_exist_data_model.html
but only for 100 images in the 'person' category. I have the 100 images in its own directory and an annotation .json for those 100. How do I point the inference to that directory to produce instance segmentation results and output into an .json?
Sorry for didn't get your questions. If you have a new coco style dataset, you can directly use CocoDataset and set the ann_file to your local dir. For outputting results, you can use CocoDataset.format_results
It's not a new dataset, it's a subset of COCO val dataset. I want to make coarse segmentation results for post-processing. How do I use CocoDataset.format_results in the shell? Do I modify the config file or call CocoDataset in the command line?
If your dataset is a subclass of CocoDataset, you can add --format-only after the command line to call the function.
You need to create a JSON that only contain 100 images for now. In MMDet 3.x, you can set indices=100 with CLASSES=('person', ) to only load data of person and use the first 100 images.