1adrianb / face-alignment

:fire: 2D and 3D Face alignment library build using pytorch
https://www.adrianbulat.com
BSD 3-Clause "New" or "Revised" License
7.05k stars 1.34k forks source link

Caffe Model Conversion #132

Closed trohit920 closed 5 years ago

trohit920 commented 5 years ago

Hello, I have a simple question. I successfully downloaded the Pytorch model weights. I have to use OpenCV Dnn Module for Face Alignment in my application for which i am planning to use your trained models. But opencv doesn't support the Pytorch as of now. So I am wondering is there any way to convert these weights to caffe model or have you trained any caffe model for this purpose? Any help or advice will be highly appreciated. Thanks in advance.

1adrianb commented 5 years ago

Hi @trohit920,

Unfortunately I don't have them in this format. You can try one of the converters available on github, for example: https://github.com/MTlab/onnx2caffe that converts them via onnx.

trohit920 commented 5 years ago

@1adrianb Isn't .onnx and .pth model different ? The link you shared convert the .onnx model files to caffe model not .pth models. Am i doing something wrong in here..

1adrianb commented 5 years ago

Pytorch can directly convert pytorch models to onnx, see the pytorch jit module please.