megvii-research / Iter-E2EDET

Official implementation of the paper "Progressive End-to-End Object Detection in Crowded Scenes"
MIT License
89 stars 8 forks source link

KeyError: 'ID' #17

Open hbu-cv opened 2 years ago

hbu-cv commented 2 years ago

When I run the eval_result.py file, I get the following error:

Saving is Done... Processing mountain.human Traceback (most recent call last): File "eval_result.py", line 107, in eval_result() File "eval_result.py", line 103, in eval_result computeIoUs(fpath, 0.05) File "eval_result.py", line 35, in computeIoUs mAP, mMR = compute_mAP(fpath) File "/root/autodl-tmp/Iter-E2EDET/utils/common.py", line 28, in compute_mAP db = EvalDB(dbName, '',gtpath, dtpath, None) File "/root/autodl-tmp/Iter-E2EDET/utils/detToolkits/detools/database.py", line 496, in init super(EvalDB, self).init(dbName, imgroot, gtpath, dtpath) File "/root/autodl-tmp/Iter-E2EDET/utils/detToolkits/detools/database.py", line 144, in init self.loadOdf(gtpath, "gt") File "/root/autodl-tmp/Iter-E2EDET/utils/detToolkits/detools/database.py", line 246, in loadOdf if odf["ID"] not in self.images: KeyError: 'ID'

yexiguafuqihao commented 2 years ago

You can download the evaluation dataset from this page and update the anno_file in the config.py.

AlterRay commented 11 months ago

Hello! I've meet the same issue. I've downloaded the annotation_val.odgt file and modified the anno_file in config.py, but I'm still facing the KeyError: 'ID' problem. Could you please advise on how to resolve this issue?

This is my config.py : imgDir = '/disk/datasets/CrowdHuman/Images' json_dir = '/disk/datasets/CrowdHuman/annotations' train_json = osp.join(json_dir, 'train.json') eval_json = osp.join(json_dir, 'val.json')

dirpath = '/disk/datasets/CrowdHuman/crowdhuman' train_file = osp.join(dirpath,'annotation_train.odgt') anno_file = osp.join(dirpath, 'annotation_val.odgt')

And the evaluation commands I'm using are:

python3 train_net.py --num-gpus 1 --config-file configs/50e.6h.500pro.ignore.yaml --eval-only MODEL.WEIGHTS /checkpoint/e2edet_final.pth

python eval_result.py

yexiguafuqihao commented 11 months ago

Please refer to this for the solution.