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

pip install insightface and https://insightface.ai #891

Closed
nttstar opened this issue Sep 5, 2019 · 20 comments
Closed

pip install insightface and https://insightface.ai #891

nttstar opened this issue Sep 5, 2019 · 20 comments
Labels

Comments

@nttstar
Copy link
Collaborator

nttstar commented Sep 5, 2019

are both online.
Any suggestion is welcome!
For pip source code, please refer to https://github.com/deepinsight/insightface/tree/master/python-package

2021.05.15 Update:

pip insightface-0.2.0 is ready now. Please update with pip install -U insightface

For insightface pip-package <= 0.1.5, we use MXNet as inference backend, please download all models from onedrive, and put them all under ~/.insightface/models/ directory.

Starting from insightface>=0.2, we use onnxruntime as inference backend, please download our antelope model release from onedrive, and put it under ~/.insightface/models/, so there're onnx models at ~/.insightface/models/antelope/*.onnx.

The antelope model release contains ResNet100@Glint360K recognition model and SCRFD-10GF detection model. Please check deploy/test.py for detail.

@nttstar nttstar pinned this issue Sep 5, 2019
@nttstar nttstar changed the title Hey, pip install insightface and http://insightface.ai pip install insightface and http://insightface.ai Sep 5, 2019
@nttstar nttstar added the Example label Sep 5, 2019
@Talgin
Copy link

Talgin commented Sep 5, 2019

Hi, @nttstar
I think you have an error on 47th line of face_recognition - you don't have model parameter in your class.

Regards,

@nttstar
Copy link
Collaborator Author

nttstar commented Sep 5, 2019

@Talgin We should call prepare() first then we will have self.model var.

@Talgin
Copy link

Talgin commented Sep 5, 2019

Oh, sorry, I see it now 👍

@rebotnix
Copy link

rebotnix commented Sep 6, 2019

please add

from future import division
import mxnet as mx
import numpy as np
import mxnet.ndarray as nd
import cv2

in your face_detection.py

or you will get an issue when you change scaling call in your tutorial example when you want to resize the image cause cv2 is missing.

bboxes, landmark = model.detect(img, threshold=0.5, scale=0.5)

@RomanSteinberg
Copy link

RomanSteinberg commented Sep 9, 2019

Hi,

  1. Relative imports is a bad style which can cause building errors. Consider
from ..model_zoo import model_zoo

replace with

from insightface.model_zoo import model_zoo
  1. You should check PEP8.
  2. There is no minimal example to run in README. It will also answer questions like @Talgin asked.
  3. There is a good practice called RAII. Your prepare methods contradict this idiom. Please, consider refactoring.

@RomanSteinberg
Copy link

@nttstar I installed your package and ran the following code:

import cv2
import sys
import insightface

from PyQt5.QtWidgets import QApplication

# The following line changes results of gender-age model.
# gender == 1, if the following line is commented
# gender == 0, if the following line isn't commented
QApplication(sys.argv)  

fa = insightface.app.FaceAnalysis()
fa.prepare(-1)
img = cv2.imread('Tom_Hanks_54745.png')
face = fa.get(img)[0]
print(face.gender)

The comment in this code describes the problem I found. I created an issue #899 which can give you more information about this problem.

@nttstar
Copy link
Collaborator Author

nttstar commented Sep 9, 2019

@RomanSteinberg Quite strange. It should always output 1(male). What if put QApplication(sys.argv) this line in the end of your script?

@RomanSteinberg
Copy link

@nttstar it outputs 1

@dexception
Copy link

off topic:

@nttstar
Can you share some details on how to train RetinaNet on Resnet-18 or Resnet 10 to make it real time ?

@khanhnt
Copy link

khanhnt commented Oct 10, 2019

Hi @nttstar,

Thank you for your work. While using FaceAnalysis, we met the issue where the program was unsuccessful in loading the model and fall in a loop with the following message:

src/nnvm/legacy_json_util.cc:209: Loading symbol saved by previous version v1.3.0. Attempting to upgrade...
src/nnvm/legacy_json_util.cc:217: Symbol successfully upgraded!
src/operator/nn/./cudnn/./cudnn_algoreg-inl.h:97: Running performance tests to find the best convolution algorithm, this can take a while... (set the environment variable MXNET_CUDNN_AUTOTUNE_DEFAULT to 0 to disable)

We also got the same issue when using the detection (retina) and recogntion together, event the detection and the recogntion was executed on different GPU.
It's ok when runing two or more recogtion instances.
I tried to export MXNET_CUDNN_AUTOTUNE_DEFAULT to 0 and also update cudnn_tune in R50-symbol.json to "off", but it is not ok.

Updated: the issues was fixed by increasing timeout value while loading model

@ucasiggcas
Copy link

ucasiggcas commented Nov 27, 2019

