这是一个利用facenet和retinaface实现人脸识别的库,可以进行在线的人脸识别。

Overview

Facenet+Retinaface:人脸识别模型在Keras当中的实现


目录

  1. 注意事项 Attention
  2. 所需环境 Environment
  3. 文件下载 Download
  4. 预测步骤 How2predict
  5. 参考资料 Reference

注意事项

该库中包含了两个网络,分别是retinaface和facenet。二者使用不同的权值。 在使用网络时一定要注意权值的选择,以及主干与权值的匹配。

所需环境

tensorflow-gpu==1.13.1
keras==2.1.5

文件下载

预测所需的权值文件可以在百度云下载。
链接: https://pan.baidu.com/s/1byskhV594bK9b0eHONjF2g 提取码: tn8y

预测步骤

  1. 本项目自带主干为mobilenet的retinaface模型与facenet模型。可以直接运行,如果想要使用主干为resnet50的retinafa和主干为inception_resnetv1的facenet模型需要。
  2. 在retinaface.py文件里面,在如下部分修改model_path和backbone使其对应训练好的文件。
_defaults = {
    "retinaface_model_path" : 'model_data/retinaface_mobilenet025.h5',
    #-----------------------------------#
    #   可选retinaface_backbone有
    #   mobilenet和resnet50
    #-----------------------------------#
    "retinaface_backbone"   : "mobilenet",
    "confidence"            : 0.5,
    "iou"                   : 0.3,
    #----------------------------------------------------------------------#
    #   是否需要进行图像大小限制。
    #   输入图像大小会大幅度地影响FPS,想加快检测速度可以减少input_shape。
    #   开启后,会将输入图像的大小限制为input_shape。否则使用原图进行预测。
    #   keras代码中主干为mobilenet时存在小bug,当输入图像的宽高不为32的倍数
    #   会导致检测结果偏差,主干为resnet50不存在此问题。
    #   可根据输入图像的大小自行调整input_shape,注意为32的倍数,如[640, 640, 3]
    #----------------------------------------------------------------------#
    "retinaface_input_shape": [640, 640, 3],
    "letterbox_image"       : True,

    "facenet_model_path"    : 'model_data/facenet_mobilenet.h5',
    #-----------------------------------#
    #   可选facenet_backbone有
    #   mobilenet和inception_resnetv1
    #-----------------------------------#
    "facenet_backbone"      : "inception_resnetv1",
    "facenet_input_shape"   : [160,160,3],
    "facenet_threhold"      : 0.9,
}
  1. 运行encoding.py,对face_dataset里面的图片进行编码,face_dataset的命名规则为XXX_1.jpg、XXX_2.jpg。最终在model_data文件夹下生成对应的数据库人脸编码数据文件。
  2. 运行predict.py,输入下述文字,可直接预测。
img/zhangxueyou.jpg
  1. 利用video.py可进行摄像头检测。

Reference

https://github.com/biubug6/Pytorch_Retinaface

Owner
Bubbliiiing
Bubbliiiing
buildseg is a building extraction plugin of QGIS based on PaddlePaddle.

buildseg buildseg is a building extraction plugin of QGIS based on PaddlePaddle. TODO Extract building on 512x512 remote sensing images. Extract build

Yizhou Chen 11 Sep 26, 2022
YOLOv5 in PyTorch > ONNX > CoreML > TFLite

This repository represents Ultralytics open-source research into future object detection methods, and incorporates lessons learned and best practices evolved over thousands of hours of training and e

Ultralytics 34.1k Dec 31, 2022
(NeurIPS 2021) Pytorch implementation of paper "Re-ranking for image retrieval and transductive few-shot classification"

SSR (NeurIPS 2021) Pytorch implementation of paper "Re-ranking for image retrieval and transductivefew-shot classification" [Paper] [Project webpage]

xshen 29 Dec 06, 2022
A Collection of Papers and Codes for ICCV2021 Low Level Vision and Image Generation

A Collection of Papers and Codes for ICCV2021 Low Level Vision and Image Generation

196 Jan 05, 2023
the code of the paper: Recurrent Multi-view Alignment Network for Unsupervised Surface Registration (CVPR 2021)

RMA-Net This repo is the implementation of the paper: Recurrent Multi-view Alignment Network for Unsupervised Surface Registration (CVPR 2021). Paper

