dbolya / yolact

A simple, fully convolutional model for real-time instance segmentation.
MIT License
5k stars 1.33k forks source link

How to get coco json format? #622

Open 7eta opened 3 years ago

7eta commented 3 years ago

thanks, source code. I ran the Anaconda env, pytorch = 1.0.1 on winodws 10 I run the line python eval.py --trained_model=weights/yolact_base_54_800000.pth --score_threshold=0.15 --top_k=15 --image=my_image.png and then see the result image. Now, I hope to get the coco style's json from this result image. so I typed python eval.py --trained_model=weights/yolact_base_54_800000.pth --output_coco_json --score_threshold=0.15 --top_k=15 --image=my_image.png but no generated json file anywhere.

result Config not specified. Parsed yolact_base_config from the file name. Loading model... Done.

How to get coco json file from my image data using eval.py ?

I will transfer coco json file to label me json file, then modify the polygon or add new polygon.

PL-96 commented 3 years ago

Have you solved it? You may get some help from #625. Give "--dataset" parameter instead of "--image"

7eta commented 3 years ago

@PL-96 Thanks, you means that python eval.py --trained_model=weights/yolact_base_54_800000.pth --output_coco_json --score_threshold=0.15 --top_k=15 --dataset=my_image.png right?

naivelogic commented 3 years ago

@7eta that, but not just limited to 1 image, but even to the image folder. When running eval.py on an image folder, even with --output_coco_json I havent been able to get the json output. I've only been able to get it when validating the dataset.

edit: just saw this related open issue: #544

PL-96 commented 3 years ago

@PL-96 Thanks, you means that python eval.py --trained_model=weights/yolact_base_54_800000.pth --output_coco_json --score_threshold=0.15 --top_k=15 --dataset=my_image.png right?

you may add custom_dataset definition in config.py like coco2017_testdev_dataset and set 'has_gt' to False. Then use "--dataset" parameter

7eta commented 3 years ago

@PL-96 Hi. I am too late. sorry. I changed 'has_gt': True to False but NameError: name 'my_image' is not defined... hmm... How to run it? Error line is 825 in set_dataset of ./data/config.py No way activate --output_coco_json using --my_imgae.png ? I am Panic...

DongWoo-Nam commented 3 years ago

@7eta I also want to print out the result in the json file, but I can't find a way. If the problem is solved, please share it with me.