opera icon indicating copy to clipboard operation
opera copied to clipboard

training, testing and demo testing of the petr multi-person pose model

Open Riverzxz opened this issue 3 years ago • 7 comments

Thanks for your work, I am in the process of using petr. How to start the training, testing and demo testing of the petr multi-person pose model? Can the steps be given? Looking forward to your reply and answer

Riverzxz avatar Jul 06 '22 09:07 Riverzxz

Evaluation bash tools/dist_test.sh $CONFIG $CHECKPOINT $NUM_GPU --eval keypoints ex) CUDA_VISIBLE_DEVICES=1,2 bash tools/dist_test.sh configs/petr/petr_r50_16x2_100e_coco.py checkpoint/petr_r50_16x2_100e_coco.pth 2 --eval keypoints

Training bash tools/dist_train.sh $CONFIG $NUM_GPU ex) CUDA_VISIBLE_DEVICES=1,2 bash tools/dist_train.sh configs/petr/petr_r50_16x2_100e_coco.py 2

Inference ex) python tools/test.py configs/petr/petr_r50_16x2_100e_coco.py checkpoint/petr_r50_16x2_100e_coco.pth --show-dir ./results

dae-sun avatar Jul 06 '22 09:07 dae-sun

Sorry to ask you again.I have an error Traceback (most recent call last): File "tools/test.py", line 251, in main() File "tools/test.py", line 190, in main dataset = build_dataset(cfg.data.test) File "/home/hjq/opera-main/opera/datasets/builder.py", line 83, in build_dataset dataset = build_from_cfg(cfg, DATASETS, default_args) File "/home/hjq/.conda/envs/open-mmlab/lib/python3.7/site-packages/mmcv/utils/registry.py", line 72, in build_from_cfg raise type(e)(f'{obj_cls.name}: {e}') FileNotFoundError: CocoPoseDataset: [Errno 2] No such file or directory: '/dataset/public/coco/annotations/person_keypoints_val2017.json'

Riverzxz avatar Jul 07 '22 17:07 Riverzxz

Did you download coco datasets and annotation files? you should download annotation files and images from [https://cocodataset.org/#download]. and fix data root on 'data_root = '/dataset/public/coco/', which is in [configs/base/datasets/coco_keypoint.py].

dae-sun avatar Jul 08 '22 07:07 dae-sun

Thank you for your help! !I am currently doing an Inference of the coco dataset. If I want to use a model to visually test a video, such as the dekr (cvpr2021) model: // python tools/inference_demo.py --cfg experiments/coco/inference_demo_coco.yaml
--videoFile ../multi_people.mp4
--outputDir output
--visthre 0.3
TEST.MODEL_FILE model/pose_coco/pose_dekr_hrnetw32.pth // What do I need to do in petr model?

Riverzxz avatar Jul 09 '22 08:07 Riverzxz

I couldn't find the video inference code in this repository.. I recommend converting mp4 videos into png frames for inference... or fix codes for video. I am sorry that I cannot help you.

dae-sun avatar Jul 10 '22 22:07 dae-sun

I use following code to evaluate the PETR ,but I have an error.

code:CUDA_VISIBLE_DEVICES=1 bash tools/dist_test.sh configs/petr/petr_r50_16x2_100e_coco.py checkpoint/petr_r50_16x2_100e_coco.pth 1 --show-dir /output --eval keypoints

could you please help me? image

STRUGGLE1999 avatar Sep 24 '22 08:09 STRUGGLE1999

It seems like torch vision's problem, please use following configuration: python 3.7 + torch 1.8 + cuda 10.1 + mmcv 1.5.3 + mmdet 2.25

Lukas-Ma1 avatar Nov 24 '23 01:11 Lukas-Ma1