Git Product home page Git Product logo

insight-face-paddle's Introduction

Hi there 👋

Email Badge GitHub Page GitHub followers

About

  • Working : PaddlePaddle
  • Languages : Python, C++, C#.
  • Skills : Computer Vision, Machine Learning, Model Compression.

littletomatodonkey's Github Stats


Last Edited on: 19/09/2022

Credits: this is modified from Isha Gupta

insight-face-paddle's People

Contributors

littletomatodonkey avatar tingquangao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

insight-face-paddle's Issues

Performance Issue

Hi I am testing the inference with:
RTX 3090
Cuda 11.2
paddlepaddle-gpu 2.1
Cudnn 8
And the performance for BlazeFace Detection is 20ms only. Is this normal?

insight-face-paddle针对不在索引库中的人没有识别出人脸

执行以下命令

insightfacepaddle --det --rec --index ./demo/friends/index.bin --input ./demo/friends/query/tmp.jpg --output ./output

我想达到效果:没有在索引库中的人被识别出人脸并锚框并提示未知,在索引库中的人被识别出人脸并锚框并提示人名,请问这个能做到吗,如何做呢

缺少未设定参数时的判断

if not (args.build_index or os.path.isfile(args.index)):

index未指定时,args.indexNone,直接执行os.path.isfile(args.index)会触发异常:

Traceback (most recent call last):
File "/home/mikeshi/test/face_recog_paddle/venv/bin/insightfacepaddle", line 8, in
sys.exit(main())
File "/home/mikeshi/test/face_recog_paddle/venv/lib/python3.7/site-packages/insightface_paddle/insightface_paddle.py", line 786, in main
predictor = InsightFace(args)
File "/home/mikeshi/test/face_recog_paddle/venv/lib/python3.7/site-packages/insightface_paddle/insightface_paddle.py", line 631, in init
if not (args.build_index or os.path.isfile(args.index)):
File "/usr/lib/python3.7/genericpath.py", line 30, in isfile
st = os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

使用fask 包装成api后docker运行发生异常

大佬好,我想使用这个库包装成api,本地开发运行是正常的,但是打进docker之后发生了一场
image

调用insightface_paddle 的时候发生了异常
image

为啥这写参数会传递到gunicorn了

推理报错

`-------------------------------------------------------------------------------------

                                  PaddleFace                                     

+----------------+------------------------------------------------------------------+

| Param | Value |

+----------------+------------------------------------------------------------------+

| det_model | BlazeFace |

| rec_model | MobileFace |

| use_gpu | True |

| enable_mkldnn | False |

| cpu_threads | 1 |

| input | None |

| output | /home/nvidia/insight-face-paddle-main/output |

| det | True |

| det_thresh | 0.8 |

| rec | True |

| index | /home/nvidia/insight-face-paddle-main/demo/predixr_img/index.bin |

| cdd_num | 5 |

| rec_thresh | 0.45 |

| max_batch_size | 1 |

| build_index | None |

| img_dir | None |

| label | None |

+----------------+------------------------------------------------------------------+

                           Powered by PaddlePaddle!                              

WARNING:root:The directory of input contine directory or not supported file type, only support: {'jpg', 'tif', 'bmp', 'jpeg', 'rgb', 'png', 'tiff'}

Traceback (most recent call last):

File "pre.py", line 16, in

print(next(res))

File "/home/nvidia/insight-face-paddle-main/insightface_paddle.py", line 759, in predict

labels = self.rec_predictor.retrieval(np_feature)

File "/home/nvidia/insight-face-paddle-main/insightface_paddle.py", line 558, in retrieval

-self.cdd_num)[-self.cdd_num:]

File "<array_function internals>", line 6, in argpartition

File "/home/nvidia/.local/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 832, in argpartition

return _wrapfunc(a, 'argpartition', kth, axis=axis, kind=kind, order=order)

File "/home/nvidia/.local/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 58, in _wrapfunc

return bound(*args, **kwds)

ValueError: kth(=-2) out of bounds (3)

`
demo测试没有问题,换成自己的数据之后似乎建立索引以后那个索引会报错,请问这个问题如何解决?
另外,请问建立索引的最少图片张数(每个人)是多少?

Low accuracy in recognition models

