YOLOv5训练COCO2017数据集

训练COCO2017数据集

 

namedescriptiondownload url
train2017.zip19G, 118k imageshttp://images.cocodataset.org/zips/train2017.zip
val2017.zip1G, 5k imageshttp://images.cocodataset.org/zips/val2017.zip
test2017.zip7G, 41k imageshttp://images.cocodataset.org/zips/test2017.zip

下载以上数据集后,将图片解压到yolov5/data/datasets/coco/images/
(2)下载标注文件annotations_trainval2017.zip
将标注文件解压到yolov5/data/datasets/coco/annotations/

(3)下载coco2017labels.zip
将coco2017labels/coco/labels解压到yolov5/data/datasets/coco/labels/;
再将coco2017labels/coco/train2017.txt、coco2017labels/coco/val2017.txt和coco2017labels/coco/test-dev2017.txt解压到yolov5/data/datasets/coco


数据集目录为

yolov5
    -data
        -datasets
            -coco
                -images
                    -xxxxxxxxxxxx.jpg
                -annotations
                    -instance_train2017.json
                    -instance_val2017.json
                -labels
                   -train2017
                       -xxxxxxxxxxxx.txt
                   -val2017
                       -xxxxxxxxxxxx.txt
                -train2017.txt
                -val2017.txt
                -test-dev2017.txt

2、yaml文件的修改

data/coco.yaml
注意检查train val test的路径

# YOLOv5 🚀 by Ultralytics, GPL-3.0 license
# COCO 2017 dataset http://cocodataset.org by Microsoft
# Example usage: python train.py --data coco.yaml
# parent
# ├── yolov5
# └── datasets
#     └── coco  ← downloads here (20.1 GB)


# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
# path: public/DL_DATA/COCO2017  # dataset root dir
train: ./data/datasets/coco/train2017.txt  # train images (relative to 'path') 118287 images
val: ./data/datasets/coco/val2017.txt  # val images (relative to 'path') 5000 images
test: ./data/datasets/coco/test-dev2017.txt  # 20288 of 40670 images, submit to https://competitions.codalab.org/competitions/20794

# Classes
nc: 80  # number of classes
names: ['person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train', 'truck', 'boat', 'traffic light',
        'fire hydrant', 'stop sign', 'parking meter', 'bench', 'bird', 'cat', 'dog', 'horse', 'sheep', 'cow',
        'elephant', 'bear', 'zebra', 'giraffe', 'backpack', 'umbrella', 'handbag', 'tie', 'suitcase', 'frisbee',
        'skis', 'snowboard', 'sports ball', 'kite', 'baseball bat', 'baseball glove', 'skateboard', 'surfboard',
        'tennis racket', 'bottle', 'wine glass', 'cup', 'fork', 'knife', 'spoon', 'bowl', 'banana', 'apple',
        'sandwich', 'orange', 'broccoli', 'carrot', 'hot dog', 'pizza', 'donut', 'cake', 'chair', 'couch',
        'potted plant', 'bed', 'dining table', 'toilet', 'tv', 'laptop', 'mouse', 'remote', 'keyboard', 'cell phone',
        'microwave', 'oven', 'toaster', 'sink', 'refrigerator', 'book', 'clock', 'vase', 'scissors', 'teddy bear',
        'hair drier', 'toothbrush']  # class names

3、训练

python train.py

传送

YOLOv5训练自定义的烟火数据集和COCO2017数据集_June vinvin的博客-CSDN博客

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值