megvii-research / MSPN

Multi-Stage Pose Network

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

a question about test

CeasonCui opened this issue · comments

I try to test by my own data, and the json file is setting same as coco.
This is the test result.

~/MSPN/MSPN_HOME/exps/mspn.2xstg.selfdata$ python -m torch.distributed.launch --nproc_per_node=1 test.py -i 140800
loading annotations into memory...
Done (t=0.00s)
creating index...
index created!
100%|██████████████████████████████████████████████████████████████████████████| 4/4 [00:01<00:00, 2.29it/s]
2021-02-04 23:29:52 cuda-500-240jp SELF[9481] INFO Accumulating ...
2021-02-04 23:29:52 cuda-500-240jp SELF[9481] INFO Dumping results ...
results 108
2021-02-04 23:29:52 cuda-500-240jp SELF[9481] INFO Get all results.
Loading and preparing results...
DONE (t=0.01s)
creating index...
index created!
Running per image evaluation...
Evaluate annotation type keypoints
DONE (t=0.03s).
Accumulating evaluation results...
DONE (t=0.00s).
Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets= 20 ] = 0.000
Average Precision (AP) @[ IoU=0.50 | area= all | maxDets= 20 ] = 0.000
Average Precision (AP) @[ IoU=0.75 | area= all | maxDets= 20 ] = 0.000
Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets= 20 ] = -1.000
Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets= 20 ] = -1.000
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 20 ] = 0.000
Average Recall (AR) @[ IoU=0.50 | area= all | maxDets= 20 ] = 0.000
Average Recall (AR) @[ IoU=0.75 | area= all | maxDets= 20 ] = 0.000
Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets= 20 ] = -1.000
Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets= 20 ] = -1.000

And I check the results.json file like this:

[{"image_id": 108, "category_id": 1, "keypoints":
[388.43601989746094, -142.69078063964844, 1.340456247329712,
388.43601989746094, -142.69078063964844, 1.3361315727233887,
388.43601989746094, -142.69078063964844, 1.334479570388794,
388.43601989746094, -142.69078063964844, 1.3392943143844604,
388.43601989746094, -142.69078063964844, 1.3306572437286377,
388.43601989746094, -142.69078063964844, 1.3493973016738892,
388.43601989746094, -142.69078063964844, 1.3441457748413086,
388.43601989746094, -142.69078063964844, 1.3449093103408813,
388.43601989746094, -142.69078063964844, 1.3436510562896729,
388.43601989746094, -142.69078063964844, 1.350746989250183,
388.43601989746094, -142.69078063964844, 1.3383842706680298,
388.43601989746094, -142.69078063964844, 1.329496145248413,
388.43601989746094, -142.69078063964844, 1.3269803524017334,
388.43601989746094, 650.0357818603516, 1.2743829488754272,
388.43601989746094, 650.0357818603516, 1.2706503868103027,
388.43601989746094, 650.0357818603516, 1.3351771831512451,
388.43601989746094, 650.0357818603516, 1.3317900896072388],
"score": 0.0},

There are the same result of keypoint location, I think it is not work right. But

model_file = os.path.join(cfg.OUTPUT_DIR, "iter-{}.pth".format(args.iter))

the model_file is right, and I also try to test by "mspn_2xstg_coco.pth", which download from googledrive.

Can you help me? thankyou

I solved this problem.
The size of my own image is smaller than coco. scales *= 200 made the input image too small to predict.

test.py
def get_results(outputs, centers, scales, kernel=11, shifts=[0.25]):
# scales *= 200
nr_img = outputs.shape[0]

How to set the path of the pre training model