A PyTorch Implementation of Single Shot Scale-invariant Face Detector.

Overview

S³FD: Single Shot Scale-invariant Face Detector

A PyTorch Implementation of Single Shot Scale-invariant Face Detector.

Eval

python wider_eval_pytorch.py

cd eval/eval_tools_old-version
octave wider_eval_pytorch.m

Model

s3fd_convert.7z

Test

python test.py --model data/s3fd_convert.pth --path data/test01.jpg

output

References

SFD

Comments
  • RGB <-> BGR

    RGB <-> BGR

    From this line, I assume you use RGB: img = img - np.array([104,117,123])

    However opencv uses BGR, so this line returns BGR: if args.path=='CAMERA': ret, img = cap.read()

    Then BGR is fed to the network bboxlist = detect(net,img)

    I fed RGB to the network and got worse results. Is it possible that you meant RGB in all places but the network is actually trained for BGR? (If then it should be img = img - np.array([123,117,104]))

    opened by elbaro 3
  • How Convert Weights

    How Convert Weights

    Dear @clcarwin, Thank you for your nice work. Would you please tell me how you can convert Caffe weights and model of S3FD into PyTorch? Can you convert the model & pre-trained weights of RefineDet into PyTorch?

    opened by ahkarami 2
  • evaluation accuracy is not good as the original paper

    evaluation accuracy is not good as the original paper

    hi @clcarwin,

    I test you evaluation results on wider face as (easy 92.8, medium 91.5, hard 84.2). But with the original model provided by sfzhang15/SFD, I can get (easy 93.8, medium 92.4, hard 85.1).

    Did I test correctly? If so, why there is accuracy loss?

    Great work! Best,

    opened by marvis 2
  • 'float' object cannot be interpreted as an integer??

    'float' object cannot be interpreted as an integer??

    Sir,I'm sorry to disturb you about this object. I run this object on windows 10,python 3.5.2 ,pytorch 0.3. After : python test.py --model data/s3fd_convert.pth --path data/test01.jpg, the screen display: D:\Python\Pytorch_cw_sfd\SFD_pytorch>python test.py --model data/s3fd_convert.pth --path data/test01.jpg Traceback (most recent call last): File "test.py", line 71, in bboxlist = detect(net,img) File "test.py", line 27, in detect for i in range(len(olist)/2): olist[i2] = F.softmax(olist[i2]) TypeError: 'float' object cannot be interpreted as an integer

    Why ???

    opened by door5719 1
  • padding size of fc6

    padding size of fc6

    Hi @clcarwin,

    Why do you set the padding size of fc6 to 3? This is inconsistent with the original paper. See https://github.com/clcarwin/SFD_pytorch/blob/master/net_s3fd.py#L42

    Best,

    opened by marvis 1
  • Optimization

    Optimization

    Good: It is accurate.

    Bad: The inference time is more than 80 ms for realtime usage. To make it work for realtime image has to be resized to less than 200x200 which reduces accuracy.

    So in order to make it usable the only way is to make it faster. Have you tried using TensorRT or TVM or Pytorch serving in C++ ?

    opened by jamessmith90 0
  • Several speed & code updates

    Several speed & code updates

    Seems nobody's looking at PR's here, but letting others know I've made a number of improvements.

    It runs smoothly on modern pytorch (1.3) and refactored the code to eliminate redundant code. I also added some convenient methods that make it easier to do common things, like detect_faces. Also, added integration tests.

    I independently found the same speed-up as @kir-dan in https://github.com/clcarwin/SFD_pytorch/pull/4 and moved all that code into pytorch instead of numpy, so it can be fully run on GPU.

    opened by leopd 0
  • Very high GPU memory usage

    Very high GPU memory usage

    Hi, I have been running the model using test.py and modified it run multiple files. The GPU memory keeps on increasing,from 3gigs to 9 gigs. Is this due to poor garbage collection?

    opened by vaishnavm217 2
  • Change Anchor Boxes Aspect Ratio

    Change Anchor Boxes Aspect Ratio

    Dear @clcarwin, If one wants to change the aspect ratio of anchor boxes, must just changed the detect method in test.py? For example, line https://github.com/clcarwin/SFD_pytorch/blob/96fdfbe22eef176a04802d915834b82a131a854d/test.py#L39 or other methods moreover must changed?

    opened by ahkarami 0
  • About data augmentation

    About data augmentation

    When I use the Tensorflow to build the project, I have some trouble in data augmentation which describe in the paper. Can you tell the details of the data augmentation or show your data augmentation code to me. Thank you

    opened by ckqsars 0
Owner
carwin
carwin
SSD: Single Shot MultiBox Detector pytorch implementation focusing on simplicity

SSD: Single Shot MultiBox Detector Introduction Here is my pytorch implementation of 2 models: SSD-Resnet50 and SSDLite-MobilenetV2.

Viet Nguyen 149 Jan 7, 2023
A PyTorch Implementation of Single Shot MultiBox Detector

SSD: Single Shot MultiBox Object Detector, in PyTorch A PyTorch implementation of Single Shot MultiBox Detector from the 2016 paper by Wei Liu, Dragom

Max deGroot 4.8k Jan 7, 2023
Realtime Face Anti Spoofing with Face Detector based on Deep Learning using Tensorflow/Keras and OpenCV

Realtime Face Anti-Spoofing Detection ?? Realtime Face Anti Spoofing Detection with Face Detector to detect real and fake faces Please star this repo

Prem Kumar 86 Aug 3, 2022
Face and Pose detector that emits MQTT events when a face or human body is detected and not detected.

Face Detect MQTT Face or Pose detector that emits MQTT events when a face or human body is detected and not detected. I built this as an alternative t

Jacob Morris 38 Oct 21, 2022
A large-scale face dataset for face parsing, recognition, generation and editing.

CelebAMask-HQ [Paper] [Demo] CelebAMask-HQ is a large-scale face image dataset that has 30,000 high-resolution face images selected from the CelebA da

switchnorm 1.7k Dec 26, 2022
Code for One-shot Talking Face Generation from Single-speaker Audio-Visual Correlation Learning (AAAI 2022)

One-shot Talking Face Generation from Single-speaker Audio-Visual Correlation Learning (AAAI 2022) Paper | Demo Requirements Python >= 3.6 , Pytorch >

FuxiVirtualHuman 84 Jan 3, 2023
A whale detector design for the Kaggle whale-detector challenge!

CNN (InceptionV1) + STFT based Whale Detection Algorithm So, this repository is my PyTorch solution for the Kaggle whale-detection challenge. The obje

Tarin Ziyaee 92 Sep 28, 2021
Lane follower: Lane-detector (OpenCV) + Object-detector (YOLO5) + CAN-bus

Lane Follower This code is for the lane follower, including perception and control, as shown below. Environment Hardware Industrial Camera Intel-NUC(1

Siqi Fan 3 Jul 7, 2022
HeartRate detector with ArduinoandPython - Use Arduino and Python create a heartrate detector.

Syllabus of Contents Syllabus of Contents Introduction Of Project Features Develop With Python code introduction Installation License Developer Contac

null 1 Jan 5, 2022
Video lie detector using xgboost - A video lie detector using OpenFace and xgboost

video_lie_detector_using_xgboost a video lie detector using OpenFace and xgboost

null 2 Jan 11, 2022
Imposter-detector-2022 - HackED 2022 Team 3IQ - 2022 Imposter Detector

HackED 2022 Team 3IQ - 2022 Imposter Detector By Aneeljyot Alagh, Curtis Kan, Jo

Joshua Ji 3 Aug 20, 2022
Implementation of Invariant Point Attention, used for coordinate refinement in the structure module of Alphafold2, as a standalone Pytorch module

Invariant Point Attention - Pytorch Implementation of Invariant Point Attention as a standalone module, which was used in the structure module of Alph

Phil Wang 113 Jan 5, 2023
Accurate 3D Face Reconstruction with Weakly-Supervised Learning: From Single Image to Image Set (CVPRW 2019). A PyTorch implementation.

Accurate 3D Face Reconstruction with Weakly-Supervised Learning: From Single Image to Image Set —— PyTorch implementation This is an unofficial offici

Sicheng Xu 833 Dec 28, 2022
BigDetection: A Large-scale Benchmark for Improved Object Detector Pre-training

BigDetection: A Large-scale Benchmark for Improved Object Detector Pre-training By Likun Cai, Zhi Zhang, Yi Zhu, Li Zhang, Mu Li, Xiangyang Xue. This

null 290 Dec 29, 2022
YOLO5Face: Why Reinventing a Face Detector (https://arxiv.org/abs/2105.12931)

Introduction Yolov5-face is a real-time,high accuracy face detection. Performance Single Scale Inference on VGA resolution(max side is equal to 640 an

DeepCam Shenzhen 1.4k Jan 7, 2023
Face Recognition and Emotion Detector Device

Face Recognition and Emotion Detector Device Orange PI 1 Python 3.10.0 + Django 3.2.9 Project's file explanation Django manage.py Django commands hand

BootyAss 2 Dec 21, 2021
Embracing Single Stride 3D Object Detector with Sparse Transformer

SST: Single-stride Sparse Transformer This is the official implementation of paper: Embracing Single Stride 3D Object Detector with Sparse Transformer

TuSimple 385 Dec 28, 2022
The implementation of the CVPR2021 paper "Structure-Aware Face Clustering on a Large-Scale Graph with 10^7 Nodes"

STAR-FC This code is the implementation for the CVPR 2021 paper "Structure-Aware Face Clustering on a Large-Scale Graph with 10^7 Nodes" ?? ?? . ?? Re

Shuai Shen 87 Dec 28, 2022
PyTorch code for 'Efficient Single Image Super-Resolution Using Dual Path Connections with Multiple Scale Learning'

Efficient Single Image Super-Resolution Using Dual Path Connections with Multiple Scale Learning This repository is for EMSRDPN introduced in the foll

null 7 Feb 10, 2022