GitHub - c0nn3r/RetinaNet: An implementation of RetinaNet in PyTorch.
source link: https://github.com/c0nn3r/RetinaNet
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
RetinaNet
An implementation of RetinaNet in PyTorch.
Installation
- Install PyTorch and torchvision.
- For faster data augmentation, install pillow-simd:
pip uninstall -y pillow
pip install pillow-simd
Training
COCO 2017
- First, install pycocotools:
git clone https://github.com/pdollar/coco/
cd coco/PythonAPI
make
python setup.py install
cd ../..
rm -r coco
- Then download COCO 2017 into
./datasets/COCO/
:
cd datasets
mkdir COCO
cd COCO
If your using wget
:
wget http://images.cocodataset.org/zips/train2017.zip &&
wget http://images.cocodataset.org/zips/val2017.zip &&
wget http://images.cocodataset.org/annotations/annotations_trainval2017.zip
If your using aria2c
(recommended on for higher bandwidth connections and for allowing resumption of the download.
Tune the number of max concurrent downloads (-j
) and max connections per server (-x
) as needed:
aria2c -x 10 -j 10 http://images.cocodataset.org/zips/train2017.zip &&
aria2c -x 10 -j 10 http://images.cocodataset.org/zips/val2017.zip &&
aria2c -x 10 -j 10 http://images.cocodataset.org/annotations/annotations_trainval2017.zip
unzip *.zip
rm *.zip
Then just run:
python train_coco.py
Pascal VOC
cd datasets
mkdir VOC
cd VOC
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtrainval_06-Nov-2007.tar &&
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar &&
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtest_06-Nov-2007.tar
If your using aria2c
(recommended on for higher bandwidth connections and for allowing resumption of the download.
Tune the number of max concurrent downloads (-j
) and max connections per server (-x
) as needed:
aria2c -x 10 -j 10 http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtrainval_06-Nov-2007.tar &&
aria2c -x 10 -j 10 http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar &&
aria2c -x 10 -j 10 http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtest_06-Nov-2007.tar
tar xf *.tar
rm *.tar
Then just run:
python train_voc.py
Custom Dataset
Lots to write here.
Evaluation
To evaluate an image on a trained model:
python eval.py [checkpoint_path] [image_path]
This will create an image (output.jpg
) with bounding box annotations.
- Finish converting the COCO dataset class to work with batches.
- Train COCO 2017 for 90,000 iterations and save a reusable checkpoint.
- Try training on Pascal VOC and add download instructions.
- Produce bounding box outputs for a few sanity check images.
- Upload trained weights to Github releases.
- Train on the magic proprietary dataset .
Credits
Recommend
-
174
PyTorch implementation of the YOLO (You Only Look Once) v2 The YOLOv2 is one of the most popular one-stage o...
-
96
Detectron is deprecated. Please see detectron2, a ground-up rewrite of Detectron in PyTorch. Detectron Detectron is Facebook AI Research'...
-
184
README.md Keras RetinaNet
-
32
Computer Vision for Sports Detecting soccer players and ball with RetinaNet. Straight-to-the-point guide to building a computer vision model to detect players and ball in overhead camera images.
-
20
加入极市专业CV交流群,与 1 0000+来自港科大、北大、清华、中科院、CMU、腾讯、百度 等名校名企视觉开发者互动交流! 同时提供每月大咖直播分享、真实项目需求对接、干货资讯汇总,行业...
-
8
Object Detection using RetinaNet with PyTorch and Deep Learning
-
8
论文分析了one-stage网络训练存在的类别不平衡问题,提出能根据loss大小自动调节权重的focal loss,使得模型的训练更专注于困难样本。同时,基于FPN设计了RetinaNet,在精度和速度上都有不俗的表现 论文:Focal Loss...
-
3
FPN(续) https://zhuanlan.zhihu.com/p/58603276 FPN-目标检测 https://zhuanlan.zhihu.com/p/70523190 总结-CNN中的目标多尺度处理 https://mp.weixin.qq.com/s/xMQA97k0USl69v1MC86HKA 多尺度特征金字塔...
-
2
This article was published as a part of the Data Science Blogathon. Introduction RetinaNet is a single-stage object detection model that uses a focal loss function...
-
1
一阶段目标检测网络-RetinaNet 详解 ...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK