yinguobing / cnn-facial-landmark

Training code for facial landmark detection based on deep convolutional neural network.
MIT License
623 stars 183 forks source link

landmark_video.py #66

Open abdou31 opened 4 years ago

abdou31 commented 4 years ago

Hello Yin, The video or the streaming of webcam that started from landmark_video.py is too slow ( the value of fps is low ). I would like to know, how can I increase this value?

yinguobing commented 4 years ago

The file landmark_video.py is deprecated. If you are targeting inference, try using TensorFlow Serving.

abdou31 commented 4 years ago

Yes I target the inference frozen graph. How can I use Tensorflow Serving?

yinguobing commented 4 years ago

There are two ways to increase the inference speed.

  1. using a smaller model.
  2. using accelerators like GPU.
abdou31 commented 4 years ago

The model that I use have 12 Mb and My GPU is Nvidia Geforce 840m ( 3 Go VRAM) The problem is not here, but is when I load the model on the phone. I know that you are not familiar with Android environment but I talk about ios environment ( you have a project that work with CORE ML and on ios devices ). How did you increase the fps on ios drvices?

yinguobing commented 4 years ago

iOS automatically handles the model inference process and there is almost nothing we can do on the hardware part. I think using lightweight model like Mobilenet is a better option.

abdou31 commented 4 years ago

I think so that is the same thing for Android device. If not , I will try to use MobileNet model Do you know how can I convert Resnet model to MobileNet or what can I change to use MobileNet model?

yinguobing commented 4 years ago

ResNet has a different architecture than Mobilenet, it means you will have to re-train it.

abdou31 commented 4 years ago

Do you have what are steps to change ResNet to MobileNet?

yinguobing commented 4 years ago

Note that we are not using ResNet in this repository. Theoretically you only need to replace the model in the model.py file.

abdou31 commented 4 years ago

Sorry, but I talk about the previous repository before update, it was ResNet model architecture? The change need to learn about the architecture of MobilNet. I really don't like to use the last repo. I want to use this old repo of CNN facial landmarks.