Open lazerliu opened 4 years ago
While I use the original darknet yolov3 valid these same images,it generate the right json like this
{"image_id":0, "category_id":2, "bbox":[356.486206, 2.146976, 12.569397, 7.220934], "score":0.029387},
{"image_id":0, "category_id":2, "bbox":[311.298920, 2.309143, 28.693665, 17.816805], "score":0.006101},
{"image_id":1, "category_id":2, "bbox":[378.651367, 288.187378, 12.964233, 16.216003], "score":0.991247},
{"image_id":1, "category_id":1, "bbox":[289.078491, 54.320377, 21.093567, 8.391327], "score":0.006931},
{"image_id":1, "category_id":2, "bbox":[289.078491, 54.320377, 21.093567, 8.391327], "score":0.640269},
{"image_id":1, "category_id":1, "bbox":[255.469391, 489.705231, 30.240356, 10.294769], "score":0.079129},
{"image_id":1, "category_id":1, "bbox":[267.355560, 493.283203, 18.491638, 6.514526], "score":0.035697},
You can use ./darknet detector valid
only for MSCOCO, PascalVOC, BDD100k, Kitti and ImageNet datasets.
For you custom dataset you should use ./darknet detector map
...
You can't get AP_s, AP_l, ... for you custom dataset. You should implement your own code.
Thanks for your reply,I will try to implement it.
@lazerliu Did you manage to find the issue?
I am facing the same problem while generating the coco_results.json
with ./darknet detector valid
for 5k.txt
set of images on val2014
.
Thanks for your reply,I will try to implement it.
I am facing the same problem,have you solved this issue? or could you implement this?
@lazerliu Did you manage to find the issue? I am facing the same problem while generating the
coco_results.json
with./darknet detector valid
for5k.txt
set of images onval2014
.
Because the name format of "val2014" is "COCO_val2014_000000522418.jpg",but in :
https://github.com/AlexeyAB/darknet/blob/9ff8653d999c8a22bc8f1ff4f4a8a3cc5b63d255/src/detector.c#L463,
It uses base_cfg():
https://github.com/AlexeyAB/darknet/blob/9ff8653d999c8a22bc8f1ff4f4a8a3cc5b63d255/src/utils.c#L168
So the file name of val2014 can't be parsed to int
in line465, then you can see all the image_ids are zeros.
You can uncomment the get_coco_image_id(image_path) then it will work.
If you are using a custom dataset, you can also change the code of get_coco_image_id to get the correct image_id.
Dear Alexey, First of all, thank you for your great work.
I've used
valid
to generatecoco_results.json
,but I got all theimage_id
is0
,my results like this:and my
test.txt
like thisIs there any problem? Thank you very very much!