GithubHelp home page GithubHelp logo

ljl02521 / sfd.pytorch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from louis-she/sfd.pytorch

0.0 1.0 0.0 8.99 MB

S3FD: single shot face detector in pytorch

License: MIT License

Python 18.49% Dockerfile 0.13% Jupyter Notebook 81.38%

sfd.pytorch's Introduction

sfd.pytorch

sfd implementation for face recognition in pytorch. Paper at: SFD: Single Shot Scale-invariant Face Detector

Need help ๐Ÿ’ฆ

This repo is still under developing, any issue or pull request is very welcome. Currently the weights given bellow achieve 0.7 mAP on all the validation set of wider face. I'm still training it with my poor 1080ti. Anyone with more computing resources wants to train this please open an issue to get in touched.

Requirements

  • Python 3.6
  • Pytorch 0.4
  • TensorBoard(Optional)

TODOs

  • Training on wider faces.
  • Inference tools and API.
  • Non-maximum suppression at reference.
  • TensorBoard supported.
  • Evaluation.
  • Image augmentation.
  • Multi-class detection.

Detection

The detector.py is executable and programmable, see inference.ipynb for a quick look at how to use the detector API. Using the following command for directly use it in the command line.

python3 detector.py --image ./image/test.jpg --model ./epoch_204.pth.tar

The trained model epoch_204.pth.tar can be downloaded from Baidu Yun or Google Drive.

The detector will draw bounding boxes and the result is showing bellow

Train

To train with the wider_face dataset, download and extract everything in one directory named wider_face. The file trees should then look like this,

โ””โ”€โ”€ wider_face
    โ”œโ”€โ”€ Submission_example.zip
    โ”œโ”€โ”€ wider_face_split
    โ”‚ย ย  โ”œโ”€โ”€ readme.txt
    โ”‚ย ย  โ”œโ”€โ”€ wider_face_test_filelist.txt
    โ”‚ย ย  โ”œโ”€โ”€ wider_face_test.mat
    โ”‚ย ย  โ”œโ”€โ”€ wider_face_train_bbx_gt.txt
    โ”‚ย ย  โ”œโ”€โ”€ wider_face_train.mat
    โ”‚ย ย  โ”œโ”€โ”€ wider_face_val_bbx_gt.txt
    โ”‚ย ย  โ””โ”€โ”€ wider_face_val.mat
    โ”œโ”€โ”€ wider_face_split.zip
    โ”œโ”€โ”€ WIDER_test
    โ”‚ย ย  โ””โ”€โ”€ images
    โ”œโ”€โ”€ WIDER_test.zip
    โ”œโ”€โ”€ WIDER_train
    โ”‚ย ย  โ””โ”€โ”€ images
    โ”œโ”€โ”€ WIDER_train.zip
    โ”œโ”€โ”€ WIDER_val
    โ”‚ย ย  โ””โ”€โ”€ images
    โ””โ”€โ”€ WIDER_val.zip

In the config.py, set the DATASET_DIR to the path of wider_face, and set the LOG_DIR to whatever but a existed directory. Now it's ready to train with the following command,

python3 main.py # there is no stdout

The training log is in LOG_DIR/log.txt, and models will be saved at LOG_DIR/models/epoch_xx.pth. There are many options in config.py(including learning rate or resumption) for you to tweak to get a better model.

TensorBoard

If you have TensorBoard installed, set TENSOR_BOARD_ENABLED to True in the config.py, you can use the following command to quickly start the TensorBoard server.

./bin/tensorboard

To visualize how the loss is changing.

sfd.pytorch's People

Contributors

louis-she avatar pengbo0054 avatar ahkarami avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.