onnx / models

A collection of pre-trained, state-of-the-art models in the ONNX format
http://onnx.ai/models/
Apache License 2.0
7.84k stars 1.4k forks source link

python3 ./arcface_inference.py cannot import name 'nms' from 'helper' #196

Open marcoippolito opened 5 years ago

marcoippolito commented 5 years ago

Within the same directory I downloaded arface_service.py, mtcnn_detector.py, and the .py version of arface_inference.ipynb :

marco@pc:~/python3venvironments/mxnet/arcface$ ls -lah
total 368K
drwxrwxr-x 4 marco marco 4.0K Aug 14 22:51 .
drwxrwxr-x 3 marco marco 4.0K Aug 14 21:41 ..
drwxrwxr-x 2 marco marco 4.0K Aug 14 21:44 .ipynb_checkpoints
drwxrwxr-x 2 marco marco 4.0K Aug 14 22:47 __pycache__
-rw-rw-r-- 1 marco marco 307K Aug 14 21:37 arcface_inference.ipynb
-rw-rw-r-- 1 marco marco  10K Aug 14 21:51 arcface_inference.py
-rw-rw-r-- 1 marco marco 5.0K Oct 30  2018 arcface_service.py
-rw-rw-r-- 1 marco marco  24K Aug 14 22:47 mtcnn_detector.py

When trying to run arcface_inference.py :

marco@pc:~/python3venvironments/mxnet/arcface$ python3 ./arcface_inference.py
Traceback (most recent call last):
  File "./arcface_inference.py", line 54, in <module>
    from mtcnn_detector import MtcnnDetector
  File "/home/marco/python3venvironments/mxnet/arcface/mtcnn_detector.py", line 12, in 
<module>
    from helper import nms, adjust_input, detect_first_stage_warpper
ImportError: cannot import name 'nms' from 'helper' (/home/marco/anaconda3/lib/python3.7/site-
packages/helper/__init__.py)
marco@pc:~/python3venvironments/mxnet/arcface$ 

Python Version:

marco@pc:~/python3venvironments/mxnet/arcface$ python3 -V
Python 3.7.3

OS: Ubuntu 18.04.02 Server Edition

Looking forward to your kind help. Marco

ngocthach commented 4 years ago

You need a helper package. See here: https://github.com/deepinx/mtcnn-face-detection/blob/master/helper.py