All Projects â†’ ternaus â†’ Retinaface

ternaus / Retinaface

Licence: mit
The remake of the

Programming Languages

139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Retinaface

Cnn Paper2
🎨 🎨 深度学习 卷积神经网络教程 :图像识别,目标检测,语义分割,实例分割,人脸识别,神经风格转换,GAN等🎨🎨
Stars: ✭ 77 (-65.93%)
Mutual labels:  object-detection, deeplearning, face-detection
Deep learning object detection
A paper list of object detection using deep learning.
Stars: ✭ 10,334 (+4472.57%)
Mutual labels:  object-detection, deeplearning
An Embedded Computer Vision & Machine Learning Library (CPU Optimized & IoT Capable)
Stars: ✭ 1,460 (+546.02%)
Mutual labels:  object-detection, face-detection
A binary library for very fast face detection using compact CNNs.
Stars: ✭ 152 (-32.74%)
Mutual labels:  object-detection, face-detection
Ssd Models
把极速检测器的门槛给我打下来make lightweight caffe-ssd great again
Stars: ✭ 62 (-72.57%)
Mutual labels:  deeplearning, face-detection
Ssd Pytorch
SSD: Single Shot MultiBox Detector pytorch implementation focusing on simplicity
Stars: ✭ 107 (-52.65%)
Mutual labels:  object-detection, deeplearning
The World's Leading Cross Platform AI Engine for Edge Devices
Stars: ✭ 120 (-46.9%)
Mutual labels:  object-detection, face-detection
A collection of sample apps to demonstrate how to use Google's ML Kit APIs on Android and iOS
Stars: ✭ 949 (+319.91%)
Mutual labels:  object-detection, face-detection
Ownphotos Frontend
Stars: ✭ 171 (-24.34%)
Mutual labels:  object-detection, face-detection
Face detection using deep learning.
Stars: ✭ 173 (-23.45%)
Mutual labels:  object-detection, face-detection
thor: C++ helper library, for deep learning purpose
Stars: ✭ 197 (-12.83%)
Mutual labels:  object-detection, deeplearning
Jacinto Ai Devkit
Training & Quantization of embedded friendly Deep Learning / Machine Learning / Computer Vision models
Stars: ✭ 49 (-78.32%)
Mutual labels:  object-detection, deeplearning
Tensorflow Lite Rest Server
Expose tensorflow-lite models via a rest API
Stars: ✭ 43 (-80.97%)
Mutual labels:  object-detection, face-detection
Realtime Detectron
Real-time Detectron using webcam.
Stars: ✭ 42 (-81.42%)
Mutual labels:  object-detection, deeplearning
Self hosted alternative to Google Photos
Stars: ✭ 2,587 (+1044.69%)
Mutual labels:  object-detection, face-detection
Mobilenet Yolo
MobileNetV2-YoloV3-Nano: 0.5BFlops 3MB HUAWEI P40: 6ms/img, YoloFace-500k:0.1Bflops 420KB🔥🔥🔥
Stars: ✭ 1,566 (+592.92%)
Mutual labels:  object-detection, face-detection
Getting Things Done With Pytorch
Jupyter Notebook tutorials on solving real-world problems with Machine Learning & Deep Learning using PyTorch. Topics: Face detection with Detectron 2, Time Series anomaly detection with LSTM Autoencoders, Object Detection with YOLO v5, Build your first Neural Network, Time Series forecasting for Coronavirus daily cases, Sentiment Analysis with BERT.
Stars: ✭ 738 (+226.55%)
Mutual labels:  object-detection, face-detection
Open source face recognition on Raspberry Pi. SharpAI is open source stack for machine learning engineering with private deployment and AutoML for edge computing. DeepCamera is application of SharpAI designed for connecting computer vision model to surveillance camera. Developers can run same code on Raspberry Pi/Android/PC/AWS to boost your AI production development.
Stars: ✭ 757 (+234.96%)
Mutual labels:  object-detection, face-detection
Bmw Tensorflow Inference Api Cpu
This is a repository for an object detection inference API using the Tensorflow framework.
Stars: ✭ 158 (-30.09%)
Mutual labels:  object-detection, deeplearning
Marvel - Face Recognition With Android & OpenCV
Stars: ✭ 199 (-11.95%)
Mutual labels:  object-detection, face-detection



