alexppppp / keypoint_rcnn_training_pytorch

How to Train a Custom Keypoint Detection Model with PyTorch (Article on Medium)
https://medium.com/@alexppppp/how-to-train-a-custom-keypoint-detection-model-with-pytorch-d9af90e111da
MIT License
81 stars 31 forks source link

Training on custom dataset #4

Open eanemo opened 2 years ago

eanemo commented 2 years ago

Hi, first of all thank you for sharing your great job. I am trying to use a modified version of your code in order to train on a custom dataset with a different number of keypoints. After 5 epochs as you have done in your example. I have modified the code in order to use a different number of keypoints (6 keypoints): ClassDataset and the evaluation code (kpt_oks_sigmas for 6 keypoints). I obtain a model that gets a good detection of the object (bounding box) but the keypoints are not well located. For example:

left-foot3 target

This images show that the detection is getting trained but the keypoints are not. Moreover at the evaluation phase I always get values equal to zero:

IoU metric: keypoints 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 ] = 0.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 ] = 0.000 Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets= 20 ] = -1.000

I have revised the dataset and it seems well annotated, so I don't know where the errors are. Any idea? Thank you in advance.

alexppppp commented 2 years ago

Hi,

I need to see your modified script and your dataset

What is your email?

xaerincl commented 2 years ago

@eanemo

Did you ever find out what was happening?

patodichayan commented 1 year ago

@eanemo @alexppppp Did you ever find out the reason why the values are always zero?