ViTAE-Transformer / ViTPose

The official repo for [NeurIPS'22] "ViTPose: Simple Vision Transformer Baselines for Human Pose Estimation" and [TPAMI'23] "ViTPose++: Vision Transformer for Generic Body Pose Estimation"
Apache License 2.0
1.36k stars 186 forks source link

how to run inference with pretrained model? #139

Open leolle520 opened 4 months ago

leolle520 commented 4 months ago

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: ''

bilguudeiblgd commented 3 months ago

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.