This repo is build on top of


Train loop moved to Pytorch Lightning

IT added a set of functionality:

  • Distributed training
  • fp16
  • Syncronized BatchNorm
  • Support for various loggers like W&B or

Hyperparameters are defined in the config file

Hyperparameters that were scattered across the code moved to the config at retinadace/config

Augmentations => Albumentations

Color that were manually implemented replaced by the Albumentations library.


  • Horizontal Flip is not implemented in Albumentations
  • Spatial transforms like rotations or transpose are not implemented yet.

Color transforms are defined in the config.

Added mAP calculation for validation

In order to track thr progress, mAP metric is calculated on validation.


pip install -U retinaface_pytorch

Example inference

import cv2
from retinaface.pre_trained_models import get_model

image = <numpy array with shape (height, width, 3)>

model = get_model("resnet50_2020-07-20", max_size=2048)
annotation = model.predict_jsons(image)
  • Jupyter notebook with the example: Open In Colab
  • Jupyter notebook with the example on how to combine face detector with mask detector: Open In Colab

Data Preparation

The pipeline expects labels in the format:

    "file_name": "0--Parade/0_Parade_marchingband_1_849.jpg",
    "annotations": [
        "bbox": [
        "landmarks": [

You can convert the default labels of the WiderFaces to the json of the propper format with this script.


Define config

Example configs could be found at retinaface/configs

Define environmental variables

export TRAIN_IMAGE_PATH=<path to train images>
export VAL_IMAGE_PATH=<path to validation images>
export TRAIN_LABEL_PATH=<path to train annotations>
export VAL_LABEL_PATH=<path to validation annotations>

Run training script

python retinaface/ -h
usage: [-h] -c CONFIG_PATH

optional arguments:
  -h, --help            show this help message and exit
  -c CONFIG_PATH, --config_path CONFIG_PATH
                        Path to the config.


python retinaface/ -h
usage: [-h] -i INPUT_PATH -c CONFIG_PATH -o OUTPUT_PATH [-v]
                    [-g NUM_GPUS] [-m MAX_SIZE] [-b BATCH_SIZE]
                    [-j NUM_WORKERS]
                    [--confidence_threshold CONFIDENCE_THRESHOLD]
                    [--nms_threshold NMS_THRESHOLD] -w WEIGHT_PATH
                    [--keep_top_k KEEP_TOP_K] [--world_size WORLD_SIZE]
                    [--local_rank LOCAL_RANK] [--fp16]

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT_PATH, --input_path INPUT_PATH
                        Path with images.
  -c CONFIG_PATH, --config_path CONFIG_PATH
                        Path to config.
  -o OUTPUT_PATH, --output_path OUTPUT_PATH
                        Path to save jsons.
  -v, --visualize       Visualize predictions
  -g NUM_GPUS, --num_gpus NUM_GPUS
                        The number of GPUs to use.
  -m MAX_SIZE, --max_size MAX_SIZE
                        Resize the largest side to this number
  -b BATCH_SIZE, --batch_size BATCH_SIZE
  -j NUM_WORKERS, --num_workers NUM_WORKERS
  --confidence_threshold CONFIDENCE_THRESHOLD
  --nms_threshold NMS_THRESHOLD
  -w WEIGHT_PATH, --weight_path WEIGHT_PATH
                        Path to weights.
  --keep_top_k KEEP_TOP_K
  --world_size WORLD_SIZE
                        number of nodes for distributed training
  --local_rank LOCAL_RANK
                        node rank for distributed training
  --fp16                Use fp6
python -m torch.distributed.launch --nproc_per_node=<num_gpus> retinaface/ <parameters>

Web app

Code for the web app:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].