Closed YOOHYOJEONG closed 2 years ago
I couldn't identify the problem you describe. We've updated the to_coco.py. Please make sure to use the latest bdd100k and scalabel package.
I downloaded and converted the data as written here, but the above error occurred. This is because key indicated by to_coco.py and the key indicated by MOT did not match. For example, occluded=label["attributes"]["Occluded"]. MOT 2020 Labels have "occluded" not "Occluded". (Other cases are the same.) So, I fixed the error by correcting the corresponding part of to_cocopy.
Thanks for bringing this issue to our attention, the script may be a bit out of date. Hopefully the fix you provided is enough in your case. We will fix it in the next update.
Traceback (most recent call last): File "/home/hjyoo/anaconda3/envs/qdtrack/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/home/hjyoo/anaconda3/envs/qdtrack/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/home/hjyoo/anaconda3/envs/qdtrack/lib/python3.8/site-packages/bdd100k-1.0.0-py3.8.egg/bdd100k/label/to_coco.py", line 340, in main()
File "/home/hjyoo/anaconda3/envs/qdtrack/lib/python3.8/site-packages/bdd100k-1.0.0-py3.8.egg/bdd100k/label/to_coco.py", line 329, in main coco = bdd100k2coco_track(
File "/home/hjyoo/anaconda3/envs/qdtrack/lib/python3.8/site-packages/bdd100k-1.0.0-py3.8.egg/bdd100k/label/to_coco.py", line 242, in bdd100k2coco_track
frame_id=image_anns["index"],
KeyError: 'index'
and
File "/home/hjyoo/anaconda3/envs/qdtrack/lib/python3.8/site-packages/bdd100k-1.0.0-py3.8.egg/bdd100k/label/to_coco.py", line 279, in bdd100k2coco_track occluded=label["attributes"]["Occluded"], KeyError: 'Occluded'
and
File "/home/hjyoo/anaconda3/envs/qdtrack/lib/python3.8/site-packages/bdd100k-1.0.0-py3.8.egg/bdd100k/label/to_coco.py", line 280, in bdd100k2coco_track truncated=label["attributes"]["Truncated"], KeyError: 'Truncated'
------------------------------
In line with BDD tracking dataset json file, to_coco.py need to be modified.
1. KeyError : "index"
at bdd100k-1.0.0-py3.8.egg/bdd100k/label/to_coco.py, line 242
2. KeyError : "Occluded"
at bdd100k-1.0.0-py3.8.egg/bdd100k/label/to_coco.py", line 279, in bdd100k2coco_track
3. KeyError: 'Truncated'
at bdd100k-1.0.0-py3.8.egg/bdd100k/label/to_coco.py", line 280, in bdd100k2coco_track