ViTPose icon indicating copy to clipboard operation
ViTPose copied to clipboard

how to run inference with pretrained model?

Open leolle520 opened this issue 1 year ago • 1 comments

Hi, I tried following code to run inference on single image with the downloaded ViT-large model:

python demo/top_down_img_demo.py \
    configs/body/2d_kpt_sview_rgb_img/topdown_heatmap/coco/ViTPose_base_coco_256x192.py \
    ViTPose/resources/td-hm_ViTPose-large_8xb64-210e_coco-256x192-53609f55_20230314.pth \
    --img data/44018/pic_0000000.jpg \
    --out-img-root target 

It reminds me coco annotation file? File "ViTPose/demo/top_down_img_demo.py", line 57, in main coco = COCO(args.json_file) File "anaconda3/envs/pose/lib/python3.9/site-packages/xtcocotools/coco.py", line 93, in init with open(annotation_file, 'r') as f: FileNotFoundError: [Errno 2] No such file or directory: ''

leolle520 avatar Jun 12 '24 07:06 leolle520

If you are using demo/top_down_img_demo.py you need to add the .json gt file that's coco formatted and give parameter --img-root the folder containing images with the same id as .json file.

bilguudeiblgd avatar Jul 29 '24 08:07 bilguudeiblgd