Giter VIP home page Giter VIP logo

vvhj / pytorch-spiking-yolov3 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cwq159/pytorch-spiking-yolov3

0.0 1.0 0.0 4.06 MB

A minimal PyTorch implementation of Spiking-YOLOv3, based on the minimal PyTorch implementation of PyTorch-YOLOv3(eriklindernoren/PyTorch-YOLOv3), with support for spiking-yolov3-tiny at present.

License: GNU General Public License v3.0

Python 98.70% Shell 1.30%

pytorch-spiking-yolov3's Introduction

PyTorch-Spiking-YOLOv3

A minimal PyTorch implementation of Spiking-YOLOv3, based on the minimal PyTorch implementation of YOLOv3(eriklindernoren/PyTorch-YOLOv3), with support for Spiking-YOLOv3-Tiny at present. The whole Spiking-YOLOv3 will be supported soon.

Introduction

For spiking implementation, some operators in YOLOv3-Tiny have been converted equivalently. Please refer to yolov3-tiny-ours.cfg for details.

Conversion of some operators

  • 'maxpool(stride=2)'->'convolutional(stride=2)'
  • 'maxpool(stride=1)'->'none'
  • 'upsample'->'transposed_convolutional'
  • 'leaky_relu'->'relu'
  • 'batch_normalization'->'fuse_conv_and_bn'

Usage

Please refer to eriklindernoren/PyTorch-YOLOv3 for the basic usage of PyTorch-YOLOv3 for training, evaluation and inference. The main advantage of PyTorch-Spiking-YOLOv3 is the transformation from ANN to SNN.

Train

$ python3 train.py

After training, please rename your checkpoint file and move it to the /weights folder.

$ cd checkpoints
$ mv yolov3-tiny-ours_ckpt_99.pth ../weights/yolov3-tiny-ours_best.pth

Test

$ python3 test.py

Detect

$ python3 detect.py

Transform

$ python3 ann_to_snn.py

For higher accuracy(mAP), you can try to adjust some hyperparameters.

Trick: the larger timesteps, the higher accuracy.

Results

Here we show the results(mAP) of COCO2014 which is commonly used in object detection,and two custom datasets UAV/UAVCUT.

dataset yolov3 yolov3-tiny yolov3-tiny-ours yolov3-tiny-ours-snn
UAVCUT 99.84% 99.86% 99.80% 99.60%
UAV 80.21% 90.81% 89.05% 87.02%
COCO2014 54.93% 30.87% 13.30% 13.82%

From the results, we can conclude that:

  1. for simple custom datasets, converting some operators is equivalent to the original YOLOv3-Tiny;
  2. for complete dataset like COCO2014, the accuracy of converting some operators is lower than the original YOLOv3-Tiny;
  3. regardless of datasets, our method of transformation from ANN to SNN can be nearly lossless.

avatar

avatar

avatar

References

Articles

GitHub

pytorch-spiking-yolov3's People

Contributors

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