irislandmarks.pytorch icon indicating copy to clipboard operation
irislandmarks.pytorch copied to clipboard

Training code

Open shreyasashwath opened this issue 4 years ago • 3 comments
trafficstars

Hi cedriclmenard, Could you please provide the training code for this repo that would be very helpful. Thanks

shreyasashwath avatar May 24 '21 11:05 shreyasashwath

Hi @shreyasashwath,

You can take a look at the class definition in irislandmarks.py, especially at the predict and the forward methods. Training can be done as with any PyTorch models if you feed the right data. For a simpler implementation of training, I suggest looking into PyTorch-Lightning.

The goal of this repo is to reproduce the same results using the same weights given by the original authors (Google's Mediapipe), this is why no training is implemented here.

cedriclmenard avatar Jun 03 '21 02:06 cedriclmenard

Hi @shreyasashwath,

You can take a look at the class definition in irislandmarks.py, especially at the predict and the forward methods. Training can be done as with any PyTorch models if you feed the right data. For a simpler implementation of training, I suggest looking into PyTorch-Lightning.

The goal of this repo is to reproduce the same results using the same weights given by the original authors (Google's Mediapipe), this is why no training is implemented here.

@cedriclmenard Yes agree training can be done using any PyTorch model with right data. Can we train this model with few key-points like if i have to extend this to face landmarks (98 keypoints)? and which places we should use Batch normalised layer ?

sainisanjay avatar Aug 10 '22 15:08 sainisanjay

For face landmarks, I suggest looking at the FaceMesh repo. You can definitely use this model, but you'll have to modify it according to the output size you need.

Batch norm layers, if there were any in the original training implementation by Google Mediapipe, have been folded in the convolution weights, so you can figure where batch norm layers could go given that.

cedriclmenard avatar Aug 10 '22 15:08 cedriclmenard