All Projects → nhthang9x → Yolo-v2-pytorch

nhthang9x / Yolo-v2-pytorch

Licence: MIT license
YOLO for object detection tasks

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Yolo-v2-pytorch

OpenCvSharpDnnYolo
Yolo With OpenCvSharp Dnn
Stars: ✭ 25 (-92.35%)
Mutual labels:  yolo, yolov2
Yolo V2 Pytorch
YOLO for object detection tasks
Stars: ✭ 302 (-7.65%)
Mutual labels:  yolo, deeplearning
object-tracking
Multiple Object Tracking System in Keras + (Detection Network - YOLO)
Stars: ✭ 89 (-72.78%)
Mutual labels:  yolo, yolov2
VideoRecognition-realtime-autotrainer-alerts
State of the art object detection in real-time using YOLOV3 algorithm. Augmented with a process that allows easy training of the classifier as a plug & play solution . Provides alert if an item in an alert list is detected.
Stars: ✭ 36 (-88.99%)
Mutual labels:  yolo, yolov2
Alturos.ImageAnnotation
A collaborative tool for labeling image data for yolo
Stars: ✭ 47 (-85.63%)
Mutual labels:  yolo, yolov2
go-darknet
Go bindings for Darknet (YOLO v4 / v3)
Stars: ✭ 56 (-82.87%)
Mutual labels:  yolo, yolov2
Custom-Object-Detection-using-Darkflow
Make custom objects dataset and detect them using darkflow. Darkflow is a tensorflow translation of Darknet.
Stars: ✭ 21 (-93.58%)
Mutual labels:  yolo, yolov2
lightDenseYOLO
A real-time object detection app based on lightDenseYOLO Our lightDenseYOLO is the combination of two components: lightDenseNet as the CNN feature extractor and YOLO v2 as the detection module
Stars: ✭ 20 (-93.88%)
Mutual labels:  yolo, yolov2
darknet
php ffi darknet
Stars: ✭ 21 (-93.58%)
Mutual labels:  yolo, yolov2
Bmw Yolov4 Inference Api Gpu
This is a repository for an nocode object detection inference API using the Yolov3 and Yolov4 Darknet framework.
Stars: ✭ 237 (-27.52%)
Mutual labels:  yolo, deeplearning
YOLO-Object-Counting-API
The code of the Object Counting API, implemented with the YOLO algorithm and with the SORT algorithm
Stars: ✭ 131 (-59.94%)
Mutual labels:  yolo, yolov2
tfjs-yolo
YOLO v3 and Tiny YOLO v1, v2, v3 with Tensorflow.js
Stars: ✭ 108 (-66.97%)
Mutual labels:  yolo, yolov2
Bmw Yolov4 Training Automation
This repository allows you to get started with training a state-of-the-art Deep Learning model with little to no configuration needed! You provide your labeled dataset or label your dataset using our BMW-LabelTool-Lite and you can start the training right away and monitor it in many different ways like TensorBoard or a custom REST API and GUI. NoCode training with YOLOv4 and YOLOV3 has never been so easy.
Stars: ✭ 533 (+63%)
Mutual labels:  yolo, deeplearning
car-detection-yolo
Autonomous driving - car detection using the very powerful YOLO model
Stars: ✭ 73 (-77.68%)
Mutual labels:  yolo, yolov2
PyTorch-YOLO-v2
A PyTorch implementation of a YOLO v2 Object Detector
Stars: ✭ 14 (-95.72%)
Mutual labels:  yolo, yolov2
Deep-Reinforcement-Learning-for-Boardgames
Master Thesis project that provides a training framework for two player games. TicTacToe and Othello have already been implemented.
Stars: ✭ 17 (-94.8%)
Mutual labels:  deeplearning
knime-deeplearning
KNIME Deep Learning Integration
Stars: ✭ 19 (-94.19%)
Mutual labels:  deeplearning
Psychic-CCTV
A video analysis tool built completely in python.
Stars: ✭ 21 (-93.58%)
Mutual labels:  yolo
YOLOX deepsort tracker
using yolox+deepsort for object-tracking
Stars: ✭ 228 (-30.28%)
Mutual labels:  yolo
YOLOv4MLNet
Use the YOLO v4 and v5 (ONNX) models for object detection in C# using ML.Net
Stars: ✭ 61 (-81.35%)
Mutual labels:  yolo

[PYTORCH] YOLO (You Only Look Once)

Introduction

Here is my pytorch implementation of the model described in the paper YOLO9000: Better, Faster, Stronger paper.


An example of my model's output.

How to use my code

With my code, you can:

  • Train your model from scratch
  • Train your model with my trained model
  • Evaluate test images with either my trained model or yours

Requirements:

  • python 3.6
  • pytorch 0.4
  • opencv (cv2)
  • tensorboard
  • tensorboardX (This library could be skipped if you do not use SummaryWriter)
  • numpy

Datasets:

I used 4 different datases: VOC2007, VOC2012, COCO2014 and COCO2017. Statistics of datasets I used for experiments is shown below

Dataset Classes #Train images/objects #Validation images/objects
VOC2007 20 5011/12608 4952/-
VOC2012 20 5717/13609 5823/13841
COCO2014 80 83k/- 41k/-
COCO2017 80 118k/- 5k/-

Create a data folder under the repository,

cd {repo_root}
mkdir data
  • VOC: Download the voc images and annotations from VOC2007 or VOC2012. Make sure to put the files as the following structure:

    VOCDevkit
    ├── VOC2007
    │   ├── Annotations  
    │   ├── ImageSets
    │   ├── JPEGImages
    │   └── ...
    └── VOC2012
        ├── Annotations  
        ├── ImageSets
        ├── JPEGImages
        └── ...
    
  • COCO: Download the coco images and annotations from coco website. Make sure to put the files as the following structure:

    COCO
    ├── annotations
    │   ├── instances_train2014.json
    │   ├── instances_train2017.json
    │   ├── instances_val2014.json
    │   └── instances_val2017.json
    │── images
    │   ├── train2014
    │   ├── train2017
    │   ├── val2014
    │   └── val2017
    └── anno_pickle
        ├── COCO_train2014.pkl
        ├── COCO_val2014.pkl
        ├── COCO_train2017.pkl
        └── COCO_val2017.pkl
    

Setting:

  • Model structure: In compared to the paper, I changed structure of top layers, to make it converge better. You could see the detail of my YoloNet in src/yolo_net.py.
  • Data augmentation: I performed dataset augmentation, to make sure that you could re-trained my model with small dataset (~500 images). Techniques applied here includes HSV adjustment, crop, resize and flip with random probabilities
  • Loss: The losses for object and non-objects are combined into a single loss in my implementation
  • Optimizer: I used SGD optimizer and my learning rate schedule is as follows:
Epoches Learning rate
0-4 1e-5
5-79 1e-4
80-109 1e-5
110-end 1e-6
  • In my implementation, in every epoch, the model is saved only when its loss is the lowest one so far. You could also use early stopping, which could be triggered by specifying a positive integer value for parameter es_patience, to stop training process when validation loss has not been improved for es_patience epoches.

Trained models

You could find all trained models I have trained in YOLO trained models

Training

For each dataset, I provide 2 different pre-trained models, which I trained with corresresponding dataset:

  • whole_model_trained_yolo_xxx: The whole trained model.
  • only_params_trained_yolo_xxx: The trained parameters only.

You could specify which trained model file you want to use, by the parameter pre_trained_model_type. The parameter pre_trained_model_path then is the path to that file.

If you want to train a model with a VOC dataset, you could run:

  • python3 train_voc.py --year year: For example, python3 train_voc.py --year 2012

If you want to train a model with a COCO dataset, you could run:

  • python3 train_coco.py --year year: For example, python3 train_coco.py --year 2014

If you want to train a model with both COCO datasets (training set = train2014 + val2014 + train2017, val set = val2017), you could run:

  • python3 train_coco_all.py

Test

For each type of dataset (VOC or COCO), I provide 3 different test scripts:

If you want to test a trained model with a standard VOC dataset, you could run:

  • python3 test_xxx_dataset.py --year year: For example, python3 test_coco_dataset.py --year 2014

If you want to test a model with some images, you could put them into the same folder, whose path is path/to/input/folder, then run:

  • python3 test_xxx_images.py --input path/to/input/folder --output path/to/output/folder: For example, python3 train_voc_images.py --input test_images --output test_images

If you want to test a model with a video, you could run :

  • python3 test_xxx_video.py --input path/to/input/file --output path/to/output/file: For example, python3 test_coco_video --input test_videos/input.mp4 --output test_videos/output.mp4

Experiments:

I trained models in 2 machines, one with NVIDIA TITAN X 12gb GPU and the other with NVIDIA quadro 6000 24gb GPU.

The training/test loss curves for each experiment are shown below:

  • VOC2007 voc2007 loss
  • VOC2012 voc2012 loss
  • COCO2014 coco2014 loss
  • COCO2014+2017 coco2014_2017 loss

Statistics for mAP will be updated soon ...

Results

Some output predictions for experiments for each dataset are shown below:

  • VOC2007

  • VOC2012

  • COCO2014

  • COCO2014+2017

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].