VarCode-ai / yolox-face-detection

How to train and use Yolox on custom dataset

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

Yolox Face Detection

How to train and use Yolox on WiderFace dataset
View Jupyter Notebook »

View Test · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

YOLOX is an anchor-free version of YOLO with strong performance for object detection. In this repository I train Yolox on WiderFace dataset with Google Colab to develop a face detection algorithm.

(back to top)

Built With

(back to top)

Getting Started

Look at Jupyter Notebooks to see training details and how to make this algorithm from scratch.

Installation

  1. Clone the repo

    git clone https://github.com/VarCode-ai/yolox-face-detection.git
    cd yolox-face-detection
  2. Install YOLOX

    pip3 install -U pip && pip3 install -r requirements.txt
    
    pip3 install -v -e .
    
    pip3 install "git+https://github.com/philferriere/cocoapi.git#egg=pycocotools&subdirectory=PythonAPI"
    
    pip3 install cython
  3. Download JPEGImages of Wider Face dataset

    cd datasets\VOCdevkit\VOC2022\JPEGImages
    python download_images.py

(back to top)

Usage

Real time detection

python tools/demo.py webcam -f exps/example/yolox_voc/yolox_voc_s.py -c YOLOX_outputs/yolox_voc_s/latest_ckpt.pth --conf 0.25 --nms 0.45 --tsize 640 --device [cpu/gpu]

Images

python tools/demo.py image -f exps/example/yolox_voc/yolox_voc_s.py -c YOLOX_outputs/yolox_voc_s/latest_ckpt.pth --path assets/001.jpg --conf 0.25 --nms 0.45 --tsize 640 --save_result --device [cpu/gpu]

Video

python tools/demo.py video -f exps/example/yolox_voc/yolox_voc_s.py -c YOLOX_outputs/yolox_voc_s/latest_ckpt.pth --path assets/will_smith_slap.mp4 --conf 0.25 --nms 0.45 --tsize 640 --save_result --device [cpu/gpu]

For more examples, please refer to the Documentation

(back to top)

Train from pre-trained weights

Weights trained for 6 epochs

Code for resume training

python tools/train.py -f exps/example/yolox_voc/yolox_voc_s.py -d 1 -b 4 -c YOLOX_outputs/yolox_voc_s/latest_ckpt.pth --resume

(back to top)

License

Distributed under the Apache-2.0 License. See LICENSE for more information.

(back to top)

Contact

Vincenzo Varriale - @vincenzovarriale - vincenzo.varriale.dev@gmail.com

Project Link: https://github.com/VarCode-ai/yolox-face-detection

(back to top)

About

How to train and use Yolox on custom dataset

License:Apache License 2.0


Languages

Language:Jupyter Notebook 72.4%Language:Python 25.4%Language:C++ 2.3%