Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Face recognition: Facenet embeddings are not as expected when we use NCS. #260

Closed
SaiKrishnaDyavarasetti opened this issue Sep 24, 2019 · 2 comments

Comments

@SaiKrishnaDyavarasetti
Copy link

We are trying to convert TensorFlow supported facenet model to OpenVINO format for inferencing on Intel Movidius NCS stick

Model conversion from facenet.pb (TensorFlow format) to facenet.xml and facenet.bin (OpenVINO-IR supported FP16 format) was successful.

Below was the command used for conversion.
python3 ./mo_tf.py --input_model model/20180408-102900.pb --freeze_placeholder_with_value "phase_train->False" --reverse_input_channels --data_type FP16

The error here is in generation of embeddings from the converted models.

The fp16 format is a list of -1 and 1 numbers e.g. [-1 1 -1 1....]. We have attached the fp16 format( filename: embeddings_from_Movidius_fp16.png). We have also attached the corresponding openvino cpu optimized embeddings (fp32 format) which has no issues ( filename: embeddings_from_openvino_fp32.png)

Is there a way we can generate fp16 format embeddings correctly for Intel Movidius NCS?

Below is the link to the tensorflow based Facenet model used for conversion to Openvino:

https://drive.google.com/open?id=1Yye5KqgqAn_Q1hkNA27nIkZINJXeM0rf

We have tried all the suggestions mentioned in the Intel forum(link below) but it did not solve the issue
https://software.intel.com/zh-cn/node/802451

@shubha-ramani
Copy link

shubha-ramani commented Sep 24, 2019

Dear @SaiKrishnaDyavarasetti ,

The forum poster resolved it as follows:

@juan is correct. I have also researched and tested but forgot to reply. I came to the following conclusion.

-David sandberg trained the Facenet model using Inception Resnet v1.
-Facenet model using Inception Resnet v2 is not available any where.
-Movidius Neural compute stick 2 only support Intel Openvino SDK but Openvino and myriad 2 does not support Inception Resnet v1 architecture.
-NCSDK1 AND NCSDK2 libraries support Inception Resnet v1 Architecture but It doesnot support Movidius Neural compute stick 2 . So If by any chance you have old myriad stick 1 then you can run via NCSDK1 libraries

link- https://ncsforum.movidius.com/discussion/1308/ncsdk-support-ncs-2?Sort=date
link - https://software.intel.com/en-us/articles/OpenVINO-Using-TensorFlow#conv...

The only solution is to train the model on Inception resnet v2 or to use compute stick myriad 1 until intel allow support for Incpetoin resnet v1 on new myriad devices.

Customers have been able to get Facenet working on NCS2 by retraining the model on Inception resnet v2.

There is actually an outstanding feature request on this issue - supporting Inception Resnet V1 on NCS2.

Hope it helps,

Thanks,

Shubha

@sahira-rizvi
Copy link

Closing, feel free to re-open or create a new issue if additional assistance is needed.

Sincerely,
Sahira

redradist pushed a commit to redradist/openvino that referenced this issue Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants