Comments (5)
The first thing I want to declare is that this project is based on InsightFace.
I am sorry that I have not updated readme yet.
The args parser function is defined as def start_up_init(train_mode=False)
in helper.py
def start_up_init(train_mode=False):
parser = argparse.ArgumentParser(description='Arc Face Online Test')
# =================== General ARGS ====================
if not train_mode:
parser.add_argument('ip_address', type=str,
help='相机的IP地址或测试用视频文件名')
parser.add_argument('--face_recognize_threshold', type=float,
help='可疑人员识别阈值', default=0.95)
parser.add_argument('--max_face_number', type=int,
help='同时检测的最大人脸数量', default=8)
parser.add_argument('--max_frame_rate', type=int,
help='最大FPS', default=25)
parser.add_argument('--image-size', default='112,112',
help='输入特征提取网络的图片大小')
parser.add_argument('--dangerous_threshold', type=int,
help='1/2报警窗口长度', default=16)
parser.add_argument('--model', default='./model-r100-ii/model,0',
help='特征提取网络预训练模型路径')
parser.add_argument('--gpu', default=0, type=int,
help='GPU设备ID,-1代表使用CPU')
parser.add_argument('--det', default=0, type=int,
help='设置为1代表使用R+O网络进行检测, 0代表使用P+R+O进行检测')
parser.add_argument('--flip', default=1, type=int,
help='是否在训练时进行左右翻转相加操作')
parser.add_argument('--threshold', default=1.24, type=float,
help='空间向量距离阈值')
parser.add_argument('-v', '--video_mode', action="store_true",
help='设置从视频读取帧数据', default=False)
parser.add_argument('-c', '--cv_test_mode', action="store_true",
help='设置本地预览', default=False)
parser.add_argument('--mtcnn_minsize', type=int,
help='mtcnn最小检测框的尺寸(越小检测精度越高)', default=50)
parser.add_argument('--mtcnn_factor', type=float,
help='mtcnn图像缩放系数(关联图像金字塔层数,越大检测精度越高)', default=0.709)
parser.add_argument('--mtcnn_threshold', type=float, nargs='+',
help='mtcnn三层阈值', default=[0.6, 0.7, 0.92])
return parser.parse_args()
And the entrance of this system is mikomiko.py
To launch this system you'll need node-js and python3.7.
In this system we use Node-js as the websocket server to transfer image data from python client to webpage client.
I will update the project in the next few days. Thank you for your interest in this project.
from arcface-multiplex-recognition.
In this system we have to load 3 models
1、Pre-trained MTCNN model for face detection (provided by others)
2、Pre-trained ArcFace model for face embedding (provided by others)
3、Pre-trained MLP model for face recognition (provided use train.py
)
Once we have detected a face, put it into ArcFace model to get 512 dims embedding vector
Then put the vector into MLP model to get prediction result
async def embedding_loop(preload):
# =================== FR MODEL ====================
mlp, class_names = read_pkl_model('./model-mlp/mlp.pkl')
preload.gpu = -1
embedding = face_embedding.EmbeddingModel(preload)
while True:
img = suspicion_face_queue.get()
dt = time.strftime('%m-%d %H:%M:%S')
predict = mlp.predict_proba([embedding.get_one_feature(img)])
prob = predict.max(1)[0]
result_queue.put((img, dt, prob, class_names[predict.argmax(1)[0]]))
=========
Some argument have been deprecated, I will tell you the currently availables:
ip_address
we use a web camera interface to get the frame. You can change the code to use a local video as the input.
--max_face_number
the max number of face that you want MTCNN to detect
--max_frame_rate
the gap time to get frame is based on this argument.(see mikomiko.py
line 165)
--image-size
input image size of ArcFace.
--model
the path of ArcFace Model
--gpu
choose the Device ID of gpu to use, -1 for use cpu
--flip
whether to do flip in the MLP train process
--mtcnn_minsize
,--mtcnn_factor
,--mtcnn_threshold
are arguments for MTCNN, for the minisize of face to detect, the pyramids of image to factor and the threshold for P-NET R-NET O-NET
The system can be CPU real-time (upload image with max_frame_rate), but it cost nearly 3GB memory.
Use GPU can reduce the lantency to only 0.2s. (change args.fill_number
to 6 at mikomiko.py
line 185)
from arcface-multiplex-recognition.
Thank you for your explain, it's very helpful for me. In this project, will you use a search algorithm to compare an image input with the dataset?
And one more question is in the function def start_up_init(train_mode=False)
in helper.py
: how to unstantd the argument in each element parser.add_argument()
.
from arcface-multiplex-recognition.
Thank you very much, I hope to see the next update soon 💯
from arcface-multiplex-recognition.
@1996scarlet 用webcam试了一下,我有一张照片和stalin的相似度高达99%:)
from arcface-multiplex-recognition.
Related Issues (20)
- Ask about IDE HOT 1
- Build R-CNN for Retina Face HOT 1
- Run python3 usb_camera.py -c 0 HOT 1
- Python version
- cv2.error: OpenCV(3.4.8) /io/opencv/modules/imgproc/src/resize.cpp:3720: error: (-215:Assertion failed) !ssize.empty() in function 'resize' HOT 4
- python3 usb_camera.py -c 0报错
- MLP or distance? HOT 1
- requirement file
- Electron Node-JS Client Camera Not Detected
- Requirements and English help HOT 3
- error with usb_camera.py
- Error usb_camera.py in socketio connection HOT 1
- ModuleNotFoundError: No module named 'IPCamera' HOT 1
- 课程设计 HOT 1
- Invalid NDArray file format HOT 9
- On npm install error HOT 1
- Exception in thread Thread-2: HOT 4
- about the error recognition HOT 3
- edit bounding boxes color, name etc HOT 1
- cuda version and mxnet version HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arcface-multiplex-recognition.