Wanquan Feng 205 Nov 09, 2022
Official repository of the paper Learning to Regress 3D Face Shape and Expression from an Image without 3D Supervision

Official repository of the paper Learning to Regress 3D Face Shape and Expression from an Image without 3D Supervision

Soubhik Sanyal 689 Dec 25, 2022
Python code for loading the Aschaffenburg Pose Dataset.

Aschaffenburg Pose Dataset (APD) This repository contains Python code for loading and filtering the Aschaffenburg Pose Dataset. The dataset itself and

1 Nov 26, 2021
🔎 Monitor deep learning model training and hardware usage from your mobile phone 📱

Monitor deep learning model training and hardware usage from mobile. 🔥 Features Monitor running experiments from mobile phone (or laptop) Monitor har

labml.ai 1.2k Dec 25, 2022
一些经典的CTR算法的复现; LR, FM, FFM, AFM, DeepFM,xDeepFM, PNN, DCN, DCNv2, DIFM, AutoInt, FiBiNet,AFN,ONN,DIN, DIEN ... (pytorch, tf2.0)

CTR Algorithm 根据论文, 博客, 知乎等方式学习一些CTR相关的算法 理解原理并自己动手来实现一遍 pytorch & tf2.0 保持一颗学徒的心! Schedule Model pytorch tensorflow2.0 paper LR ✔️ ✔️ \ FM ✔️ ✔️ Fac

luo han 149 Dec 20, 2022
[ICML 2021] "Graph Contrastive Learning Automated" by Yuning You, Tianlong Chen, Yang Shen, Zhangyang Wang

Graph Contrastive Learning Automated PyTorch implementation for Graph Contrastive Learning Automated [talk] [poster] [appendix] Yuning You, Tianlong C

Shen Lab at Texas A&M University 80 Nov 23, 2022
A plug-and-play library for neural networks written in Python

A plug-and-play library for neural networks written in Python!

Dimos Michailidis 2 Jul 16, 2022
Python program that works as a contact list

Lista de Contatos Programa em Python que funciona como uma lista de contatos. Features Adicionar novo contato Remover contato Atualizar contato Pesqui

Victor B. Lino 3 Dec 16, 2021
Einshape: DSL-based reshaping library for JAX and other frameworks.

Einshape: DSL-based reshaping library for JAX and other frameworks. The jnp.einsum op provides a DSL-based unified interface to matmul and tensordot o

DeepMind 62 Nov 30, 2022
Official Implementation for the "An Empirical Investigation of 3D Anomaly Detection and Segmentation" paper.

An Empirical Investigation of 3D Anomaly Detection and Segmentation Project | Paper Official PyTorch Implementation for the "An Empirical Investigatio

Eliahu Horwitz 55 Dec 14, 2022
Seach Losses of our paper 'Loss Function Discovery for Object Detection via Convergence-Simulation Driven Search', accepted by ICLR 2021.

CSE-Autoloss Designing proper loss functions for vision tasks has been a long-standing research direction to advance the capability of existing models

Peidong Liu(刘沛东) 54 Dec 17, 2022
Self-Learning - Books Papers, Courses & more I have to learn soon

Self-Learning This repository is intended to be used for personal use, all rights reserved to respective owners, please cite original authors and ask

Achint Chaudhary 968 Jan 02, 2022
The first public PyTorch implementation of Attentive Recurrent Comparators

arc-pytorch PyTorch implementation of Attentive Recurrent Comparators by Shyam et al. A blog explaining Attentive Recurrent Comparators Visualizing At

Sanyam Agarwal 150 Oct 14, 2022
Expand human face editing via Global Direction of StyleCLIP, especially to maintain similarity during editing.

Oh-My-Face This project is based on StyleCLIP, RIFE, and encoder4editing, which aims to expand human face editing via Global Direction of StyleCLIP, e

AiLin Huang 51 Nov 17, 2022
This is a vision-based 3d model manipulation and control UI

Manipulation of 3D Models Using Hand Gesture This program allows user to manipulation 3D models (.obj format) with their hands. The project support bo

Cortic Technology Corp. 43 Oct 23, 2022
This repo is customed for VisDrone.

Object Detection for VisDrone(无人机航拍图像目标检测) My environment 1、Windows10 (Linux available) 2、tensorflow = 1.12.0 3、python3.6 (anaconda) 4、cv2 5、ensemble

53 Jul 17, 2022