mmpose icon indicating copy to clipboard operation
mmpose copied to clipboard

Evaluation of models with mmpose

Open IssaIssa1 opened this issue 3 years ago • 5 comments

I was able to train a model using mmpose on cooc tiny following the tutorial and run predict and inference.

But how may I evaluate my new model and report the accuracy metrics for example coco-tiny again. Is there any function/tutorial or api for this?

IssaIssa1 avatar Oct 16 '22 15:10 IssaIssa1

You can use tools/test.py for evaluation. Please refer to the doc for details.

ly015 avatar Oct 17 '22 03:10 ly015

I was trying to find a method to call for couple of images to evaluate the estimation. Is there is a method like model.evaluate(image, true_labels)?

IssaIssa1 avatar Oct 19 '22 01:10 IssaIssa1

For now, we don't have such an evaluation method. You can follow the steps below to evaluate the model:

  1. Organize your test data in a supported format (e.g. COCO)
  2. Set the test dataset in the model config file
  3. Run tools/test.py for evaluation

ly015 avatar Oct 19 '22 03:10 ly015

1- I have my data in this format following this link too {'images': [{'bbox': [], 'file_name': '', 'image_size': [], 'id': '', 'height': '', 'width': ''}], 'annotations': [{'keypoints': [], 'image_id': '', 'id': '', 'category_id': ''}], 'categories': [{'id': 1, 'name': 'person'}]}

2- I edited the config file same for the model I trained and changed the datasets directory 3- I am running this command !python ./mmpose/tools/test.py ./hrnet_w32_coco_256x192_test.py \ ./work_dirs/hrnet_w32_coco_tiny_256x192/best_PCK_epoch_40.pth \ --eval mAP

but I am getting this error FileNotFoundError: TopDownCocoDataset: [Errno 2] No such file or directory: 'data/coco/person_detection_results/COCO_val2017_detections_AP_H_56_person.json'

would you please advise on the matter?

IssaIssa1 avatar Oct 19 '22 13:10 IssaIssa1

Sorry for the late reply. You may need to set use_gt_bbox=True in data_cfg.

ly015 avatar Nov 01 '22 06:11 ly015