机器之心报道
作者:陈萍
距离 YOLO v4 的推出,已经过去 5 个多月。YOLO 框架采用 C 语言作为底层代码,这对于惯用 Python 的研究者来说,实在是有点不友好。因此网上出现了很多基于各种深度学习框架的 YOLO 复现版本。近日,就有研究者在 GitHub 上更新了基于 PyTorch 的 YOLOv4。
Nvida GeForce RTX 2080TI
CUDA10.0
CUDNN7.0
windows 或 linux 系统
python 3.6
DO-Conv (https://arxiv.org/abs/2006.12030) (torch>=1.2)
Attention
fp_16 training
Mish
Custom data
Data Augment (RandomHorizontalFlip, RandomCrop, RandomAffine, Resize)
Multi-scale Training (320 to 640)
focal loss
CIOU
Label smooth
Mixup
cosine lr
pip3 install -r requirements.txt --user
git clone github.com/argusswift/YOLOv4-PyTorch.git
$HOME/data Download the data.cd
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/VOCtrainval_06-Nov-2007.tar
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtest_06-Nov-2007.tar# Extract the data.
tar -xvf VOCtrainval_11-May-2012.tar
tar -xvf VOCtrainval_06-Nov-2007.tar
tar -xvf VOCtest_06-Nov-2007.tar
#step1: download the following data and annotation
2017 Train images
2017 Val images [5K/1GB]
2017 Test images [41K/6GB]
2017 Train/Val annotations [241MB]
#step2: arrange the data to the following structure
COCO
---train
---test
---val
---annotations
将数据集放入目录,更新 config/yolov4_config.py 中的 DATA_PATH 参数。
(对于 COCO 数据集)使用 coco_to_voc.py 将 COCO 数据类型转换为 VOC 数据类型。
转换数据格式:使用 utils/voc.py 或 utils/coco.py 将 pascal voc *.xml 格式(或 COCO *.json 格式)转换为 *.txt 格式(Image_path xmin0,ymin0,xmax0,ymax0,class0 xmin1,ymin1,xmax1,ymax1,class1 ...)。
CUDA_VISIBLE_DEVICES=0 nohup python -u train.py --weight_path weight/yolov4.weights --gpu_id 0 > nohup.log 2>&1 &
CUDA_VISIBLE_DEVICES=0 nohup python -u train.py --weight_path weight/last.pt --gpu_id 0 > nohup.log 2>&1 &
for VOC dataset:
CUDA_VISIBLE_DEVICES=0 python3 eval_voc.py --weight_path weight/best.pt --gpu_id 0 --visiual $DATA_TEST --eval --mode det
for COCO dataset:
CUDA_VISIBLE_DEVICES=0 python3 eval_coco.py --weight_path weight/best.pt --gpu_id 0 --visiual $DATA_TEST --eval --mode det
for VOC dataset:
CUDA_VISIBLE_DEVICES=0 python3 eval_voc.py --weight_path weight/best.pt --gpu_id 0 --visiual $DATA_TEST --eval -
CUDA_VISIBLE_DEVICES=0 python3 eval_coco.py --weight_path weight/best.pt --gpu_id 0 --visiual $DATA_TEST --eval --mode val
type=bbox
Running per image evaluation... DONE (t=0.34s).
Accumulating evaluation results... DONE (t=0.08s).
Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.438
Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.607
Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.469
Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.253
Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.486
Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.567
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = 0.342
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = 0.571
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.632
Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.458
Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.691
Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.790
for VOC dataset:
CUDA_VISIBLE_DEVICES=0 python3 eval_voc.py --weight_path weight/best.pt --gpu_id 0 --visiual $DATA_TEST --eval
for COCO dataset:
CUDA_VISIBLE_DEVICES=0 python3 eval_coco.py --weight_path weight/best.pt --gpu_id 0 --visiual $DATA_TEST --eval
如何根据任务需求搭配恰当类型的数据库?
在AWS推出的白皮书《进入专用数据库时代》中,介绍了8种数据库类型:关系、键值、文档、内存中、关系图、时间序列、分类账、领域宽列,并逐一分析了每种类型的优势、挑战与主要使用案例。
点击阅读原文或识别二维码,申请免费获取白皮书。
© THE END
转载请联系本公众号获得授权
投稿或寻求报道:content@jiqizhixin.com