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
Video Corpus Moment Retrieval with Contrastive Learning (SIGIR 2021)

Video Corpus Moment Retrieval with Contrastive Learning PyTorch implementation for the paper "Video Corpus Moment Retrieval with Contrastive Learning"

ZHANG HAO 42 Dec 29, 2022
Facebook AI Research Sequence-to-Sequence Toolkit written in Python.

Fairseq(-py) is a sequence modeling toolkit that allows researchers and developers to train custom models for translation, summarization, language mod

20.5k Jan 08, 2023
The Easy-to-use Dialogue Response Selection Toolkit for Researchers

Easy-to-use toolkit for retrieval-based Chatbot Recent Activity Our released RRS corpus can be found here. Our released BERT-FP post-training checkpoi

GMFTBY 32 Nov 13, 2022
Code for paper " AdderNet: Do We Really Need Multiplications in Deep Learning?"

AdderNet: Do We Really Need Multiplications in Deep Learning? This code is a demo of CVPR 2020 paper AdderNet: Do We Really Need Multiplications in De

HUAWEI Noah's Ark Lab 915 Jan 01, 2023
Dynamica causal Bayesian optimisation

Dynamic Causal Bayesian Optimization This is a Python implementation of Dynamic Causal Bayesian Optimization as presented at NeurIPS 2021. Abstract Th

nd308 18 Nov 22, 2022
A Tensorflow implementation of CapsNet based on Geoffrey Hinton's paper Dynamic Routing Between Capsules

CapsNet-Tensorflow A Tensorflow implementation of CapsNet based on Geoffrey Hinton's paper Dynamic Routing Between Capsules Notes: The current version

Huadong Liao 3.8k Dec 29, 2022
Impelmentation for paper Feature Generation and Hypothesis Verification for Reliable Face Anti-Spoofing

FGHV Impelmentation for paper Feature Generation and Hypothesis Verification for Reliable Face Anti-Spoofing Requirements Python 3.6 Pytorch 1.5.0 Cud

5 Jun 02, 2022
Semantic Edge Detection with Diverse Deep Supervision

Semantic Edge Detection with Diverse Deep Supervision This repository contains the code for our IJCV paper: "Semantic Edge Detection with Diverse Deep

Yun Liu 12 Dec 31, 2022
Semi-supervised Learning for Sentiment Analysis

Neural-Semi-supervised-Learning-for-Text-Classification-Under-Large-Scale-Pretraining Code, models and Datasets for《Neural Semi-supervised Learning fo

47 Jan 01, 2023
Mask2Former: Masked-attention Mask Transformer for Universal Image Segmentation in TensorFlow 2

Mask2Former: Masked-attention Mask Transformer for Universal Image Segmentation in TensorFlow 2 Bowen Cheng, Ishan Misra, Alexander G. Schwing, Alexan

Phan Nguyen 1 Dec 16, 2021
Official pytorch implementation of paper Dual-Level Collaborative Transformer for Image Captioning (AAAI 2021).

Dual-Level Collaborative Transformer for Image Captioning This repository contains the reference code for the paper Dual-Level Collaborative Transform

lyricpoem 160 Dec 11, 2022
FewBit — a library for memory efficient training of large neural networks

FewBit FewBit — a library for memory efficient training of large neural networks. Its efficiency originates from storage optimizations applied to back

24 Oct 22, 2022
Pairwise learning neural link prediction for ogb link prediction

Pairwise Learning for Neural Link Prediction for OGB (PLNLP-OGB) This repository provides evaluation codes of PLNLP for OGB link property prediction t

Zhitao WANG 31 Oct 10, 2022
A tutorial showing how to train, convert, and run TensorFlow Lite object detection models on Android devices, the Raspberry Pi, and more!

A tutorial showing how to train, convert, and run TensorFlow Lite object detection models on Android devices, the Raspberry Pi, and more!

Evan 1.3k Jan 02, 2023
NaijaSenti is an open-source sentiment and emotion corpora for four major Nigerian languages

NaijaSenti is an open-source sentiment and emotion corpora for four major Nigerian languages. This project was supported by lacuna-fund initiatives. Jump straight to one of the sections below, or jus

Hausa Natural Language Processing 14 Dec 20, 2022
PyTorch code for the NAACL 2021 paper "Improving Generation and Evaluation of Visual Stories via Semantic Consistency"

Improving Generation and Evaluation of Visual Stories via Semantic Consistency PyTorch code for the NAACL 2021 paper "Improving Generation and Evaluat

Adyasha Maharana 28 Dec 08, 2022
A machine learning project which can detect and predict the skin disease through image recognition.

ML-Project-2021 A machine learning project which can detect and predict the skin disease through image recognition. The dataset used for this is the H

Debshishu Ghosh 1 Jan 13, 2022
Few-NERD: Not Only a Few-shot NER Dataset

Few-NERD: Not Only a Few-shot NER Dataset This is the source code of the ACL-IJCNLP 2021 paper: Few-NERD: A Few-shot Named Entity Recognition Dataset.

THUNLP 319 Dec 30, 2022
[KDD 2021, Research Track] DiffMG: Differentiable Meta Graph Search for Heterogeneous Graph Neural Networks

DiffMG This repository contains the code for our KDD 2021 Research Track paper: DiffMG: Differentiable Meta Graph Search for Heterogeneous Graph Neura

AutoML Research 24 Nov 29, 2022
Computer Vision is an elective course of MSAI, SCSE, NTU, Singapore

[AI6122] Computer Vision is an elective course of MSAI, SCSE, NTU, Singapore. The repository corresponds to the AI6122 of Semester 1, AY2021-2022, starting from 08/2021. The instructor of this course

HT. Li 5 Sep 12, 2022