Hello,
I am facing very low accuracy in both recognition models (ArcFace and MobileFace), no matter how i play with the input params (such as Rec_thresh), i am not getting good results at all.
what could be wrong?

video demo

Hi,

Video demo is not accepting video files and asking images.

insightface_paddle cannot resume training while loading checkpoint...

Training: 2021-11-02 19:58:58,427 - Load checkpoint from '/home/bbs/Datasets/kjj/insightface/recognition/arcface_paddle/MS1M_v2_arcface_MobileFaceNet_128_0.1/MobileFaceNet_128/120'.
Traceback (most recent call last):
File "tools/train.py", line 35, in
train(args)
File "/home/bbs/Datasets/kjj/insightface/recognition/arcface_paddle/dynamic/train.py", line 168, in train
backbone, classifier, optimizer, for_train=True)
File "/home/bbs/Datasets/kjj/insightface/recognition/arcface_paddle/dynamic/utils/io.py", line 229, in load
classifier.state_dict(), dist_param_state_dict)
File "/home/bbs/Datasets/kjj/insightface/recognition/arcface_paddle/dynamic/utils/io.py", line 220, in map_actual_param_name
state_dict[name] = load_state_dict[param.name]
KeyError: 'dist@fc@rank@00000'

试用下来的体验

首先,Blazeface的人脸检测,对于头像占比比较大的图片,效果很差,但是对于占比小的,则效果很好。如下图的汤姆汉克斯,识别的置信度只有0.25左右
001

但是这样的集体照,则都在0.99左右
faces

另外,检测和识别的过程,看deepsight的Insightface项目,应该还缺少了Alignment这一步骤,所以当脸不是正对镜头时,计算获得的特征值的余弦相似度,会很差,如和下面的汤姆汉克斯图像对照,只有0.0X的相似度。但是这个不确定,因为InsightFace里用到的人脸检测模型应该是2d106det.onnx,模型本身就不相同。
004

而使用insightface时,两张都相似度在0.5左右。人脸识别都是用了ArcFace模型。

Error with Build Index

hi author,
i have some problem when build the index for image. After i run this:
!python insightface_paddle.py --build_index ./demo/friends/index.bin --img_dir ./demo/friends/gallery/ --label ./demo/friends/gallery/label.txt

And have this error
240764712_3634879383215171_1923783281650875532_n

So i found the weird code like this, may be it caused the issue. So i changed args.rec = False but i have another issue
image
image

Hope to see your reply soon !

使用AcrFace进行人脸识别出现ValueErrorr

代码如下:

`import insightface_paddle as face
import logging

logging.basicConfig(level=logging.INFO)

parser = face.parser()
args = parser.parse_args()
args.det = True
args.rec = True
args.rec_model = 'ArcFace' # 这里使用ArcFace
args.index = './demo/friends/index.bin'
args.output = './output'
input_path = './demo/friends/query/friends2.jpg'
predictor = face.InsightFace(args=args)
res = predictor.predict(input_path, print_info=True)
print(next(res))`

报错信息如下:
Traceback (most recent call last):
File "D:/PaddleRepo/insight-face-paddle/insightface_paddle_demo.py", line 18, in
print(next(res))
File "D:\PaddleRepo\insight-face-paddle\insightface_paddle.py", line 759, in predict
labels = self.rec_predictor.retrieval(np_feature)
File "D:\PaddleRepo\insight-face-paddle\insightface_paddle.py", line 555, in retrieval
feature).squeeze()
File "D:\PaddleRepo\venv\lib\site-packages\sklearn\metrics\pairwise.py", line 1179, in cosine_similarity
X, Y = check_pairwise_arrays(X, Y)
File "D:\PaddleRepo\venv\lib\site-packages\sklearn\utils\validation.py", line 72, in inner_f
return f(**kwargs)
File "D:\PaddleRepo\venv\lib\site-packages\sklearn\metrics\pairwise.py", line 161, in check_pairwise_arrays
X.shape[1], Y.shape[1]))
ValueError: Incompatible dimension for X and Y matrices: X.shape[1] == 128 while Y.shape[1] == 512

求助下,项目在paddle ai studio中运行报错

执行这段代码报错:
import insightface
from insightface.app import FaceAnalysis
from insightface.data import get_image as ins_get_image
app = FaceAnalysis()
app.prepare(ctx_id=0, det_size=(640, 640))
报错提示:
123
234

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.