hollance / BlazeFace-PyTorch

The BlazeFace face detector model implemented in PyTorch
Other
421 stars 90 forks source link

Inference.ipynb Doesn't load #2

Closed krishnak closed 4 years ago

krishnak commented 4 years ago

There seems to be some issue, that this doesn't load, others are loading.

  1. I saw the RAW content of this ipynb and saw few images in it - not sure whether they are the cause.

  2. I had few questions which this code might have answered but I am not able to figure them out. a. the input to this network is 128x128 - I saw your comment in the raw code where it says we have to resize, if an image is available as 320x240 if we resize at will - the faces will be squashed - does the detector work with this or does it expect aspect ratios to be maintained.

b. How is the inference done after the concantenation layer, which produces a 1x896x1 output. What kind of detector is used?

c. You have experience with converting weights from tensorflow lite to pytorch. I have a requirement to transfer a model from pytorch to tensorflow lite, can you point me to a starter guide for this.

hollance commented 4 years ago

You can use https://nbviewer.jupyter.org if the notebook doesn't look on GitHub.

As for how BlazeFace works, please refer to the original paper: https://arxiv.org/abs/1907.05047

I don't have a starter guide for how to convert weights. Usually the steps are: 1. Figure out where the weights are in the original model and how to read them; 2. Figure out how to load weights into the destination model; 3. Map the layer names from the original model to the layer names in the destination model; 4. Transpose the weights if necessary.