- Working : PaddlePaddle
- Languages : Python, C++, C#.
- Skills : Computer Vision, Machine Learning, Model Compression.
Last Edited on: 19/09/2022
Credits: this is modified from Isha Gupta
End-to-end face detection and recognition system using PaddlePaddle.
License: Apache License 2.0
Last Edited on: 19/09/2022
Credits: this is modified from Isha Gupta
大佬 请教一下这个数据集制作有没有案例啥的,求分享一个,谢谢!
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?
执行以下命令
insightfacepaddle --det --rec --index ./demo/friends/index.bin --input ./demo/friends/query/tmp.jpg --output ./output
我想达到效果:没有在索引库中的人被识别出人脸并锚框并提示未知,在索引库中的人被识别出人脸并锚框并提示人名,请问这个能做到吗,如何做呢
insight-face-paddle/insightface_paddle.py
Line 631 in 37f4b7d
当index
未指定时,args.index
为None
,直接执行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
在进行人脸识别的时候,使用预训练模型,如果有index.bin我看就可以直接进行人脸识别了。请问这个文件如何生成?
我在源码中并没有看到人脸对齐,这个识别不需要人脸对齐吗?
`-------------------------------------------------------------------------------------
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测试没有问题,换成自己的数据之后似乎建立索引以后那个索引会报错,请问这个问题如何解决?
另外,请问建立索引的最少图片张数(每个人)是多少?
face_recognition识别错误率很高,(摄像头cv读出bgr已转rgb_frame = frame[:, :, ::-1])
insight-face识别率应该很高才对啊,我要如何提高识别正确率呢
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?
Hi,
Video demo is not accepting video files and asking images.
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'
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
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
Hope to see your reply soon !
代码如下:
`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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.