我想一起使用已处理的coco数据集和自定义数据集。
我将使用Coco中的汽车、摩托车和自行车。我将添加电动滑板车作为一个新的自定义数据集。
最后,我们将生产yolo v5,目标检测汽车、摩托车、自行车和电动滑板车。
我该怎么做呢?如果有案子,请告诉我。谢谢。
发布于 2022-07-15 07:24:37
为了对这两个数据集进行培训,您需要做以下工作:
custom.yaml下创建一个yolov5/data文件,在该文件中指定用于培训和评估的两个数据集。举个例子:# Example usage: python train.py --data custom.yaml
# parent
# ├── yolov5
# └── datasets
# ├── coco2017_train_cars_motorcycles_bicycles
# └── custom_train_scooters
# 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: ../datasets # dataset root dir
train: # train images (relative to 'path')
- coco2017_train_cars_motorcycles_bicycles/images
- custom_train_scooters/images
val: # val images (relative to 'path')
- coco2017_val_cars_motorcycles_bicycles/images
- custom_val_scooters/images
# test: # test images (optional)
# - coco2017_test_cars_motorcycles_bicycles/images
# - custom_test_scooters/images
# Classes
nc: 4 # number of classes
names: [ 'car', 'motorcycle', 'bicycle', 'scooter' ] # class namespython train.py --data custom.yaml --cfg yolov5m.yaml --weights yolov5m.pt --batch-size 16 --device 0,1,2,3https://stackoverflow.com/questions/72989372
复制相似问题