WongKinYiu / yolov7

Implementation of paper - YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors
GNU General Public License v3.0
13.25k stars 4.18k forks source link

train pose estimator with general number of keypoints #1000

Open ghost opened 1 year ago

ghost commented 1 year ago

how to train the pose estimator with a custom number of keypoints

what do i need to change for general number of keypoints

KAWAKO-in-GAYHUB commented 1 year ago

I wonder it too.

jmackay2 commented 1 year ago

@vshesh has done a good job removing the hard-coded keypoint numbers in his fork here, allowing for training with any number of keypoints: https://github.com/vshesh/yolov7-pose-fix-dataloader/tree/pose

xs818818 commented 1 year ago

please help me how to train yolov7-w6-person.pt,i get a error python3 train_aux.py --workers 1 --device 0 --batch-size 4 --data data/manipulator.yaml --img 960 960 --cfg cfg/training/yolov7-w6.yaml --weights '' --name manipulator --hyp data/hyp.scratch.p5.yaml python3 train.py --data data/manipulator_one.yaml --cfg cfg/yolov7-w6-manipulator-one.yaml --weights weights/yolov7-w6-manipulator-one.pt --batch-size 4 --img 960 --kpt-label --sync-bn --device 0 --name yolov7-point4 --hyp data/hyp.pose.yaml Can't get attribute 'IAuxDetect' on <module 'models.yolo' from '/workspace/pytorch/yolov7-point/models/yolo.py'>

nomaad42 commented 1 year ago

Hi! @jmackay2

Do you know, has he modified every place of the code in the entire project (Including: loss.py, datasets.py, yolo.py, hub/model.yaml, plots.py) to train on a custom dataset (so num of keypoints could be 8,9,10, etc)?

vshesh commented 1 year ago

Not quite, I had to add one constant somewhere because I couldn't easily figure out how to thread the values through. I was also confused that nkpts is set in both the model and the dataset and wasn't sure what to take the value from. IMO dataset makes more sense but the code liberally uses both so I didn't clean it up.