hysts / pytorch_mpiigaze

An unofficial PyTorch implementation of MPIIGaze and MPIIFaceGaze
MIT License
346 stars 85 forks source link

Architecture of the resnet-preact used in MPIIGaze dataset #51

Closed dreamer-1996 closed 3 years ago

dreamer-1996 commented 3 years ago

Hello :) I am trying to understand the architecture of the resnet preact model used for the MPIIGaze dataset. More specifically, I am trying to visualize the architecture. I am using a web service known as NN-SVG to auto-generate a diagram for the NN architecture. For that, I need to fill in some parameters on that web page. Can you help me in finding those parameters from your code? Thanks in advance.

hysts commented 3 years ago

Hi, @dreamer-1996

The website doesn't seem to support visualizing ResNet-like architecture. Anyway, you can get the information about the shape of the weights of the model by just running print(model) or something.

hysts commented 3 years ago

@dreamer-1996

I added this file to this repo. You can get the onnx model by running the following:

python convert_to_onnx.py --config configs/mpiigaze/resnet_preact_eval.yaml -o out.onnx

You can then use Netron to visualize the model. The visualization results are shown below.

dreamer-1996 commented 3 years ago

Thank you very much @hysts Can you explain me the output shape? (what's happening in the last concat?)

hysts commented 3 years ago

@dreamer-1996

It just concatenates the head pose vector and applies a linear transformation. Take a look at these lines.

dreamer-1996 commented 3 years ago

Thank you for the reply :) I got my answer.