# PyTorch-Spiking-YOLOv3
A PyTorch implementation of Spiking-YOLOv3, based on the PyTorch implementation of YOLOv3([ultralytics/yolov3](https://github.com/ultralytics/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 in /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 [ultralytics/yolov3](https://github.com/ultralytics/yolov3) for the basic usage for training, evaluation and inference. The main advantage of PyTorch-Spiking-YOLOv3 is the transformation from ANN to SNN.
### Train
```
$ python3 train.py --batch-size 32 --cfg cfg/yolov3-tiny-ours.cfg --data data/coco.data --weights ''
```
### Test
```
$ python3 test.py --cfg cfg/yolov3-tiny-ours.cfg --data data/coco.data --weights weights/best.pt --batch-size 32 --img-size 640
```
### Detect
```
$ python3 detect.py --cfg cfg/yolov3-tiny-ours.cfg --weights weights/best.pt --img-size 640
```
### Transform
```
$ python3 ann_to_snn.py --cfg cfg/yolov3-tiny-ours.cfg --data data/coco.data --weights weights/best.pt --timesteps 128
```
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 PASCAL VOC & COCO which are commonly used in object detection,and two custom datasets UAV & UAVCUT.
| dataset | yolov3 | yolov3-tiny | yolov3-tiny-ours | yolov3-tiny-ours-snn |
| ---- | ---- | ---- | ---- | ---- |
| UAVCUT | 98.90% | 99.10% | **98.80%** | **98.60%** |
| UAV | 99.50% | 99.40% | **99.10%** | **98.20%** |
| VOC07+12 | 77.00% | 52.30% | **55.50%** | **55.56%** |
| COCO2014 | 56.50% | 33.30% | **38.70%** | **29.50%** |
From the results, we can conclude that:
1) for simple custom datasets like UAV & UAVCUT, the accuracy of converting some operators is nearly equivalent to the original YOLOv3-Tiny;
2) for complex common datasets like PASCAL VOC & COCO, the accuracy of converting some operators is even better than the original YOLOv3-Tiny;
3) for most datasets, our method of transformation from ANN to SNN can be nearly lossless;
4) for rather complex dataset like COCO, our method of transformation from ANN to SNN causes a certain loss of accuracy(which will been improved later).
UAVCUT
![avatar](/assets/uavcut.png)
UAV
![avatar](/assets/uav.png)
PASCAL VOC
![avatar](/assets/voc.jpg)
COCO
![avatar](/assets/coco.jpg)
## References
### Articles
+ [Theory and Tools for the Conversion of Analog to Spiking Convolutional Neural Networks](https://arxiv.org/abs/1612.04052)
+ [Spiking-YOLO: Spiking Neural Network for Energy-Efficient Object Detection](https://arxiv.org/abs/1903.06530)
### GitHub
+ [NeuromorphicProcessorProject/snn_toolbox](https://github.com/NeuromorphicProcessorProject/snn_toolbox)
+ [hahnyuan/ANN2SNN](http://git.wildz.cn/hahnyuan/ANN2SNN)
没有合适的资源?快使用搜索试试~ 我知道了~
PyTorch-Spiking-YOLOv3:Spiking-YOLOv3的PyTorch实现。 根据YOLOv3的两个常见Py...
共56个文件
py:19个
jpg:13个
cfg:12个
5星 · 超过95%的资源 需积分: 46 25 下载量 189 浏览量
2021-05-04
02:36:36
上传
评论 6
收藏 2.84MB ZIP 举报
温馨提示
PyTorch-Spiking-YOLOv3 基于YOLOv3的PyTorch实现( )的Spiking-YOLOv3的PyTorch实现,目前支持Spiking-YOLOv3-Tiny。 整个Spiking-YOLOv3即将得到支持。 介绍 为了实现尖峰效果,YOLOv3-Tiny中的某些运算符已进行等效转换。 有关详细信息,请参阅/ cfg中的yolov3-tiny-ours(*)。cfg。 某些运营商的转换 'maxpool(stride = 2)'->'convolutional(stride = 2)' 'maxpool(stride = 1)'->'none' 'upsample'->'transposed_convolutional' 'leaky_relu'->'relu' '批处理标准化'->'fuse_conv_and_bn' 用法 有关培训,评估和推断的基
资源详情
资源评论
资源推荐
收起资源包目录
PyTorch-Spiking-YOLOv3-ultralytics.zip (56个子文件)
PyTorch-Spiking-YOLOv3-ultralytics
models.py 24KB
cfg
yolov3-tiny-mp2conv-mp1none-lk2relu-up2tconv.cfg 3KB
uav-yolov3-tiny-mp2conv-mp1none-lk2relu-up2tconv-groups.cfg 3KB
voc-yolov3.cfg 8KB
uav-yolov3-tiny.cfg 2KB
voc-yolov3-tiny-mp2conv-mp1none-lk2relu-up2tconv.cfg 3KB
voc-yolov3-tiny.cfg 2KB
uavcut-yolov3-tiny-mp2conv-mp1none-lk2relu-up2tconv-groups.cfg 3KB
yolov3.cfg 8KB
uavcut-yolov3-tiny.cfg 2KB
uav-yolov3.cfg 8KB
yolov3-tiny.cfg 2KB
uavcut-yolov3.cfg 8KB
data
coco.names 625B
get_coco_dataset.sh 898B
samples
messi.jpg 124KB
bus.jpg 476KB
zidane.jpg 165KB
room.jpg 83KB
.DS_Store 6KB
street.jpg 100KB
field.jpg 111KB
herd_of_horses.jpg 130KB
dog.jpg 160KB
giraffe.jpg 374KB
person.jpg 77KB
eagle.jpg 139KB
test.py 12KB
train.py 23KB
assets
uavcut.png 201KB
coco.jpg 124KB
voc.jpg 100KB
uav.png 458KB
ann_to_snn.py 10KB
LICENSE 34KB
detect.py 8KB
requirements.txt 569B
.gitignore 12B
weights
download_weights.sh 303B
README.md 3KB
spiking_utils
snn_transformer.py 7KB
spike_tensor.py 2KB
spike_layer.py 8KB
spike_dag.py 3KB
snn_evaluate.py 20KB
ann_parser.py 7KB
utils
adabound.py 11KB
utils.py 44KB
datasets.py 34KB
evolve.sh 932B
torch_utils.py 9KB
gcp.sh 2KB
__init__.py 0B
parse_config.py 3KB
layers.py 5KB
google_utils.py 3KB
共 56 条
- 1
大英勋爵汉弗莱
- 粉丝: 42
- 资源: 4491
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 2025安全员考试题库及答案.doc
- 5G基础考试题库及答案.docx
- 2025《管理学》考试题库及答案.docx
- 2025《海底两万里》知识题库及答案.docx
- 2025《社会体育概论》试题库及答案(通用版).docx
- 2025《数字经济技能培训专题》课后试题库及答案(通用版).docx
- 2025《网络安全建设与网络社会治理》考试题库(含答案).docx
- 2025《医疗器械经营监督管理办法》培训知识题库附含答案.docx
- 2025《医疗器械经营监督管理办法》培训知识题库及答案(通用版).docx
- 2025【安全员C证】考试题库及答案(通用版).docx
- 2025JAVA基础考试题及答案.docx
- 2025JAVA基础考试题库(含答案).docx
- 2025MBA项目管理试题库及答案.docx
- 2025N1叉车司机考试题库及答案.docx
- 2025Photoshop平面设计考试题库及答案(通用版).docx
- 2025阿里巴巴淘宝云客服-消费者咨询业务知识题及答案.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1