hi,dear,
I want to use the mobilenet model,could it be used directly,for I do not want to install mxnet.
and if I install the insightface, must I install the mxnet ??

thx

@Programmerwyl
Copy link

Programmerwyl commented Dec 19, 2019

Hi :
How to tell if two faces are the same person?
which parameter was used ?
embedding ,embedding_norm,normed_embedding

face = Face(bbox = bbox, landmark = landmark, det_score = det_score, embedding = embedding, gender = gender, age = age
                    , normed_embedding=normed_embedding, embedding_norm = embedding_norm)

Is the function ‘compute_sim’ used to calculate the distance between two faces?  how to set threshold

def compute_sim(self, img1, img2):

@benouinirachid
Copy link

Hi @nttstar,

Thank you for your work. While using FaceAnalysis, we met the issue where the program was unsuccessful in loading the model and fall in a loop with the following message:

src/nnvm/legacy_json_util.cc:209: Loading symbol saved by previous version v1.3.0. Attempting to upgrade...
src/nnvm/legacy_json_util.cc:217: Symbol successfully upgraded!
src/operator/nn/./cudnn/./cudnn_algoreg-inl.h:97: Running performance tests to find the best convolution algorithm, this can take a while... (set the environment variable MXNET_CUDNN_AUTOTUNE_DEFAULT to 0 to disable)

We also got the same issue when using the detection (retina) and recogntion together, event the detection and the recogntion was executed on different GPU.
It's ok when runing two or more recogtion instances.
I tried to export MXNET_CUDNN_AUTOTUNE_DEFAULT to 0 and also update cudnn_tune in R50-symbol.json to "off", but it is not ok.

Updated: the issues was fixed by increasing timeout value while loading model

Could you please provide more details on how you set the timeout ?

@khanhnt
Copy link

khanhnt commented Jan 27, 2020

Hi @nttstar,
Thank you for your work. While using FaceAnalysis, we met the issue where the program was unsuccessful in loading the model and fall in a loop with the following message:

src/nnvm/legacy_json_util.cc:209: Loading symbol saved by previous version v1.3.0. Attempting to upgrade...
src/nnvm/legacy_json_util.cc:217: Symbol successfully upgraded!
src/operator/nn/./cudnn/./cudnn_algoreg-inl.h:97: Running performance tests to find the best convolution algorithm, this can take a while... (set the environment variable MXNET_CUDNN_AUTOTUNE_DEFAULT to 0 to disable)

We also got the same issue when using the detection (retina) and recogntion together, event the detection and the recogntion was executed on different GPU.
It's ok when runing two or more recogtion instances.
I tried to export MXNET_CUDNN_AUTOTUNE_DEFAULT to 0 and also update cudnn_tune in R50-symbol.json to "off", but it is not ok.
Updated: the issues was fixed by increasing timeout value while loading model

Could you please provide more details on how you set the timeout ?

We have deployed the model with Docker, so we just increased the timeout value of Docker.

@xiashiwendao
Copy link

xiashiwendao commented May 4, 2020

In python2.7, pip install insightface, found it dependency networkx2.3, which need python3.5+, how to resolve it?

Error Stack:

... ....

Using cached https://mirrors.aliyun.com/pypi/packages/ea/0b/189cd3c19faf362ff2df5f301456c6cf8571ef6684644cfdfdbff293825c/cloudpickle-1.3.0-py2.py3-none-any.whl (26 kB)
Collecting networkx>=1.8
Using cached https://mirrors.aliyun.com/pypi/packages/bf/63/7b579dd3b1c49ce6b7fd8f6f864038f255201410905dd183cf7f4a3845cf/networkx-2.4.tar.gz (1.5 MB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-9DXqvi/networkx/setup.py'"'"'; file='"'"'/tmp/pip-install-9DXqvi/networkx/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-kUvbVY
cwd: /tmp/pip-install-9DXqvi/networkx/
Complete output (6 lines):
NetworkX 2.3+ requires Python 3.5 or later (2.7 detected).

@xiashiwendao
Copy link

Later I change to python3.5 resolve it. I think we should tell user in insightface.ai and modify the introduce in the READ.ME in github, for thru it just get MXNET only support python 2.7. @nttstar

@gameliee
Copy link

@nttstar can you share retinaface_mnet025_v2 net train code ,and i want modify the net for convert to caffe

I second this, could you kindly provide the model code @nttstar. Thank you!

@nttstar
Copy link
Collaborator Author

nttstar commented May 15, 2021

pip insightface-0.2.0 is ready now, please check the top post.

@nttstar nttstar changed the title pip install insightface and http://insightface.ai pip install insightface and https://insightface.ai Jul 6, 2021
@nadaboulares
Copy link

plz how can i test recognition ??

@huynhtruc0309
Copy link

How to choose det_size in detection model retinaface? Please help @nttstar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests