Upload 101 files
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- README.md +158 -3
- best_model.pt +3 -0
- get_dataset.py +389 -0
- load_model.py +89 -0
- predict.py +19 -0
- requirements.txt +5 -0
- test.py +10 -0
- train.py +14 -0
- ultralytics/cfg/__init__.py +1029 -0
- ultralytics/cfg/__pycache__/__init__.cpython-311.pyc +0 -0
- ultralytics/cfg/datasets/Argoverse.yaml +77 -0
- ultralytics/cfg/datasets/DOTAv1.5.yaml +37 -0
- ultralytics/cfg/datasets/DOTAv1.yaml +36 -0
- ultralytics/cfg/datasets/GlobalWheat2020.yaml +68 -0
- ultralytics/cfg/datasets/ImageNet.yaml +2025 -0
- ultralytics/cfg/datasets/Objects365.yaml +443 -0
- ultralytics/cfg/datasets/SKU-110K.yaml +58 -0
- ultralytics/cfg/datasets/VOC.yaml +106 -0
- ultralytics/cfg/datasets/VisDrone.yaml +77 -0
- ultralytics/cfg/datasets/african-wildlife.yaml +25 -0
- ultralytics/cfg/datasets/brain-tumor.yaml +23 -0
- ultralytics/cfg/datasets/carparts-seg.yaml +44 -0
- ultralytics/cfg/datasets/coco-pose.yaml +42 -0
- ultralytics/cfg/datasets/coco.yaml +118 -0
- ultralytics/cfg/datasets/coco128-seg.yaml +101 -0
- ultralytics/cfg/datasets/coco128.yaml +101 -0
- ultralytics/cfg/datasets/coco8-pose.yaml +26 -0
- ultralytics/cfg/datasets/coco8-seg.yaml +101 -0
- ultralytics/cfg/datasets/coco8.yaml +101 -0
- ultralytics/cfg/datasets/crack-seg.yaml +22 -0
- ultralytics/cfg/datasets/dog-pose.yaml +24 -0
- ultralytics/cfg/datasets/dota8.yaml +35 -0
- ultralytics/cfg/datasets/hand-keypoints.yaml +26 -0
- ultralytics/cfg/datasets/lvis.yaml +1240 -0
- ultralytics/cfg/datasets/medical-pills.yaml +22 -0
- ultralytics/cfg/datasets/open-images-v7.yaml +666 -0
- ultralytics/cfg/datasets/package-seg.yaml +22 -0
- ultralytics/cfg/datasets/signature.yaml +21 -0
- ultralytics/cfg/datasets/tiger-pose.yaml +25 -0
- ultralytics/cfg/datasets/xView.yaml +155 -0
- ultralytics/cfg/default.yaml +128 -0
- ultralytics/cfg/models/11/yolo11-cls-resnet18.yaml +17 -0
- ultralytics/cfg/models/11/yolo11-cls.yaml +33 -0
- ultralytics/cfg/models/11/yolo11-obb.yaml +50 -0
- ultralytics/cfg/models/11/yolo11-pose.yaml +51 -0
- ultralytics/cfg/models/11/yolo11-seg.yaml +50 -0
- ultralytics/cfg/models/11/yolo11.yaml +50 -0
- ultralytics/cfg/models/11/yoloe-11-seg.yaml +48 -0
- ultralytics/cfg/models/11/yoloe-11.yaml +48 -0
- ultralytics/cfg/models/12/yolo12-cls.yaml +32 -0
README.md
CHANGED
@@ -1,3 +1,158 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# 汉字识别YOLOv11项目
|
2 |
+
|
3 |
+
## 运行环境配置
|
4 |
+
|
5 |
+
1. Python环境:
|
6 |
+
```bash
|
7 |
+
conda create -n yolov11 python=3.11
|
8 |
+
conda activate yolov11
|
9 |
+
```
|
10 |
+
|
11 |
+
2. 安装PyTorch (CUDA 12.6版本):
|
12 |
+
```bash
|
13 |
+
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126
|
14 |
+
```
|
15 |
+
|
16 |
+
3. 安装项目依赖:
|
17 |
+
```bash
|
18 |
+
pip install -r requirements.txt
|
19 |
+
```
|
20 |
+
|
21 |
+
4. 验证CUDA可用性:
|
22 |
+
```python
|
23 |
+
import torch
|
24 |
+
print(torch.cuda.is_available()) # 应输出True
|
25 |
+
print(torch.cuda.device_count()) # 应输出GPU数量
|
26 |
+
```
|
27 |
+
|
28 |
+
## 项目概述
|
29 |
+
本项目基于YOLOv11实现汉字识别功能,包含完整的数据集准备、模型训练、测试评估和预测推理流程。
|
30 |
+
|
31 |
+
## 文件结构说明
|
32 |
+
```
|
33 |
+
.
|
34 |
+
├── get_dataset.py # 数据集准备脚本
|
35 |
+
├── load_model.py # 模型加载工具,包括直接加载yolo模型或者选择加载底层的torch.nn.Module模型
|
36 |
+
├── train.py # 模型训练脚本
|
37 |
+
├── test.py # 模型测试脚本
|
38 |
+
├── predict.py # 预测推理脚本
|
39 |
+
├── yolo11n.pt # 预训练模型
|
40 |
+
|── best_model.pt # 训练得到的最佳模型,对应为train9的得到的最好的模型
|
41 |
+
├── runs/ # 训练结果和预测输出
|
42 |
+
│ ├── detect/
|
43 |
+
│ │ ├── train*/ # 训练、测试集测试日志和权重
|
44 |
+
│ │ └── predict/ # 预测结果
|
45 |
+
└── ultralytics/
|
46 |
+
└── cfg/
|
47 |
+
└── default.yaml # 训练配置文件
|
48 |
+
```
|
49 |
+
|
50 |
+
## 数据集准备
|
51 |
+
1. 准备数据目录结构:
|
52 |
+
```
|
53 |
+
Data/
|
54 |
+
└── data/
|
55 |
+
├── 00001/ # 以Unicode编码命名的文件夹
|
56 |
+
│ ├── 1.jpg
|
57 |
+
│ └── ...
|
58 |
+
├── 00002/
|
59 |
+
└── ...
|
60 |
+
```
|
61 |
+
|
62 |
+
2. 准备字符映射文件`char_dict.json`,格式示例:
|
63 |
+
```json
|
64 |
+
{
|
65 |
+
"1": "一",
|
66 |
+
"2": "二",
|
67 |
+
...
|
68 |
+
}
|
69 |
+
```
|
70 |
+
|
71 |
+
3. 运行数据准备脚本:
|
72 |
+
```bash
|
73 |
+
python get_dataset.py
|
74 |
+
```
|
75 |
+
脚本将自动:
|
76 |
+
- 扫描图像文件并匹配类别
|
77 |
+
- 划分训练集/验证集/测试集
|
78 |
+
- 生成YOLO格式数据集和dataset.yaml,文件保存在项目同一级的根目录yolo_hanzi_dataset/
|
79 |
+
- 特别注意您的原始数据集路径和字符映射文件路径,以及yolo格式的数据路径,因为这个路径在训练、测试和预测过程中都会用到。
|
80 |
+
|
81 |
+
## 模型训练
|
82 |
+
1. 修改训练配置:
|
83 |
+
编辑`ultralytics/cfg/default.yaml`调整超参数
|
84 |
+
|
85 |
+
2. 开始训练:
|
86 |
+
```bash
|
87 |
+
conda activate yolov11
|
88 |
+
python train.py
|
89 |
+
```
|
90 |
+
训练过程将:
|
91 |
+
- 加载预训练模型yolo11n.pt
|
92 |
+
- 使用dataset.yaml配置数据集
|
93 |
+
- 保存训练日志和权重到runs/detect/train*
|
94 |
+
- 注意您的训练配置文件以及数据配置文件路径
|
95 |
+
|
96 |
+
## 测试评估
|
97 |
+
```bash
|
98 |
+
conda activate yolov11
|
99 |
+
python test.py
|
100 |
+
```
|
101 |
+
测试将:
|
102 |
+
- 加载最佳模型(runs/detect/train*/weights/best.pt)
|
103 |
+
- 在测试集上评估模型性能
|
104 |
+
- 输出mAP指标和可视化结果
|
105 |
+
- 注意您的测试配置文件路径以及测试模型路径
|
106 |
+
|
107 |
+
## 预测推理
|
108 |
+
```bash
|
109 |
+
conda activate yolov11
|
110 |
+
python predict.py
|
111 |
+
```
|
112 |
+
预测功能:
|
113 |
+
- 加载训练好的模型
|
114 |
+
- 对单张图片进行预测
|
115 |
+
- 显示和保存预测结果
|
116 |
+
- 打印检测到的汉字类别和置信度
|
117 |
+
- 注意您的预测图像路径以及预测模型路径
|
118 |
+
|
119 |
+
## 常见问题
|
120 |
+
1. 数据集准备失败:
|
121 |
+
- 检查数据目录结构是否正确
|
122 |
+
- 确认char_dict.json编码和格式正确
|
123 |
+
- 确保图像文件具有读取权限
|
124 |
+
- 检查数据集路径配置正确
|
125 |
+
|
126 |
+
2. 训练过程中断:
|
127 |
+
- 检查CUDA内存是否不足,可减小batch size以及图片size
|
128 |
+
- 确保数据集路径配置正确
|
129 |
+
|
130 |
+
3. 训练测试效果不佳:
|
131 |
+
- 模型过拟合:尝试使用更小的batch size和epochs,增大早停止的周期数。
|
132 |
+
- 模型欠拟合:尝试使用更复杂的模型架构,汉字识别项目数据增强可能过度,导致不必要的增强。增加图片size大小可能能提高性能。
|
133 |
+
|
134 |
+
4. 预测结果不准确:
|
135 |
+
- 检查训练数据是否充足
|
136 |
+
- 尝试调整置信度阈值(修改predict.py中的conf参数)
|
137 |
+
- 考虑使用更精确的标注数据
|
138 |
+
|
139 |
+
## 性能指标
|
140 |
+
典型训练结果:
|
141 |
+
- [email protected]: 0.90-0.95
|
142 |
+
- [email protected]:0.95: 0.90-0.95
|
143 |
+
|
144 |
+

|
145 |
+
|
146 |
+
典型测试结果:
|
147 |
+

|
148 |
+

|
149 |
+
|
150 |
+
典型预测结果:
|
151 |
+

|
152 |
+

|
153 |
+
|
154 |
+
|
155 |
+
|
156 |
+
## 后续改进
|
157 |
+
1. 该模型的预测精度高达0.97,后期可以尝试使用更小的模型————在保证精度可控的范围内,缩短训练以及推理时间。
|
158 |
+
2. 可以扩展到边缘设备,增加模型部署的效率。
|
best_model.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:96c780db6ffc12f4832f30d424284dd7230cb4b65d79fdfa98f728361a632be5
|
3 |
+
size 5814227
|
get_dataset.py
ADDED
@@ -0,0 +1,389 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import json
|
3 |
+
import shutil
|
4 |
+
import random
|
5 |
+
from glob import glob
|
6 |
+
from sklearn.model_selection import train_test_split
|
7 |
+
from tqdm import tqdm # For progress bars
|
8 |
+
|
9 |
+
# --- 1. 配置参数 ---
|
10 |
+
data_root = r'D:\不会编程\CVPR\class_project\Data\data' # 包含501个文件夹的根目录,原始数据文件路径
|
11 |
+
char_dict_path = r'D:\不会编程\CVPR\class_project\char_dict.json'# 字符映射文件
|
12 |
+
output_dir = r'D:\不会编程\CVPR\class_project\yolo_hanzi_dataset' # 输出 YOLO 格式数据集的目录名
|
13 |
+
|
14 |
+
# 划分比例
|
15 |
+
val_size = 0.15 # 验证集比例
|
16 |
+
test_size = 0.15 # 测试集比例 (相对于原始总数)
|
17 |
+
# train_size = 1.0 - val_size - test_size
|
18 |
+
|
19 |
+
# 边界框假设 (覆盖整个图像)
|
20 |
+
# <class_index> <x_center_norm> <y_center_norm> <width_norm> <height_norm>
|
21 |
+
bbox_annotation = "0.5 0.5 1.0 1.0" # x_center, y_center, width, height (归一化)
|
22 |
+
|
23 |
+
# 随机种子,确保结果可复现
|
24 |
+
random_seed = 42
|
25 |
+
random.seed(random_seed)
|
26 |
+
|
27 |
+
# --- 2. 加载字符映射 ---
|
28 |
+
print("加载 Char_dict.json...")
|
29 |
+
try:
|
30 |
+
with open(char_dict_path, 'r', encoding='utf-8') as f: # 尝试UTF-8
|
31 |
+
char_dict_raw = json.load(f)
|
32 |
+
except UnicodeDecodeError:
|
33 |
+
try:
|
34 |
+
with open(char_dict_path, 'r', encoding='ansi') as f: # 如果UTF-8失败,尝试ANSI (GBK/CP936等)
|
35 |
+
char_dict_raw = json.load(f)
|
36 |
+
print("警告: Char_dict.json 使用 ANSI 编码读取,建议转换为 UTF-8。")
|
37 |
+
except Exception as e:
|
38 |
+
print(f"错误: 无法读取 Char_dict.json。请确保文件存在且编码正确 (UTF-8 或 ANSI)。错误信息: {e}")
|
39 |
+
exit()
|
40 |
+
except FileNotFoundError:
|
41 |
+
print(f"错误: 找不到 Char_dict.json 文件,路径: {char_dict_path}")
|
42 |
+
exit()
|
43 |
+
except json.JSONDecodeError as e:
|
44 |
+
print(f"错误: Char_dict.json 文件格式无效。错误信息: {e}")
|
45 |
+
exit()
|
46 |
+
|
47 |
+
|
48 |
+
|
49 |
+
|
50 |
+
|
51 |
+
print(f"从 JSON 文件加载了 {len(char_dict_raw)} 个原始映射条目。")
|
52 |
+
|
53 |
+
# --- 扫描数据文件夹,获取实际存在的类别键 ---
|
54 |
+
print(f"扫描数据目录 '{data_root}' 以确定实际存在的类别...")
|
55 |
+
actual_unicode_keys = set()
|
56 |
+
try:
|
57 |
+
data_folders = [d for d in os.listdir(data_root) if os.path.isdir(os.path.join(data_root, d))]
|
58 |
+
print(f"找到 {len(data_folders)} 个文件夹。")#获取实际存在的类别
|
59 |
+
for folder_name in data_folders:
|
60 |
+
try:
|
61 |
+
# 尝试将文件夹名 (如 "00699") 转为整数再转为字符串 (如 "699")
|
62 |
+
key = str(int(folder_name))
|
63 |
+
if key in char_dict_raw: # 检查这个键是否在原始 JSON 映射中存在
|
64 |
+
actual_unicode_keys.add(key)
|
65 |
+
except ValueError:
|
66 |
+
# 忽略非数字命名的文件夹
|
67 |
+
pass
|
68 |
+
except FileNotFoundError:
|
69 |
+
print(f"错误:无法访问指定的 data_root 目录: {data_root}。")
|
70 |
+
exit()
|
71 |
+
except Exception as e:
|
72 |
+
print(f"扫描数据目录时发生错误: {e}")
|
73 |
+
exit()
|
74 |
+
|
75 |
+
if not actual_unicode_keys:
|
76 |
+
print(f"错误:在数据目录 '{data_root}' 中没有找到任何与 JSON 文件中的键匹配的文件夹。")
|
77 |
+
exit()
|
78 |
+
|
79 |
+
print(f"根据文件夹名称,确定了 {len(actual_unicode_keys)} 个实际存在的有效类别键。")
|
80 |
+
|
81 |
+
# ---基于实际存在的键来创建映射 ---
|
82 |
+
# 对实际存在的键进行排序,以确保 class_id 分配顺序固定
|
83 |
+
sorted_actual_keys = sorted(list(actual_unicode_keys), key=lambda x: int(x)) # 按数字大小排序
|
84 |
+
|
85 |
+
unicode_to_classid = {}#
|
86 |
+
classid_to_char = {}#实际存在的类别数量
|
87 |
+
num_classes = 0#类别的数量
|
88 |
+
|
89 |
+
print("正在创建过滤后的类别映射...")
|
90 |
+
for i, unicode_key in enumerate(sorted_actual_keys):
|
91 |
+
if unicode_key in char_dict_raw:
|
92 |
+
# 获取原始字符,并清理末尾的 \u0000 (空字符)
|
93 |
+
original_char = char_dict_raw[unicode_key]
|
94 |
+
cleaned_char = original_char.replace('\u0000', '') # 移除空字符
|
95 |
+
|
96 |
+
# 跳过空的类别名称 (来自 key "0": "")
|
97 |
+
if not cleaned_char:
|
98 |
+
print(f"警告:键 '{unicode_key}' 对应的字符为空,将跳过此类别。")
|
99 |
+
continue
|
100 |
+
|
101 |
+
class_id = num_classes # 分配从 0 开始的连续 ID
|
102 |
+
unicode_to_classid[unicode_key] = class_id
|
103 |
+
classid_to_char[class_id] = cleaned_char
|
104 |
+
num_classes += 1 # 只有成功添加了才增加类别计数
|
105 |
+
else:
|
106 |
+
#理论上这里不应该发生,因为 actual_unicode_keys 已经是过滤过的
|
107 |
+
print(f"内部错误:键 '{unicode_key}' 未在 char_dict_raw 中找到,尽管它在 actual_unicode_keys 中。")
|
108 |
+
|
109 |
+
if num_classes == 0:
|
110 |
+
print("错误:过滤后没有有效的类别。请检查文件夹名称、JSON内容和脚本逻辑。")
|
111 |
+
exit()
|
112 |
+
|
113 |
+
print(f"最终确定使用 {num_classes} 个有效类别进行处理。")
|
114 |
+
|
115 |
+
print("有效类别映射 (部分示例):")
|
116 |
+
# 打印前几个和后几个有效类别,检查是否正确
|
117 |
+
example_keys = list(unicode_to_classid.keys())
|
118 |
+
for i in range(min(5, num_classes)):
|
119 |
+
key = example_keys[i]
|
120 |
+
class_id = unicode_to_classid[key]
|
121 |
+
char = classid_to_char[class_id]
|
122 |
+
print(f" Class ID: {class_id}, Key: {key}, Character: '{char}'")
|
123 |
+
if num_classes > 10:
|
124 |
+
print(" ...")
|
125 |
+
for i in range(max(5, num_classes - 5), num_classes):
|
126 |
+
key = example_keys[i]
|
127 |
+
class_id = unicode_to_classid[key]
|
128 |
+
char = classid_to_char[class_id]
|
129 |
+
print(f" Class ID: {class_id}, Key: {key}, Character: '{char}'")
|
130 |
+
|
131 |
+
# --- 第 3 步扫描图像文件等)应该基于过滤后的 unicode_to_classid 工作 ---
|
132 |
+
#
|
133 |
+
|
134 |
+
|
135 |
+
|
136 |
+
# --- 3. 发现所有图像文件 ---
|
137 |
+
print("扫描图像文件...")
|
138 |
+
# all_image_paths: 存储所有找到的图像文件路径
|
139 |
+
# all_labels: 存储每个图像对应的类别ID (与all_image_paths一一对应)
|
140 |
+
all_image_paths = []
|
141 |
+
all_labels = []
|
142 |
+
|
143 |
+
# 支持常见的图像格式 (用于glob模式匹配)
|
144 |
+
image_extensions = ['*.jpg', '*.jpeg', '*.png', '*.bmp', '*.gif']
|
145 |
+
|
146 |
+
# --- 3.1 扫描数据目录 ---
|
147 |
+
print(f"正在扫描根目录: {data_root}")
|
148 |
+
# found_folders: 统计找到的文件夹总数
|
149 |
+
# processed_folders: 统计成功处理(有对应类别)的文件夹数
|
150 |
+
found_folders = 0
|
151 |
+
processed_folders = 0
|
152 |
+
|
153 |
+
# 显式列出data_root下的内容,帮助调试和验证
|
154 |
+
# 注意: 这里会列出所有文件和文件夹,但只有符合数字命名规则的文件夹会被处理
|
155 |
+
try:
|
156 |
+
root_contents = os.listdir(data_root)
|
157 |
+
print(f"在 {data_root} 中找到 {len(root_contents)} 个项目 (文件/文件夹)")
|
158 |
+
# print(f"前10个项目: {root_contents[:10]}") # 如果需要可以取消注释看具体名称
|
159 |
+
except FileNotFoundError:
|
160 |
+
print(f"错误:无法访问指定的 data_root 目录: {data_root}。请确保路径正确且程序有权限访问。")
|
161 |
+
exit()
|
162 |
+
except Exception as e:
|
163 |
+
print(f"访问目录 {data_root} 时发生未知错误: {e}")
|
164 |
+
exit()
|
165 |
+
|
166 |
+
|
167 |
+
# 遍历根目录下的所有项目(文件/文件夹)
|
168 |
+
# 使用tqdm显示进度条,desc参数设置进度条描述文本
|
169 |
+
for item_name in tqdm(root_contents, desc="扫描项目"):
|
170 |
+
item_path = os.path.join(data_root, item_name)
|
171 |
+
|
172 |
+
if os.path.isdir(item_path):
|
173 |
+
found_folders += 1
|
174 |
+
# 文件夹名称,例如 "00699"
|
175 |
+
unicode_index_folder_padded = item_name
|
176 |
+
|
177 |
+
try:
|
178 |
+
# 尝试将带前导零的文件夹名称转换为整数,再转回普通字符串(去除前导零)
|
179 |
+
# 例如 "00699" -> 699 -> "699"
|
180 |
+
unicode_index_int = int(unicode_index_folder_padded)
|
181 |
+
unicode_index_key = str(unicode_index_int)
|
182 |
+
|
183 |
+
# 使用转换后的 key (如 "699") 在字典中查找
|
184 |
+
if unicode_index_key in unicode_to_classid:
|
185 |
+
processed_folders += 1
|
186 |
+
class_id = unicode_to_classid[unicode_index_key]
|
187 |
+
image_count_in_folder = 0
|
188 |
+
for ext in image_extensions:
|
189 |
+
# 使用 glob 查找当前文件夹下所有匹配扩展名的图片
|
190 |
+
# 注意这里使用 item_path
|
191 |
+
folder_images = glob(os.path.join(item_path, ext))
|
192 |
+
for img_path in folder_images:
|
193 |
+
all_image_paths.append(img_path)
|
194 |
+
all_labels.append(class_id)
|
195 |
+
image_count_in_folder += 1
|
196 |
+
|
197 |
+
|
198 |
+
else:
|
199 |
+
# 如果转换后的 key 仍然找不到,显示警告 (只显示前几个)
|
200 |
+
if processed_folders < 5 and found_folders <= 20: # 控制警告数量
|
201 |
+
print(f"警告: 从文件夹名称 '{unicode_index_folder_padded}' 导出的键 '{unicode_index_key}' 在 Char_dict.json 中没有对应的条目,将跳过此文件夹。")
|
202 |
+
|
203 |
+
except ValueError:
|
204 |
+
# 如果文件夹名称不是纯数字 (例如可能是 .git, Thumbs.db 或其他非数据文件夹),则忽略
|
205 |
+
if found_folders <= 10: # 只显示前几个非数字文件夹警告
|
206 |
+
print(f"信息: 跳过非预期格式的文件夹/文件: '{unicode_index_folder_padded}'")
|
207 |
+
except Exception as e:
|
208 |
+
print(f"处理文件夹 {item_name} 时发生错误: {e}")
|
209 |
+
|
210 |
+
|
211 |
+
|
212 |
+
print(f"总共扫描了 {found_folders} 个文件夹。")
|
213 |
+
print(f"其中 {processed_folders} 个文件夹的名称与 Char_dict.json 中的键成功匹配。")
|
214 |
+
|
215 |
+
|
216 |
+
if not all_image_paths:
|
217 |
+
print(f"错误: 在目录 '{data_root}' 下及其与 JSON 匹配的子文件夹中,没有找到任何支持的图像文件。")
|
218 |
+
print(f"请再次检查:")
|
219 |
+
print(f"1. 路径 '{data_root}' 是否正确?")
|
220 |
+
print(f"2. 匹配的文件夹 (如 {processed_folders} 个) 中是否真的包含 {', '.join(image_extensions)} 格式的图片文件?")
|
221 |
+
print(f"3. 文件权限是否允许读取?")
|
222 |
+
exit()
|
223 |
+
|
224 |
+
print(f"总共找到 {len(all_image_paths)} 个图像文件。")
|
225 |
+
|
226 |
+
|
227 |
+
|
228 |
+
|
229 |
+
|
230 |
+
|
231 |
+
|
232 |
+
|
233 |
+
# --- 4. 划分数据集 ---
|
234 |
+
print("划分数据集 (Train/Validation/Test)...")
|
235 |
+
# 使用sklearn的train_test_split进行分层抽样划分,确保每个集合中的类别分布均衡
|
236 |
+
# 先分出测试集,再从剩余数据中分出验证集
|
237 |
+
# 确保标签列表是整数类型,并且图像和标签列表长度一致
|
238 |
+
assert len(all_image_paths) == len(all_labels)
|
239 |
+
labels_int = [int(label) for label in all_labels] # 确保是整数
|
240 |
+
|
241 |
+
# 第一次划分: 先分出测试集
|
242 |
+
# test_size: 测试集占总数据的比例
|
243 |
+
# stratify: 按标签分层抽样,保持类别分布
|
244 |
+
train_val_paths, test_paths, train_val_labels, test_labels = train_test_split(
|
245 |
+
all_image_paths,
|
246 |
+
labels_int,
|
247 |
+
test_size=test_size,
|
248 |
+
random_state=random_seed,
|
249 |
+
stratify=labels_int # 确保测试集中类别分布与总体相似
|
250 |
+
)
|
251 |
+
|
252 |
+
# 第二次划分: 从剩余数据(train_val)中分出验证集
|
253 |
+
# 计算验证集在剩余数据中的相对比例(relative_val_size)
|
254 |
+
# 例如: 总数据1000,test_size=0.15 → 测试集150,剩余850
|
255 |
+
# val_size=0.15 → 验证集应该是150/850 ≈ 0.1765
|
256 |
+
relative_val_size = val_size / (1.0 - test_size)
|
257 |
+
|
258 |
+
train_paths, val_paths, train_labels, val_labels = train_test_split(
|
259 |
+
train_val_paths,
|
260 |
+
train_val_labels,
|
261 |
+
test_size=relative_val_size,
|
262 |
+
random_state=random_seed, # 使用相同的随机种子确保可复现性(如果需要拆分独立)
|
263 |
+
stratify=train_val_labels # 确保验证集中类别分布与 (train+val) 相似
|
264 |
+
)
|
265 |
+
|
266 |
+
print(f"划分结果:")
|
267 |
+
print(f" 训练集: {len(train_paths)} 张图片")
|
268 |
+
print(f" 验证集: {len(val_paths)} 张图片")
|
269 |
+
print(f" 测试集: {len(test_paths)} 张图片")
|
270 |
+
|
271 |
+
# --- 5. 创建 YOLO 目录结构并处理文件 ---
|
272 |
+
print(f"创建 YOLO 格式数据集到 '{output_dir}'...")
|
273 |
+
|
274 |
+
# 定义数据集划分后的路径和标签
|
275 |
+
# 使用字典存储三个数据集(train/val/test)的路径和对应标签
|
276 |
+
sets = {
|
277 |
+
'train': (train_paths, train_labels),
|
278 |
+
'val': (val_paths, val_labels),
|
279 |
+
'test': (test_paths, test_labels)
|
280 |
+
}
|
281 |
+
|
282 |
+
if os.path.exists(output_dir):
|
283 |
+
print(f"警告: 输出目录 '{output_dir}' 已存在,将清空并重新创建。")
|
284 |
+
shutil.rmtree(output_dir)
|
285 |
+
|
286 |
+
# 创建目录结构
|
287 |
+
os.makedirs(os.path.join(output_dir, 'images', 'train'), exist_ok=True)
|
288 |
+
os.makedirs(os.path.join(output_dir, 'labels', 'train'), exist_ok=True)
|
289 |
+
os.makedirs(os.path.join(output_dir, 'images', 'val'), exist_ok=True)
|
290 |
+
os.makedirs(os.path.join(output_dir, 'labels', 'val'), exist_ok=True)
|
291 |
+
os.makedirs(os.path.join(output_dir, 'images', 'test'), exist_ok=True)
|
292 |
+
os.makedirs(os.path.join(output_dir, 'labels', 'test'), exist_ok=True)
|
293 |
+
|
294 |
+
# --- 5.1 处理文件:复制图像并创建标注文件 ---
|
295 |
+
# 对每个数据集(train/val/test)分别处理:
|
296 |
+
# 1. 复制图像文件到目标目录
|
297 |
+
# 2. 创建对应的YOLO格式标注文件(.txt)
|
298 |
+
# 3. 使用唯一文件名避免冲突(父文件夹名+原文件名)
|
299 |
+
for set_name, (paths, labels) in sets.items():
|
300 |
+
print(f"处理 {set_name} 集...")
|
301 |
+
image_dir = os.path.join(output_dir, 'images', set_name)
|
302 |
+
label_dir = os.path.join(output_dir, 'labels', set_name)
|
303 |
+
|
304 |
+
for img_path, class_id in tqdm(zip(paths, labels), total=len(paths), desc=f" 拷贝和生成标注 ({set_name})"):
|
305 |
+
# 文件名处理:
|
306 |
+
# 1. 获取原始文件名(带扩展名)
|
307 |
+
base_filename = os.path.basename(img_path)
|
308 |
+
# 2. 获取文件名(不带扩展名)
|
309 |
+
filename_no_ext = os.path.splitext(base_filename)[0]
|
310 |
+
|
311 |
+
# --- 生成唯一文件名 ---
|
312 |
+
# 由于不同文件夹下的图片可能有相同的文件名(如都叫 001.jpg),
|
313 |
+
# 需要确保目标目录中的文件名唯一。
|
314 |
+
# 解决方案: 使用"父文件夹名_原文件名"作为新文件名
|
315 |
+
# 例如: "00699_001.jpg" 和 "00700_001.jpg" 可以共存
|
316 |
+
parent_folder_name = os.path.basename(os.path.dirname(img_path))
|
317 |
+
unique_filename_no_ext = f"{parent_folder_name}_{filename_no_ext}"
|
318 |
+
unique_base_filename = f"{unique_filename_no_ext}{os.path.splitext(base_filename)[1]}"
|
319 |
+
|
320 |
+
# 目标图像路径
|
321 |
+
dest_img_path = os.path.join(image_dir, unique_base_filename)
|
322 |
+
# 目标标注文件路径
|
323 |
+
dest_label_path = os.path.join(label_dir, f"{unique_filename_no_ext}.txt")
|
324 |
+
|
325 |
+
# 1. 复制图像文件
|
326 |
+
try:
|
327 |
+
shutil.copy2(img_path, dest_img_path) # copy2 保留元数据
|
328 |
+
except Exception as e:
|
329 |
+
print(f"\n错误: 无法复制文件 {img_path} 到 {dest_img_path}. 错误: {e}")
|
330 |
+
continue # 跳过这个文件
|
331 |
+
|
332 |
+
# 2. 创建并写入标注文件 (使用假设的边界框)
|
333 |
+
annotation_line = f"{class_id} {bbox_annotation}\n"
|
334 |
+
try:
|
335 |
+
with open(dest_label_path, 'w', encoding='utf-8') as f_label:
|
336 |
+
f_label.write(annotation_line)
|
337 |
+
except Exception as e:
|
338 |
+
print(f"\n错误: 无法写入标注文件 {dest_label_path}. 错误: {e}")
|
339 |
+
# 如果写入失败,最��也把对应的图片删除,避免数据不一致
|
340 |
+
if os.path.exists(dest_img_path):
|
341 |
+
os.remove(dest_img_path)
|
342 |
+
|
343 |
+
# --- 6. 生成 dataset.yaml 文件 ---
|
344 |
+
# YOLO训练需要此配置文件,包含:
|
345 |
+
# - 数据集路径
|
346 |
+
# - 训练/验证/测试集路径
|
347 |
+
# - 类别数量和名称列表
|
348 |
+
print("生成 dataset.yaml...")
|
349 |
+
|
350 |
+
# 获取排序后的类别名称列表
|
351 |
+
class_names = [classid_to_char[i] for i in range(num_classes)]
|
352 |
+
|
353 |
+
# 创建 YAML 内容
|
354 |
+
# 路径可以是相对路径(相对于你运行训练脚本的位置)或绝对路径
|
355 |
+
# 这里使用相对路径,假设会在 yolo_hanzi_dataset 的上一级目录运行训练
|
356 |
+
yaml_content = f"""
|
357 |
+
# YOLOv11 dataset configuration file
|
358 |
+
|
359 |
+
# 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, ..]
|
360 |
+
path: {os.path.abspath(output_dir)} # dataset root dir (绝对路径通常更可靠)
|
361 |
+
train: images/train # train images (relative to 'path')
|
362 |
+
val: images/val # val images (relative to 'path')
|
363 |
+
test: images/test # test images (optional)
|
364 |
+
|
365 |
+
# Classes
|
366 |
+
nc: {num_classes} # number of classes
|
367 |
+
names: {json.dumps(class_names, ensure_ascii=False)} # Use json.dumps for proper list formatting and handling non-ASCII characters
|
368 |
+
|
369 |
+
""" # ensure_ascii=False 很重要,用于正确显示汉字
|
370 |
+
|
371 |
+
yaml_path = os.path.join(output_dir, 'dataset.yaml')
|
372 |
+
try:
|
373 |
+
with open(yaml_path, 'w', encoding='utf-8') as f_yaml:
|
374 |
+
f_yaml.write(yaml_content)
|
375 |
+
except Exception as e:
|
376 |
+
print(f"错误: 无法写入 dataset.yaml 文件到 {yaml_path}. 错误: {e}")
|
377 |
+
|
378 |
+
print("-" * 30)
|
379 |
+
print("数据集准备完成!")
|
380 |
+
print(f"YOLO 格式的数据集已生成在: {os.path.abspath(output_dir)}")
|
381 |
+
print(f"配置文件为: {os.path.abspath(yaml_path)}")
|
382 |
+
print("-" * 30)
|
383 |
+
print("重要提示:")
|
384 |
+
print("1. 每个图像只包含一个居中的汉字,并为其生成了覆盖整个图像的边界框。")
|
385 |
+
print("2. 检查 `dataset.yaml` 文件中的路径是否正确,特别是 `path` 字段。根据你的训练环境可能需要调整。")
|
386 |
+
print("3. 检查生成的 `labels` 文件夹中的 .txt 文件内容是否符合预期格式。")
|
387 |
+
print("4. 在开始训练前,建议随机抽查几个图片及其对应的标注文件,确保它们正确对应。")
|
388 |
+
print("5. 确保 `Char_dict.json` 中的汉字编码与你的系统或训练环境兼容。YAML 文件已使用 UTF-8 编码保存。")
|
389 |
+
print("-" * 30)
|
load_model.py
ADDED
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from ultralytics import YOLO
|
2 |
+
import torch
|
3 |
+
import os
|
4 |
+
from torch import nn
|
5 |
+
def load_model(model_path: str, device: str = None):#这是返回yolo对象的模型
|
6 |
+
try:
|
7 |
+
# 检查模型路径是否存在
|
8 |
+
if not os.path.isfile(model_path):
|
9 |
+
raise FileNotFoundError(f"模型文件错误,请修改加载路径: {model_path}")
|
10 |
+
|
11 |
+
# 自动选择设备为GPU
|
12 |
+
if device is None:
|
13 |
+
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
14 |
+
|
15 |
+
# 验证设备是否可用
|
16 |
+
if device == 'cuda' and not torch.cuda.is_available():
|
17 |
+
print("警告: CUDA不可用,将使用CPU")
|
18 |
+
device = 'cpu'
|
19 |
+
|
20 |
+
# 加载模型
|
21 |
+
model = YOLO(model_path).to(device)
|
22 |
+
print(f"成功加载模型到 {device.upper()}")
|
23 |
+
return model
|
24 |
+
|
25 |
+
except Exception as e:
|
26 |
+
raise RuntimeError(f"加载模型失败: {str(e)}")
|
27 |
+
|
28 |
+
|
29 |
+
|
30 |
+
|
31 |
+
# --------------------------------------------------
|
32 |
+
# load_pytorch_module (返回 torch.nn.Module)
|
33 |
+
# --------------------------------------------------
|
34 |
+
def load_pytorch_module(model_path: str, device: str = None) -> nn.Module:
|
35 |
+
"""
|
36 |
+
加载 Ultralytics YOLO 模型文件,并返回底层的 PyTorch nn.Module。
|
37 |
+
这个函数专门用于需要直接获取 torch.nn.Module 实例的场景;例如,检查或特定集成。
|
38 |
+
|
39 |
+
Returns:
|
40 |
+
torch.nn.Module: 底层的 PyTorch 模型实例。
|
41 |
+
"""
|
42 |
+
try:
|
43 |
+
# 检查模型路径是否存在
|
44 |
+
if not os.path.isfile(model_path):
|
45 |
+
raise FileNotFoundError(f"模型文件错误,请修改加载路径: {model_path}")
|
46 |
+
|
47 |
+
# 自动选择设备为GPU
|
48 |
+
if device is None:
|
49 |
+
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
50 |
+
|
51 |
+
# 验证设备是否可用
|
52 |
+
if device == 'cuda' and not torch.cuda.is_available():
|
53 |
+
print("警告: CUDA不可用,将使用CPU")
|
54 |
+
device = 'cpu'
|
55 |
+
|
56 |
+
# 1. 先加载 YOLO 对象
|
57 |
+
print(f"使用 YOLO 加载器加载: {model_path}")
|
58 |
+
yolo_wrapper = YOLO(model_path)
|
59 |
+
print("YOLO 加载器加载成功。")
|
60 |
+
|
61 |
+
# 2. 从 YOLO 对象中提取底层的 PyTorch 模型
|
62 |
+
# 通常,这个模型存储在 YOLO 对象的 .model 属性中
|
63 |
+
print("正在提取底层的 torch.nn.Module...")
|
64 |
+
pytorch_model = yolo_wrapper.model
|
65 |
+
if not isinstance(pytorch_model, nn.Module):
|
66 |
+
# 做个健壮性检查,以防未来 Ultralytics 内部结构改变
|
67 |
+
raise TypeError(f"从YOLO对象提取的 '.model' 属性不是 torch.nn.Module 的实例,实际类型为 {type(pytorch_model)}")
|
68 |
+
print(f"成功提取 PyTorch 模型,类型: {type(pytorch_model).__name__}")
|
69 |
+
|
70 |
+
# 3. 将提取出的 PyTorch 模型移动到指定设备
|
71 |
+
print(f"正在将 PyTorch 模型移动到 {device.upper()}...")
|
72 |
+
pytorch_model.to(device)
|
73 |
+
print(f"PyTorch 模型成功移动到 {device.upper()}")
|
74 |
+
|
75 |
+
# 4. 返回这个底层的 PyTorch 模型
|
76 |
+
return pytorch_model
|
77 |
+
|
78 |
+
except Exception as e:
|
79 |
+
raise RuntimeError(f"加载底层 PyTorch 模型失败: {str(e)}")
|
80 |
+
|
81 |
+
|
82 |
+
if __name__ == "__main__":
|
83 |
+
model_path = "best_model.pt"
|
84 |
+
device = "cpu"
|
85 |
+
model = load_pytorch_module(model_path, device)
|
86 |
+
model_yolo=load_model(model_path, device)
|
87 |
+
print('原始的torch模型:',model)
|
88 |
+
|
89 |
+
print('加载yolo模型:',model_yolo)
|
predict.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from ultralytics import YOLO
|
2 |
+
import cv2
|
3 |
+
from load_model import load_model
|
4 |
+
#对单张图片进行预测
|
5 |
+
def predict(model,image_path):
|
6 |
+
image = cv2.imread(image_path)#加载图片
|
7 |
+
model = load_model(model)#加载yolo模型
|
8 |
+
results = model.predict(source=image,
|
9 |
+
save=True, # 保存预测结果
|
10 |
+
show=True, # 显示预测结果
|
11 |
+
conf=0.5) # 置信度阈值
|
12 |
+
# 4. 打印预测结果
|
13 |
+
for result in results:
|
14 |
+
print("检测到的对象:")
|
15 |
+
for box in result.boxes:
|
16 |
+
print(f"- 类别: {result.names[box.cls[0].item()]}, 置信度: {box.conf[0].item():.2f}")
|
17 |
+
|
18 |
+
if __name__ == '__main__':
|
19 |
+
predict(r'runs\detect\train9\weights\best.pt',r'..\yolo_hanzi_dataset\images\test\00800_243401.png')
|
requirements.txt
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
ultralytics>=8.0.0
|
2 |
+
opencv-python>=4.5.0
|
3 |
+
scikit-learn>=1.0.0
|
4 |
+
tqdm>=4.0.0
|
5 |
+
numpy>=1.20.0
|
test.py
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from load_model import load_model
|
2 |
+
#测试集测试代码
|
3 |
+
def test(model,data_path):
|
4 |
+
model=load_model(model)#加载测试的yolo模型
|
5 |
+
test_results=model.val(data=data_path, split='test',plots=True,save=True) # 只在最终评估时使用测试集
|
6 |
+
print(f"测试集[email protected]: {test_results.box.map50:.3f}")
|
7 |
+
print(f"测试集[email protected]:0.95: {test_results.box.map:.3f}")
|
8 |
+
|
9 |
+
if __name__ == '__main__':
|
10 |
+
test(r'runs\detect\train9\weights\best.pt',r'..\yolo_hanzi_dataset\dataset.yaml')
|
train.py
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import warnings
|
2 |
+
warnings.filterwarnings('ignore')
|
3 |
+
from load_model import load_model
|
4 |
+
def train(base_model,data_path,cfg_path):
|
5 |
+
model = load_model(base_model)#这里直接加载yolo模型训练
|
6 |
+
model.train(data=data_path,#配置数据集的配置文件
|
7 |
+
cfg=cfg_path#数据增强、优化器、周期、模型保存、超参数等配置文件
|
8 |
+
)
|
9 |
+
|
10 |
+
if __name__ == '__main__':
|
11 |
+
train(r"yolo11n.pt",
|
12 |
+
r'..\yolo_hanzi_dataset\dataset.yaml',
|
13 |
+
r'ultralytics\cfg\default.yaml')
|
14 |
+
|
ultralytics/cfg/__init__.py
ADDED
@@ -0,0 +1,1029 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
import shutil
|
4 |
+
import subprocess
|
5 |
+
import sys
|
6 |
+
from pathlib import Path
|
7 |
+
from types import SimpleNamespace
|
8 |
+
from typing import Any, Dict, List, Union
|
9 |
+
|
10 |
+
import cv2
|
11 |
+
|
12 |
+
from ultralytics.utils import (
|
13 |
+
ASSETS,
|
14 |
+
DEFAULT_CFG,
|
15 |
+
DEFAULT_CFG_DICT,
|
16 |
+
DEFAULT_CFG_PATH,
|
17 |
+
DEFAULT_SOL_DICT,
|
18 |
+
IS_VSCODE,
|
19 |
+
LOGGER,
|
20 |
+
RANK,
|
21 |
+
ROOT,
|
22 |
+
RUNS_DIR,
|
23 |
+
SETTINGS,
|
24 |
+
SETTINGS_FILE,
|
25 |
+
TESTS_RUNNING,
|
26 |
+
IterableSimpleNamespace,
|
27 |
+
__version__,
|
28 |
+
checks,
|
29 |
+
colorstr,
|
30 |
+
deprecation_warn,
|
31 |
+
vscode_msg,
|
32 |
+
yaml_load,
|
33 |
+
yaml_print,
|
34 |
+
)
|
35 |
+
|
36 |
+
# Define valid solutions
|
37 |
+
SOLUTION_MAP = {
|
38 |
+
"count": "ObjectCounter",
|
39 |
+
"crop": "ObjectCropper",
|
40 |
+
"blur": "ObjectBlurrer",
|
41 |
+
"workout": "AIGym",
|
42 |
+
"heatmap": "Heatmap",
|
43 |
+
"isegment": "InstanceSegmentation",
|
44 |
+
"visioneye": "VisionEye",
|
45 |
+
"speed": "SpeedEstimator",
|
46 |
+
"queue": "QueueManager",
|
47 |
+
"analytics": "Analytics",
|
48 |
+
"inference": "Inference",
|
49 |
+
"trackzone": "TrackZone",
|
50 |
+
"help": None,
|
51 |
+
}
|
52 |
+
|
53 |
+
# Define valid tasks and modes
|
54 |
+
MODES = frozenset({"train", "val", "predict", "export", "track", "benchmark"})
|
55 |
+
TASKS = frozenset({"detect", "segment", "classify", "pose", "obb"})
|
56 |
+
TASK2DATA = {
|
57 |
+
"detect": "coco8.yaml",
|
58 |
+
"segment": "coco8-seg.yaml",
|
59 |
+
"classify": "imagenet10",
|
60 |
+
"pose": "coco8-pose.yaml",
|
61 |
+
"obb": "dota8.yaml",
|
62 |
+
}
|
63 |
+
TASK2MODEL = {
|
64 |
+
"detect": "yolo11n.pt",
|
65 |
+
"segment": "yolo11n-seg.pt",
|
66 |
+
"classify": "yolo11n-cls.pt",
|
67 |
+
"pose": "yolo11n-pose.pt",
|
68 |
+
"obb": "yolo11n-obb.pt",
|
69 |
+
}
|
70 |
+
TASK2METRIC = {
|
71 |
+
"detect": "metrics/mAP50-95(B)",
|
72 |
+
"segment": "metrics/mAP50-95(M)",
|
73 |
+
"classify": "metrics/accuracy_top1",
|
74 |
+
"pose": "metrics/mAP50-95(P)",
|
75 |
+
"obb": "metrics/mAP50-95(B)",
|
76 |
+
}
|
77 |
+
MODELS = frozenset({TASK2MODEL[task] for task in TASKS})
|
78 |
+
|
79 |
+
ARGV = sys.argv or ["", ""] # sometimes sys.argv = []
|
80 |
+
SOLUTIONS_HELP_MSG = f"""
|
81 |
+
Arguments received: {str(["yolo"] + ARGV[1:])}. Ultralytics 'yolo solutions' usage overview:
|
82 |
+
|
83 |
+
yolo solutions SOLUTION ARGS
|
84 |
+
|
85 |
+
Where SOLUTION (optional) is one of {list(SOLUTION_MAP.keys())[:-1]}
|
86 |
+
ARGS (optional) are any number of custom 'arg=value' pairs like 'show_in=True' that override defaults
|
87 |
+
at https://docs.ultralytics.com/usage/cfg
|
88 |
+
|
89 |
+
1. Call object counting solution
|
90 |
+
yolo solutions count source="path/to/video.mp4" region="[(20, 400), (1080, 400), (1080, 360), (20, 360)]"
|
91 |
+
|
92 |
+
2. Call heatmaps solution
|
93 |
+
yolo solutions heatmap colormap=cv2.COLORMAP_PARULA model=yolo11n.pt
|
94 |
+
|
95 |
+
3. Call queue management solution
|
96 |
+
yolo solutions queue region="[(20, 400), (1080, 400), (1080, 360), (20, 360)]" model=yolo11n.pt
|
97 |
+
|
98 |
+
4. Call workouts monitoring solution for push-ups
|
99 |
+
yolo solutions workout model=yolo11n-pose.pt kpts=[6, 8, 10]
|
100 |
+
|
101 |
+
5. Generate analytical graphs
|
102 |
+
yolo solutions analytics analytics_type="pie"
|
103 |
+
|
104 |
+
6. Track objects within specific zones
|
105 |
+
yolo solutions trackzone source="path/to/video.mp4" region="[(150, 150), (1130, 150), (1130, 570), (150, 570)]"
|
106 |
+
|
107 |
+
7. Streamlit real-time webcam inference GUI
|
108 |
+
yolo streamlit-predict
|
109 |
+
"""
|
110 |
+
CLI_HELP_MSG = f"""
|
111 |
+
Arguments received: {str(["yolo"] + ARGV[1:])}. Ultralytics 'yolo' commands use the following syntax:
|
112 |
+
|
113 |
+
yolo TASK MODE ARGS
|
114 |
+
|
115 |
+
Where TASK (optional) is one of {TASKS}
|
116 |
+
MODE (required) is one of {MODES}
|
117 |
+
ARGS (optional) are any number of custom 'arg=value' pairs like 'imgsz=320' that override defaults.
|
118 |
+
See all ARGS at https://docs.ultralytics.com/usage/cfg or with 'yolo cfg'
|
119 |
+
|
120 |
+
1. Train a detection model for 10 epochs with an initial learning_rate of 0.01
|
121 |
+
yolo train data=coco8.yaml model=yolo11n.pt epochs=10 lr0=0.01
|
122 |
+
|
123 |
+
2. Predict a YouTube video using a pretrained segmentation model at image size 320:
|
124 |
+
yolo predict model=yolo11n-seg.pt source='https://youtu.be/LNwODJXcvt4' imgsz=320
|
125 |
+
|
126 |
+
3. Val a pretrained detection model at batch-size 1 and image size 640:
|
127 |
+
yolo val model=yolo11n.pt data=coco8.yaml batch=1 imgsz=640
|
128 |
+
|
129 |
+
4. Export a YOLO11n classification model to ONNX format at image size 224 by 128 (no TASK required)
|
130 |
+
yolo export model=yolo11n-cls.pt format=onnx imgsz=224,128
|
131 |
+
|
132 |
+
5. Ultralytics solutions usage
|
133 |
+
yolo solutions count or in {list(SOLUTION_MAP.keys())[1:-1]} source="path/to/video.mp4"
|
134 |
+
|
135 |
+
6. Run special commands:
|
136 |
+
yolo help
|
137 |
+
yolo checks
|
138 |
+
yolo version
|
139 |
+
yolo settings
|
140 |
+
yolo copy-cfg
|
141 |
+
yolo cfg
|
142 |
+
yolo solutions help
|
143 |
+
|
144 |
+
Docs: https://docs.ultralytics.com
|
145 |
+
Solutions: https://docs.ultralytics.com/solutions/
|
146 |
+
Community: https://community.ultralytics.com
|
147 |
+
GitHub: https://github.com/ultralytics/ultralytics
|
148 |
+
"""
|
149 |
+
|
150 |
+
# Define keys for arg type checks
|
151 |
+
CFG_FLOAT_KEYS = frozenset(
|
152 |
+
{ # integer or float arguments, i.e. x=2 and x=2.0
|
153 |
+
"warmup_epochs",
|
154 |
+
"box",
|
155 |
+
"cls",
|
156 |
+
"dfl",
|
157 |
+
"degrees",
|
158 |
+
"shear",
|
159 |
+
"time",
|
160 |
+
"workspace",
|
161 |
+
"batch",
|
162 |
+
}
|
163 |
+
)
|
164 |
+
CFG_FRACTION_KEYS = frozenset(
|
165 |
+
{ # fractional float arguments with 0.0<=values<=1.0
|
166 |
+
"dropout",
|
167 |
+
"lr0",
|
168 |
+
"lrf",
|
169 |
+
"momentum",
|
170 |
+
"weight_decay",
|
171 |
+
"warmup_momentum",
|
172 |
+
"warmup_bias_lr",
|
173 |
+
"hsv_h",
|
174 |
+
"hsv_s",
|
175 |
+
"hsv_v",
|
176 |
+
"translate",
|
177 |
+
"scale",
|
178 |
+
"perspective",
|
179 |
+
"flipud",
|
180 |
+
"fliplr",
|
181 |
+
"bgr",
|
182 |
+
"mosaic",
|
183 |
+
"mixup",
|
184 |
+
"copy_paste",
|
185 |
+
"conf",
|
186 |
+
"iou",
|
187 |
+
"fraction",
|
188 |
+
}
|
189 |
+
)
|
190 |
+
CFG_INT_KEYS = frozenset(
|
191 |
+
{ # integer-only arguments
|
192 |
+
"epochs",
|
193 |
+
"patience",
|
194 |
+
"workers",
|
195 |
+
"seed",
|
196 |
+
"close_mosaic",
|
197 |
+
"mask_ratio",
|
198 |
+
"max_det",
|
199 |
+
"vid_stride",
|
200 |
+
"line_width",
|
201 |
+
"nbs",
|
202 |
+
"save_period",
|
203 |
+
}
|
204 |
+
)
|
205 |
+
CFG_BOOL_KEYS = frozenset(
|
206 |
+
{ # boolean-only arguments
|
207 |
+
"save",
|
208 |
+
"exist_ok",
|
209 |
+
"verbose",
|
210 |
+
"deterministic",
|
211 |
+
"single_cls",
|
212 |
+
"rect",
|
213 |
+
"cos_lr",
|
214 |
+
"overlap_mask",
|
215 |
+
"val",
|
216 |
+
"save_json",
|
217 |
+
"save_hybrid",
|
218 |
+
"half",
|
219 |
+
"dnn",
|
220 |
+
"plots",
|
221 |
+
"show",
|
222 |
+
"save_txt",
|
223 |
+
"save_conf",
|
224 |
+
"save_crop",
|
225 |
+
"save_frames",
|
226 |
+
"show_labels",
|
227 |
+
"show_conf",
|
228 |
+
"visualize",
|
229 |
+
"augment",
|
230 |
+
"agnostic_nms",
|
231 |
+
"retina_masks",
|
232 |
+
"show_boxes",
|
233 |
+
"keras",
|
234 |
+
"optimize",
|
235 |
+
"int8",
|
236 |
+
"dynamic",
|
237 |
+
"simplify",
|
238 |
+
"nms",
|
239 |
+
"profile",
|
240 |
+
"multi_scale",
|
241 |
+
}
|
242 |
+
)
|
243 |
+
|
244 |
+
|
245 |
+
def cfg2dict(cfg: Union[str, Path, Dict, SimpleNamespace]) -> Dict:
|
246 |
+
"""
|
247 |
+
Converts a configuration object to a dictionary.
|
248 |
+
|
249 |
+
Args:
|
250 |
+
cfg (str | Path | Dict | SimpleNamespace): Configuration object to be converted. Can be a file path,
|
251 |
+
a string, a dictionary, or a SimpleNamespace object.
|
252 |
+
|
253 |
+
Returns:
|
254 |
+
(dict): Configuration object in dictionary format.
|
255 |
+
|
256 |
+
Examples:
|
257 |
+
Convert a YAML file path to a dictionary:
|
258 |
+
>>> config_dict = cfg2dict("config.yaml")
|
259 |
+
|
260 |
+
Convert a SimpleNamespace to a dictionary:
|
261 |
+
>>> from types import SimpleNamespace
|
262 |
+
>>> config_sn = SimpleNamespace(param1="value1", param2="value2")
|
263 |
+
>>> config_dict = cfg2dict(config_sn)
|
264 |
+
|
265 |
+
Pass through an already existing dictionary:
|
266 |
+
>>> config_dict = cfg2dict({"param1": "value1", "param2": "value2"})
|
267 |
+
|
268 |
+
Notes:
|
269 |
+
- If cfg is a path or string, it's loaded as YAML and converted to a dictionary.
|
270 |
+
- If cfg is a SimpleNamespace object, it's converted to a dictionary using vars().
|
271 |
+
- If cfg is already a dictionary, it's returned unchanged.
|
272 |
+
"""
|
273 |
+
if isinstance(cfg, (str, Path)):
|
274 |
+
cfg = yaml_load(cfg) # load dict
|
275 |
+
elif isinstance(cfg, SimpleNamespace):
|
276 |
+
cfg = vars(cfg) # convert to dict
|
277 |
+
return cfg
|
278 |
+
|
279 |
+
|
280 |
+
def get_cfg(cfg: Union[str, Path, Dict, SimpleNamespace] = DEFAULT_CFG_DICT, overrides: Dict = None) -> SimpleNamespace:
|
281 |
+
"""
|
282 |
+
Load and merge configuration data from a file or dictionary, with optional overrides.
|
283 |
+
|
284 |
+
Args:
|
285 |
+
cfg (str | Path | Dict | SimpleNamespace): Configuration data source. Can be a file path, dictionary, or
|
286 |
+
SimpleNamespace object.
|
287 |
+
overrides (Dict | None): Dictionary containing key-value pairs to override the base configuration.
|
288 |
+
|
289 |
+
Returns:
|
290 |
+
(SimpleNamespace): Namespace containing the merged configuration arguments.
|
291 |
+
|
292 |
+
Examples:
|
293 |
+
>>> from ultralytics.cfg import get_cfg
|
294 |
+
>>> config = get_cfg() # Load default configuration
|
295 |
+
>>> config_with_overrides = get_cfg("path/to/config.yaml", overrides={"epochs": 50, "batch_size": 16})
|
296 |
+
|
297 |
+
Notes:
|
298 |
+
- If both `cfg` and `overrides` are provided, the values in `overrides` will take precedence.
|
299 |
+
- Special handling ensures alignment and correctness of the configuration, such as converting numeric
|
300 |
+
`project` and `name` to strings and validating configuration keys and values.
|
301 |
+
- The function performs type and value checks on the configuration data.
|
302 |
+
"""
|
303 |
+
cfg = cfg2dict(cfg)
|
304 |
+
|
305 |
+
# Merge overrides
|
306 |
+
if overrides:
|
307 |
+
overrides = cfg2dict(overrides)
|
308 |
+
if "save_dir" not in cfg:
|
309 |
+
overrides.pop("save_dir", None) # special override keys to ignore
|
310 |
+
check_dict_alignment(cfg, overrides)
|
311 |
+
cfg = {**cfg, **overrides} # merge cfg and overrides dicts (prefer overrides)
|
312 |
+
|
313 |
+
# Special handling for numeric project/name
|
314 |
+
for k in "project", "name":
|
315 |
+
if k in cfg and isinstance(cfg[k], (int, float)):
|
316 |
+
cfg[k] = str(cfg[k])
|
317 |
+
if cfg.get("name") == "model": # assign model to 'name' arg
|
318 |
+
cfg["name"] = str(cfg.get("model", "")).split(".")[0]
|
319 |
+
LOGGER.warning(f"WARNING ⚠️ 'name=model' automatically updated to 'name={cfg['name']}'.")
|
320 |
+
|
321 |
+
# Type and Value checks
|
322 |
+
check_cfg(cfg)
|
323 |
+
|
324 |
+
# Return instance
|
325 |
+
return IterableSimpleNamespace(**cfg)
|
326 |
+
|
327 |
+
|
328 |
+
def check_cfg(cfg: Dict, hard: bool = True) -> None:
|
329 |
+
"""
|
330 |
+
Checks configuration argument types and values for the Ultralytics library.
|
331 |
+
|
332 |
+
This function validates the types and values of configuration arguments, ensuring correctness and converting
|
333 |
+
them if necessary. It checks for specific key types defined in global variables such as `CFG_FLOAT_KEYS`,
|
334 |
+
`CFG_FRACTION_KEYS`, `CFG_INT_KEYS`, and `CFG_BOOL_KEYS`.
|
335 |
+
|
336 |
+
Args:
|
337 |
+
cfg (dict): Configuration dictionary to validate.
|
338 |
+
hard (bool): If True, raises exceptions for invalid types and values; if False, attempts to convert them.
|
339 |
+
|
340 |
+
Examples:
|
341 |
+
>>> config = {
|
342 |
+
... "epochs": 50, # valid integer
|
343 |
+
... "lr0": 0.01, # valid float
|
344 |
+
... "momentum": 1.2, # invalid float (out of 0.0-1.0 range)
|
345 |
+
... "save": "true", # invalid bool
|
346 |
+
... }
|
347 |
+
>>> check_cfg(config, hard=False)
|
348 |
+
>>> print(config)
|
349 |
+
{'epochs': 50, 'lr0': 0.01, 'momentum': 1.2, 'save': False} # corrected 'save' key
|
350 |
+
|
351 |
+
Notes:
|
352 |
+
- The function modifies the input dictionary in-place.
|
353 |
+
- None values are ignored as they may be from optional arguments.
|
354 |
+
- Fraction keys are checked to be within the range [0.0, 1.0].
|
355 |
+
"""
|
356 |
+
for k, v in cfg.items():
|
357 |
+
if v is not None: # None values may be from optional args
|
358 |
+
if k in CFG_FLOAT_KEYS and not isinstance(v, (int, float)):
|
359 |
+
if hard:
|
360 |
+
raise TypeError(
|
361 |
+
f"'{k}={v}' is of invalid type {type(v).__name__}. "
|
362 |
+
f"Valid '{k}' types are int (i.e. '{k}=0') or float (i.e. '{k}=0.5')"
|
363 |
+
)
|
364 |
+
cfg[k] = float(v)
|
365 |
+
elif k in CFG_FRACTION_KEYS:
|
366 |
+
if not isinstance(v, (int, float)):
|
367 |
+
if hard:
|
368 |
+
raise TypeError(
|
369 |
+
f"'{k}={v}' is of invalid type {type(v).__name__}. "
|
370 |
+
f"Valid '{k}' types are int (i.e. '{k}=0') or float (i.e. '{k}=0.5')"
|
371 |
+
)
|
372 |
+
cfg[k] = v = float(v)
|
373 |
+
if not (0.0 <= v <= 1.0):
|
374 |
+
raise ValueError(f"'{k}={v}' is an invalid value. Valid '{k}' values are between 0.0 and 1.0.")
|
375 |
+
elif k in CFG_INT_KEYS and not isinstance(v, int):
|
376 |
+
if hard:
|
377 |
+
raise TypeError(
|
378 |
+
f"'{k}={v}' is of invalid type {type(v).__name__}. '{k}' must be an int (i.e. '{k}=8')"
|
379 |
+
)
|
380 |
+
cfg[k] = int(v)
|
381 |
+
elif k in CFG_BOOL_KEYS and not isinstance(v, bool):
|
382 |
+
if hard:
|
383 |
+
raise TypeError(
|
384 |
+
f"'{k}={v}' is of invalid type {type(v).__name__}. "
|
385 |
+
f"'{k}' must be a bool (i.e. '{k}=True' or '{k}=False')"
|
386 |
+
)
|
387 |
+
cfg[k] = bool(v)
|
388 |
+
|
389 |
+
|
390 |
+
def get_save_dir(args: SimpleNamespace, name: str = None) -> Path:
|
391 |
+
"""
|
392 |
+
Returns the directory path for saving outputs, derived from arguments or default settings.
|
393 |
+
|
394 |
+
Args:
|
395 |
+
args (SimpleNamespace): Namespace object containing configurations such as 'project', 'name', 'task',
|
396 |
+
'mode', and 'save_dir'.
|
397 |
+
name (str | None): Optional name for the output directory. If not provided, it defaults to 'args.name'
|
398 |
+
or the 'args.mode'.
|
399 |
+
|
400 |
+
Returns:
|
401 |
+
(Path): Directory path where outputs should be saved.
|
402 |
+
|
403 |
+
Examples:
|
404 |
+
>>> from types import SimpleNamespace
|
405 |
+
>>> args = SimpleNamespace(project="my_project", task="detect", mode="train", exist_ok=True)
|
406 |
+
>>> save_dir = get_save_dir(args)
|
407 |
+
>>> print(save_dir)
|
408 |
+
my_project/detect/train
|
409 |
+
"""
|
410 |
+
if getattr(args, "save_dir", None):
|
411 |
+
save_dir = args.save_dir
|
412 |
+
else:
|
413 |
+
from ultralytics.utils.files import increment_path
|
414 |
+
|
415 |
+
project = args.project or (ROOT.parent / "tests/tmp/runs" if TESTS_RUNNING else RUNS_DIR) / args.task
|
416 |
+
name = name or args.name or f"{args.mode}"
|
417 |
+
save_dir = increment_path(Path(project) / name, exist_ok=args.exist_ok if RANK in {-1, 0} else True)
|
418 |
+
|
419 |
+
return Path(save_dir)
|
420 |
+
|
421 |
+
|
422 |
+
def _handle_deprecation(custom: Dict) -> Dict:
|
423 |
+
"""
|
424 |
+
Handles deprecated configuration keys by mapping them to current equivalents with deprecation warnings.
|
425 |
+
|
426 |
+
Args:
|
427 |
+
custom (dict): Configuration dictionary potentially containing deprecated keys.
|
428 |
+
|
429 |
+
Examples:
|
430 |
+
>>> custom_config = {"boxes": True, "hide_labels": "False", "line_thickness": 2}
|
431 |
+
>>> _handle_deprecation(custom_config)
|
432 |
+
>>> print(custom_config)
|
433 |
+
{'show_boxes': True, 'show_labels': True, 'line_width': 2}
|
434 |
+
|
435 |
+
Notes:
|
436 |
+
This function modifies the input dictionary in-place, replacing deprecated keys with their current
|
437 |
+
equivalents. It also handles value conversions where necessary, such as inverting boolean values for
|
438 |
+
'hide_labels' and 'hide_conf'.
|
439 |
+
"""
|
440 |
+
for key in custom.copy().keys():
|
441 |
+
if key == "boxes":
|
442 |
+
deprecation_warn(key, "show_boxes")
|
443 |
+
custom["show_boxes"] = custom.pop("boxes")
|
444 |
+
if key == "hide_labels":
|
445 |
+
deprecation_warn(key, "show_labels")
|
446 |
+
custom["show_labels"] = custom.pop("hide_labels") == "False"
|
447 |
+
if key == "hide_conf":
|
448 |
+
deprecation_warn(key, "show_conf")
|
449 |
+
custom["show_conf"] = custom.pop("hide_conf") == "False"
|
450 |
+
if key == "line_thickness":
|
451 |
+
deprecation_warn(key, "line_width")
|
452 |
+
custom["line_width"] = custom.pop("line_thickness")
|
453 |
+
if key == "label_smoothing":
|
454 |
+
deprecation_warn(key)
|
455 |
+
custom.pop("label_smoothing")
|
456 |
+
|
457 |
+
return custom
|
458 |
+
|
459 |
+
|
460 |
+
def check_dict_alignment(base: Dict, custom: Dict, e: Exception = None) -> None:
|
461 |
+
"""
|
462 |
+
Checks alignment between custom and base configuration dictionaries, handling deprecated keys and providing error
|
463 |
+
messages for mismatched keys.
|
464 |
+
|
465 |
+
Args:
|
466 |
+
base (dict): The base configuration dictionary containing valid keys.
|
467 |
+
custom (dict): The custom configuration dictionary to be checked for alignment.
|
468 |
+
e (Exception | None): Optional error instance passed by the calling function.
|
469 |
+
|
470 |
+
Raises:
|
471 |
+
SystemExit: If mismatched keys are found between the custom and base dictionaries.
|
472 |
+
|
473 |
+
Examples:
|
474 |
+
>>> base_cfg = {"epochs": 50, "lr0": 0.01, "batch_size": 16}
|
475 |
+
>>> custom_cfg = {"epoch": 100, "lr": 0.02, "batch_size": 32}
|
476 |
+
>>> try:
|
477 |
+
... check_dict_alignment(base_cfg, custom_cfg)
|
478 |
+
... except SystemExit:
|
479 |
+
... print("Mismatched keys found")
|
480 |
+
|
481 |
+
Notes:
|
482 |
+
- Suggests corrections for mismatched keys based on similarity to valid keys.
|
483 |
+
- Automatically replaces deprecated keys in the custom configuration with updated equivalents.
|
484 |
+
- Prints detailed error messages for each mismatched key to help users correct their configurations.
|
485 |
+
"""
|
486 |
+
custom = _handle_deprecation(custom)
|
487 |
+
base_keys, custom_keys = (frozenset(x.keys()) for x in (base, custom))
|
488 |
+
if mismatched := [k for k in custom_keys if k not in base_keys]:
|
489 |
+
from difflib import get_close_matches
|
490 |
+
|
491 |
+
string = ""
|
492 |
+
for x in mismatched:
|
493 |
+
matches = get_close_matches(x, base_keys) # key list
|
494 |
+
matches = [f"{k}={base[k]}" if base.get(k) is not None else k for k in matches]
|
495 |
+
match_str = f"Similar arguments are i.e. {matches}." if matches else ""
|
496 |
+
string += f"'{colorstr('red', 'bold', x)}' is not a valid YOLO argument. {match_str}\n"
|
497 |
+
raise SyntaxError(string + CLI_HELP_MSG) from e
|
498 |
+
|
499 |
+
|
500 |
+
def merge_equals_args(args: List[str]) -> List[str]:
|
501 |
+
"""
|
502 |
+
Merges arguments around isolated '=' in a list of strings and joins fragments with brackets.
|
503 |
+
|
504 |
+
This function handles the following cases:
|
505 |
+
1. ['arg', '=', 'val'] becomes ['arg=val']
|
506 |
+
2. ['arg=', 'val'] becomes ['arg=val']
|
507 |
+
3. ['arg', '=val'] becomes ['arg=val']
|
508 |
+
4. Joins fragments with brackets, e.g., ['imgsz=[3,', '640,', '640]'] becomes ['imgsz=[3,640,640]']
|
509 |
+
|
510 |
+
Args:
|
511 |
+
args (List[str]): A list of strings where each element represents an argument or fragment.
|
512 |
+
|
513 |
+
Returns:
|
514 |
+
(List[str]): A list of strings where the arguments around isolated '=' are merged and fragments with brackets are joined.
|
515 |
+
|
516 |
+
Examples:
|
517 |
+
>>> args = ["arg1", "=", "value", "arg2=", "value2", "arg3", "=value3", "imgsz=[3,", "640,", "640]"]
|
518 |
+
>>> merge_equals_args(args)
|
519 |
+
['arg1=value', 'arg2=value2', 'arg3=value3', 'imgsz=[3,640,640]']
|
520 |
+
"""
|
521 |
+
new_args = []
|
522 |
+
current = ""
|
523 |
+
depth = 0
|
524 |
+
|
525 |
+
i = 0
|
526 |
+
while i < len(args):
|
527 |
+
arg = args[i]
|
528 |
+
|
529 |
+
# Handle equals sign merging
|
530 |
+
if arg == "=" and 0 < i < len(args) - 1: # merge ['arg', '=', 'val']
|
531 |
+
new_args[-1] += f"={args[i + 1]}"
|
532 |
+
i += 2
|
533 |
+
continue
|
534 |
+
elif arg.endswith("=") and i < len(args) - 1 and "=" not in args[i + 1]: # merge ['arg=', 'val']
|
535 |
+
new_args.append(f"{arg}{args[i + 1]}")
|
536 |
+
i += 2
|
537 |
+
continue
|
538 |
+
elif arg.startswith("=") and i > 0: # merge ['arg', '=val']
|
539 |
+
new_args[-1] += arg
|
540 |
+
i += 1
|
541 |
+
continue
|
542 |
+
|
543 |
+
# Handle bracket joining
|
544 |
+
depth += arg.count("[") - arg.count("]")
|
545 |
+
current += arg
|
546 |
+
if depth == 0:
|
547 |
+
new_args.append(current)
|
548 |
+
current = ""
|
549 |
+
|
550 |
+
i += 1
|
551 |
+
|
552 |
+
# Append any remaining current string
|
553 |
+
if current:
|
554 |
+
new_args.append(current)
|
555 |
+
|
556 |
+
return new_args
|
557 |
+
|
558 |
+
|
559 |
+
def handle_yolo_hub(args: List[str]) -> None:
|
560 |
+
"""
|
561 |
+
Handles Ultralytics HUB command-line interface (CLI) commands for authentication.
|
562 |
+
|
563 |
+
This function processes Ultralytics HUB CLI commands such as login and logout. It should be called when executing a
|
564 |
+
script with arguments related to HUB authentication.
|
565 |
+
|
566 |
+
Args:
|
567 |
+
args (List[str]): A list of command line arguments. The first argument should be either 'login'
|
568 |
+
or 'logout'. For 'login', an optional second argument can be the API key.
|
569 |
+
|
570 |
+
Examples:
|
571 |
+
```bash
|
572 |
+
yolo login YOUR_API_KEY
|
573 |
+
```
|
574 |
+
|
575 |
+
Notes:
|
576 |
+
- The function imports the 'hub' module from ultralytics to perform login and logout operations.
|
577 |
+
- For the 'login' command, if no API key is provided, an empty string is passed to the login function.
|
578 |
+
- The 'logout' command does not require any additional arguments.
|
579 |
+
"""
|
580 |
+
from ultralytics import hub
|
581 |
+
|
582 |
+
if args[0] == "login":
|
583 |
+
key = args[1] if len(args) > 1 else ""
|
584 |
+
# Log in to Ultralytics HUB using the provided API key
|
585 |
+
hub.login(key)
|
586 |
+
elif args[0] == "logout":
|
587 |
+
# Log out from Ultralytics HUB
|
588 |
+
hub.logout()
|
589 |
+
|
590 |
+
|
591 |
+
def handle_yolo_settings(args: List[str]) -> None:
|
592 |
+
"""
|
593 |
+
Handles YOLO settings command-line interface (CLI) commands.
|
594 |
+
|
595 |
+
This function processes YOLO settings CLI commands such as reset and updating individual settings. It should be
|
596 |
+
called when executing a script with arguments related to YOLO settings management.
|
597 |
+
|
598 |
+
Args:
|
599 |
+
args (List[str]): A list of command line arguments for YOLO settings management.
|
600 |
+
|
601 |
+
Examples:
|
602 |
+
>>> handle_yolo_settings(["reset"]) # Reset YOLO settings
|
603 |
+
>>> handle_yolo_settings(["default_cfg_path=yolo11n.yaml"]) # Update a specific setting
|
604 |
+
|
605 |
+
Notes:
|
606 |
+
- If no arguments are provided, the function will display the current settings.
|
607 |
+
- The 'reset' command will delete the existing settings file and create new default settings.
|
608 |
+
- Other arguments are treated as key-value pairs to update specific settings.
|
609 |
+
- The function will check for alignment between the provided settings and the existing ones.
|
610 |
+
- After processing, the updated settings will be displayed.
|
611 |
+
- For more information on handling YOLO settings, visit:
|
612 |
+
https://docs.ultralytics.com/quickstart/#ultralytics-settings
|
613 |
+
"""
|
614 |
+
url = "https://docs.ultralytics.com/quickstart/#ultralytics-settings" # help URL
|
615 |
+
try:
|
616 |
+
if any(args):
|
617 |
+
if args[0] == "reset":
|
618 |
+
SETTINGS_FILE.unlink() # delete the settings file
|
619 |
+
SETTINGS.reset() # create new settings
|
620 |
+
LOGGER.info("Settings reset successfully") # inform the user that settings have been reset
|
621 |
+
else: # save a new setting
|
622 |
+
new = dict(parse_key_value_pair(a) for a in args)
|
623 |
+
check_dict_alignment(SETTINGS, new)
|
624 |
+
SETTINGS.update(new)
|
625 |
+
|
626 |
+
print(SETTINGS) # print the current settings
|
627 |
+
LOGGER.info(f"💡 Learn more about Ultralytics Settings at {url}")
|
628 |
+
except Exception as e:
|
629 |
+
LOGGER.warning(f"WARNING ⚠️ settings error: '{e}'. Please see {url} for help.")
|
630 |
+
|
631 |
+
|
632 |
+
def handle_yolo_solutions(args: List[str]) -> None:
|
633 |
+
"""
|
634 |
+
Processes YOLO solutions arguments and runs the specified computer vision solutions pipeline.
|
635 |
+
|
636 |
+
Args:
|
637 |
+
args (List[str]): Command-line arguments for configuring and running the Ultralytics YOLO
|
638 |
+
solutions: https://docs.ultralytics.com/solutions/, It can include solution name, source,
|
639 |
+
and other configuration parameters.
|
640 |
+
|
641 |
+
Examples:
|
642 |
+
Run people counting solution with default settings:
|
643 |
+
>>> handle_yolo_solutions(["count"])
|
644 |
+
|
645 |
+
Run analytics with custom configuration:
|
646 |
+
>>> handle_yolo_solutions(["analytics", "conf=0.25", "source=path/to/video.mp4"])
|
647 |
+
|
648 |
+
Run inference with custom configuration, requires Streamlit version 1.29.0 or higher.
|
649 |
+
>>> handle_yolo_solutions(["inference", "model=yolo11n.pt"])
|
650 |
+
|
651 |
+
Notes:
|
652 |
+
- Default configurations are merged from DEFAULT_SOL_DICT and DEFAULT_CFG_DICT
|
653 |
+
- Arguments can be provided in the format 'key=value' or as boolean flags
|
654 |
+
- Available solutions are defined in SOLUTION_MAP with their respective classes and methods
|
655 |
+
- If an invalid solution is provided, defaults to 'count' solution
|
656 |
+
- Output videos are saved in 'runs/solution/{solution_name}' directory
|
657 |
+
- For 'analytics' solution, frame numbers are tracked for generating analytical graphs
|
658 |
+
- Video processing can be interrupted by pressing 'q'
|
659 |
+
- Processes video frames sequentially and saves output in .avi format
|
660 |
+
- If no source is specified, downloads and uses a default sample video
|
661 |
+
- The inference solution will be launched using the 'streamlit run' command.
|
662 |
+
- The Streamlit app file is located in the Ultralytics package directory.
|
663 |
+
"""
|
664 |
+
full_args_dict = {
|
665 |
+
**DEFAULT_SOL_DICT,
|
666 |
+
**DEFAULT_CFG_DICT,
|
667 |
+
"blur_ratio": 0.5,
|
668 |
+
"vision_point": (20, 20),
|
669 |
+
"crop_dir": "cropped-detections",
|
670 |
+
} # arguments dictionary
|
671 |
+
overrides = {}
|
672 |
+
|
673 |
+
# check dictionary alignment
|
674 |
+
for arg in merge_equals_args(args):
|
675 |
+
arg = arg.lstrip("-").rstrip(",")
|
676 |
+
if "=" in arg:
|
677 |
+
try:
|
678 |
+
k, v = parse_key_value_pair(arg)
|
679 |
+
overrides[k] = v
|
680 |
+
except (NameError, SyntaxError, ValueError, AssertionError) as e:
|
681 |
+
check_dict_alignment(full_args_dict, {arg: ""}, e)
|
682 |
+
elif arg in full_args_dict and isinstance(full_args_dict.get(arg), bool):
|
683 |
+
overrides[arg] = True
|
684 |
+
check_dict_alignment(full_args_dict, overrides) # dict alignment
|
685 |
+
|
686 |
+
# Get solution name
|
687 |
+
if not args:
|
688 |
+
LOGGER.warning("⚠️ No solution name provided. i.e `yolo solutions count`. Defaulting to 'count'.")
|
689 |
+
args = ["count"]
|
690 |
+
if args[0] == "help":
|
691 |
+
LOGGER.info(SOLUTIONS_HELP_MSG)
|
692 |
+
return # Early return for 'help' case
|
693 |
+
elif args[0] in SOLUTION_MAP:
|
694 |
+
solution_name = args.pop(0) # Extract the solution name directly
|
695 |
+
else:
|
696 |
+
LOGGER.warning(
|
697 |
+
f"❌ '{args[0]}' is not a valid solution. 💡 Defaulting to 'count'.\n"
|
698 |
+
f"🚀 Available solutions: {', '.join(list(SOLUTION_MAP.keys())[:-1])}\n"
|
699 |
+
)
|
700 |
+
solution_name = "count" # Default for invalid solution
|
701 |
+
|
702 |
+
if solution_name == "inference":
|
703 |
+
checks.check_requirements("streamlit>=1.29.0,<1.44.0")
|
704 |
+
LOGGER.info("💡 Loading Ultralytics live inference app...")
|
705 |
+
subprocess.run(
|
706 |
+
[ # Run subprocess with Streamlit custom argument
|
707 |
+
"streamlit",
|
708 |
+
"run",
|
709 |
+
str(ROOT / "solutions/streamlit_inference.py"),
|
710 |
+
"--server.headless",
|
711 |
+
"true",
|
712 |
+
overrides.pop("model", "yolo11n.pt"),
|
713 |
+
]
|
714 |
+
)
|
715 |
+
else:
|
716 |
+
from ultralytics import solutions
|
717 |
+
|
718 |
+
solution = getattr(solutions, SOLUTION_MAP[solution_name])(is_cli=True, **overrides) # class i.e ObjectCounter
|
719 |
+
|
720 |
+
cap = cv2.VideoCapture(solution.CFG["source"]) # read the video file
|
721 |
+
if solution_name != "crop":
|
722 |
+
# extract width, height and fps of the video file, create save directory and initialize video writer
|
723 |
+
w, h, fps = (
|
724 |
+
int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS)
|
725 |
+
)
|
726 |
+
if solution_name == "analytics": # analytical graphs follow fixed shape for output i.e w=1920, h=1080
|
727 |
+
w, h = 1280, 720
|
728 |
+
save_dir = get_save_dir(SimpleNamespace(project="runs/solutions", name="exp", exist_ok=False))
|
729 |
+
save_dir.mkdir(parents=True) # create the output directory i.e. runs/solutions/exp
|
730 |
+
vw = cv2.VideoWriter(str(save_dir / f"{solution_name}.avi"), cv2.VideoWriter_fourcc(*"mp4v"), fps, (w, h))
|
731 |
+
|
732 |
+
try: # Process video frames
|
733 |
+
f_n = 0 # frame number, required for analytical graphs
|
734 |
+
while cap.isOpened():
|
735 |
+
success, frame = cap.read()
|
736 |
+
if not success:
|
737 |
+
break
|
738 |
+
results = solution(frame, f_n := f_n + 1) if solution_name == "analytics" else solution(frame)
|
739 |
+
if solution_name != "crop":
|
740 |
+
vw.write(results.plot_im)
|
741 |
+
if cv2.waitKey(1) & 0xFF == ord("q"):
|
742 |
+
break
|
743 |
+
finally:
|
744 |
+
cap.release()
|
745 |
+
|
746 |
+
|
747 |
+
def parse_key_value_pair(pair: str = "key=value") -> tuple:
|
748 |
+
"""
|
749 |
+
Parses a key-value pair string into separate key and value components.
|
750 |
+
|
751 |
+
Args:
|
752 |
+
pair (str): A string containing a key-value pair in the format "key=value".
|
753 |
+
|
754 |
+
Returns:
|
755 |
+
key (str): The parsed key.
|
756 |
+
value (str): The parsed value.
|
757 |
+
|
758 |
+
Raises:
|
759 |
+
AssertionError: If the value is missing or empty.
|
760 |
+
|
761 |
+
Examples:
|
762 |
+
>>> key, value = parse_key_value_pair("model=yolo11n.pt")
|
763 |
+
>>> print(f"Key: {key}, Value: {value}")
|
764 |
+
Key: model, Value: yolo11n.pt
|
765 |
+
|
766 |
+
>>> key, value = parse_key_value_pair("epochs=100")
|
767 |
+
>>> print(f"Key: {key}, Value: {value}")
|
768 |
+
Key: epochs, Value: 100
|
769 |
+
|
770 |
+
Notes:
|
771 |
+
- The function splits the input string on the first '=' character.
|
772 |
+
- Leading and trailing whitespace is removed from both key and value.
|
773 |
+
- An assertion error is raised if the value is empty after stripping.
|
774 |
+
"""
|
775 |
+
k, v = pair.split("=", 1) # split on first '=' sign
|
776 |
+
k, v = k.strip(), v.strip() # remove spaces
|
777 |
+
assert v, f"missing '{k}' value"
|
778 |
+
return k, smart_value(v)
|
779 |
+
|
780 |
+
|
781 |
+
def smart_value(v: str) -> Any:
|
782 |
+
"""
|
783 |
+
Converts a string representation of a value to its appropriate Python type.
|
784 |
+
|
785 |
+
This function attempts to convert a given string into a Python object of the most appropriate type. It handles
|
786 |
+
conversions to None, bool, int, float, and other types that can be evaluated safely.
|
787 |
+
|
788 |
+
Args:
|
789 |
+
v (str): The string representation of the value to be converted.
|
790 |
+
|
791 |
+
Returns:
|
792 |
+
(Any): The converted value. The type can be None, bool, int, float, or the original string if no conversion
|
793 |
+
is applicable.
|
794 |
+
|
795 |
+
Examples:
|
796 |
+
>>> smart_value("42")
|
797 |
+
42
|
798 |
+
>>> smart_value("3.14")
|
799 |
+
3.14
|
800 |
+
>>> smart_value("True")
|
801 |
+
True
|
802 |
+
>>> smart_value("None")
|
803 |
+
None
|
804 |
+
>>> smart_value("some_string")
|
805 |
+
'some_string'
|
806 |
+
|
807 |
+
Notes:
|
808 |
+
- The function uses a case-insensitive comparison for boolean and None values.
|
809 |
+
- For other types, it attempts to use Python's eval() function, which can be unsafe if used on untrusted input.
|
810 |
+
- If no conversion is possible, the original string is returned.
|
811 |
+
"""
|
812 |
+
v_lower = v.lower()
|
813 |
+
if v_lower == "none":
|
814 |
+
return None
|
815 |
+
elif v_lower == "true":
|
816 |
+
return True
|
817 |
+
elif v_lower == "false":
|
818 |
+
return False
|
819 |
+
else:
|
820 |
+
try:
|
821 |
+
return eval(v)
|
822 |
+
except Exception:
|
823 |
+
return v
|
824 |
+
|
825 |
+
|
826 |
+
def entrypoint(debug: str = "") -> None:
|
827 |
+
"""
|
828 |
+
Ultralytics entrypoint function for parsing and executing command-line arguments.
|
829 |
+
|
830 |
+
This function serves as the main entry point for the Ultralytics CLI, parsing command-line arguments and
|
831 |
+
executing the corresponding tasks such as training, validation, prediction, exporting models, and more.
|
832 |
+
|
833 |
+
Args:
|
834 |
+
debug (str): Space-separated string of command-line arguments for debugging purposes.
|
835 |
+
|
836 |
+
Examples:
|
837 |
+
Train a detection model for 10 epochs with an initial learning_rate of 0.01:
|
838 |
+
>>> entrypoint("train data=coco8.yaml model=yolo11n.pt epochs=10 lr0=0.01")
|
839 |
+
|
840 |
+
Predict a YouTube video using a pretrained segmentation model at image size 320:
|
841 |
+
>>> entrypoint("predict model=yolo11n-seg.pt source='https://youtu.be/LNwODJXcvt4' imgsz=320")
|
842 |
+
|
843 |
+
Validate a pretrained detection model at batch-size 1 and image size 640:
|
844 |
+
>>> entrypoint("val model=yolo11n.pt data=coco8.yaml batch=1 imgsz=640")
|
845 |
+
|
846 |
+
Notes:
|
847 |
+
- If no arguments are passed, the function will display the usage help message.
|
848 |
+
- For a list of all available commands and their arguments, see the provided help messages and the
|
849 |
+
Ultralytics documentation at https://docs.ultralytics.com.
|
850 |
+
"""
|
851 |
+
args = (debug.split(" ") if debug else ARGV)[1:]
|
852 |
+
if not args: # no arguments passed
|
853 |
+
LOGGER.info(CLI_HELP_MSG)
|
854 |
+
return
|
855 |
+
|
856 |
+
special = {
|
857 |
+
"help": lambda: LOGGER.info(CLI_HELP_MSG),
|
858 |
+
"checks": checks.collect_system_info,
|
859 |
+
"version": lambda: LOGGER.info(__version__),
|
860 |
+
"settings": lambda: handle_yolo_settings(args[1:]),
|
861 |
+
"cfg": lambda: yaml_print(DEFAULT_CFG_PATH),
|
862 |
+
"hub": lambda: handle_yolo_hub(args[1:]),
|
863 |
+
"login": lambda: handle_yolo_hub(args),
|
864 |
+
"logout": lambda: handle_yolo_hub(args),
|
865 |
+
"copy-cfg": copy_default_cfg,
|
866 |
+
"solutions": lambda: handle_yolo_solutions(args[1:]),
|
867 |
+
}
|
868 |
+
full_args_dict = {**DEFAULT_CFG_DICT, **{k: None for k in TASKS}, **{k: None for k in MODES}, **special}
|
869 |
+
|
870 |
+
# Define common misuses of special commands, i.e. -h, -help, --help
|
871 |
+
special.update({k[0]: v for k, v in special.items()}) # singular
|
872 |
+
special.update({k[:-1]: v for k, v in special.items() if len(k) > 1 and k.endswith("s")}) # singular
|
873 |
+
special = {**special, **{f"-{k}": v for k, v in special.items()}, **{f"--{k}": v for k, v in special.items()}}
|
874 |
+
|
875 |
+
overrides = {} # basic overrides, i.e. imgsz=320
|
876 |
+
for a in merge_equals_args(args): # merge spaces around '=' sign
|
877 |
+
if a.startswith("--"):
|
878 |
+
LOGGER.warning(f"WARNING ⚠️ argument '{a}' does not require leading dashes '--', updating to '{a[2:]}'.")
|
879 |
+
a = a[2:]
|
880 |
+
if a.endswith(","):
|
881 |
+
LOGGER.warning(f"WARNING ⚠️ argument '{a}' does not require trailing comma ',', updating to '{a[:-1]}'.")
|
882 |
+
a = a[:-1]
|
883 |
+
if "=" in a:
|
884 |
+
try:
|
885 |
+
k, v = parse_key_value_pair(a)
|
886 |
+
if k == "cfg" and v is not None: # custom.yaml passed
|
887 |
+
LOGGER.info(f"Overriding {DEFAULT_CFG_PATH} with {v}")
|
888 |
+
overrides = {k: val for k, val in yaml_load(checks.check_yaml(v)).items() if k != "cfg"}
|
889 |
+
else:
|
890 |
+
overrides[k] = v
|
891 |
+
except (NameError, SyntaxError, ValueError, AssertionError) as e:
|
892 |
+
check_dict_alignment(full_args_dict, {a: ""}, e)
|
893 |
+
|
894 |
+
elif a in TASKS:
|
895 |
+
overrides["task"] = a
|
896 |
+
elif a in MODES:
|
897 |
+
overrides["mode"] = a
|
898 |
+
elif a.lower() in special:
|
899 |
+
special[a.lower()]()
|
900 |
+
return
|
901 |
+
elif a in DEFAULT_CFG_DICT and isinstance(DEFAULT_CFG_DICT[a], bool):
|
902 |
+
overrides[a] = True # auto-True for default bool args, i.e. 'yolo show' sets show=True
|
903 |
+
elif a in DEFAULT_CFG_DICT:
|
904 |
+
raise SyntaxError(
|
905 |
+
f"'{colorstr('red', 'bold', a)}' is a valid YOLO argument but is missing an '=' sign "
|
906 |
+
f"to set its value, i.e. try '{a}={DEFAULT_CFG_DICT[a]}'\n{CLI_HELP_MSG}"
|
907 |
+
)
|
908 |
+
else:
|
909 |
+
check_dict_alignment(full_args_dict, {a: ""})
|
910 |
+
|
911 |
+
# Check keys
|
912 |
+
check_dict_alignment(full_args_dict, overrides)
|
913 |
+
|
914 |
+
# Mode
|
915 |
+
mode = overrides.get("mode")
|
916 |
+
if mode is None:
|
917 |
+
mode = DEFAULT_CFG.mode or "predict"
|
918 |
+
LOGGER.warning(f"WARNING ⚠️ 'mode' argument is missing. Valid modes are {MODES}. Using default 'mode={mode}'.")
|
919 |
+
elif mode not in MODES:
|
920 |
+
raise ValueError(f"Invalid 'mode={mode}'. Valid modes are {MODES}.\n{CLI_HELP_MSG}")
|
921 |
+
|
922 |
+
# Task
|
923 |
+
task = overrides.pop("task", None)
|
924 |
+
if task:
|
925 |
+
if task not in TASKS:
|
926 |
+
if task == "track":
|
927 |
+
LOGGER.warning(
|
928 |
+
"WARNING ⚠️ invalid 'task=track', setting 'task=detect' and 'mode=track'. Valid tasks are {TASKS}.\n{CLI_HELP_MSG}."
|
929 |
+
)
|
930 |
+
task, mode = "detect", "track"
|
931 |
+
else:
|
932 |
+
raise ValueError(f"Invalid 'task={task}'. Valid tasks are {TASKS}.\n{CLI_HELP_MSG}")
|
933 |
+
if "model" not in overrides:
|
934 |
+
overrides["model"] = TASK2MODEL[task]
|
935 |
+
|
936 |
+
# Model
|
937 |
+
model = overrides.pop("model", DEFAULT_CFG.model)
|
938 |
+
if model is None:
|
939 |
+
model = "yolo11n.pt"
|
940 |
+
LOGGER.warning(f"WARNING ⚠️ 'model' argument is missing. Using default 'model={model}'.")
|
941 |
+
overrides["model"] = model
|
942 |
+
stem = Path(model).stem.lower()
|
943 |
+
if "rtdetr" in stem: # guess architecture
|
944 |
+
from ultralytics import RTDETR
|
945 |
+
|
946 |
+
model = RTDETR(model) # no task argument
|
947 |
+
elif "fastsam" in stem:
|
948 |
+
from ultralytics import FastSAM
|
949 |
+
|
950 |
+
model = FastSAM(model)
|
951 |
+
elif "sam_" in stem or "sam2_" in stem or "sam2.1_" in stem:
|
952 |
+
from ultralytics import SAM
|
953 |
+
|
954 |
+
model = SAM(model)
|
955 |
+
else:
|
956 |
+
from ultralytics import YOLO
|
957 |
+
|
958 |
+
model = YOLO(model, task=task)
|
959 |
+
if isinstance(overrides.get("pretrained"), str):
|
960 |
+
model.load(overrides["pretrained"])
|
961 |
+
|
962 |
+
# Task Update
|
963 |
+
if task != model.task:
|
964 |
+
if task:
|
965 |
+
LOGGER.warning(
|
966 |
+
f"WARNING ⚠️ conflicting 'task={task}' passed with 'task={model.task}' model. "
|
967 |
+
f"Ignoring 'task={task}' and updating to 'task={model.task}' to match model."
|
968 |
+
)
|
969 |
+
task = model.task
|
970 |
+
|
971 |
+
# Mode
|
972 |
+
if mode in {"predict", "track"} and "source" not in overrides:
|
973 |
+
overrides["source"] = (
|
974 |
+
"https://ultralytics.com/images/boats.jpg" if task == "obb" else DEFAULT_CFG.source or ASSETS
|
975 |
+
)
|
976 |
+
LOGGER.warning(f"WARNING ⚠️ 'source' argument is missing. Using default 'source={overrides['source']}'.")
|
977 |
+
elif mode in {"train", "val"}:
|
978 |
+
if "data" not in overrides and "resume" not in overrides:
|
979 |
+
overrides["data"] = DEFAULT_CFG.data or TASK2DATA.get(task or DEFAULT_CFG.task, DEFAULT_CFG.data)
|
980 |
+
LOGGER.warning(f"WARNING ⚠️ 'data' argument is missing. Using default 'data={overrides['data']}'.")
|
981 |
+
elif mode == "export":
|
982 |
+
if "format" not in overrides:
|
983 |
+
overrides["format"] = DEFAULT_CFG.format or "torchscript"
|
984 |
+
LOGGER.warning(f"WARNING ⚠️ 'format' argument is missing. Using default 'format={overrides['format']}'.")
|
985 |
+
|
986 |
+
# Run command in python
|
987 |
+
getattr(model, mode)(**overrides) # default args from model
|
988 |
+
|
989 |
+
# Show help
|
990 |
+
LOGGER.info(f"💡 Learn more at https://docs.ultralytics.com/modes/{mode}")
|
991 |
+
|
992 |
+
# Recommend VS Code extension
|
993 |
+
if IS_VSCODE and SETTINGS.get("vscode_msg", True):
|
994 |
+
LOGGER.info(vscode_msg())
|
995 |
+
|
996 |
+
|
997 |
+
# Special modes --------------------------------------------------------------------------------------------------------
|
998 |
+
def copy_default_cfg() -> None:
|
999 |
+
"""
|
1000 |
+
Copies the default configuration file and creates a new one with '_copy' appended to its name.
|
1001 |
+
|
1002 |
+
This function duplicates the existing default configuration file (DEFAULT_CFG_PATH) and saves it
|
1003 |
+
with '_copy' appended to its name in the current working directory. It provides a convenient way
|
1004 |
+
to create a custom configuration file based on the default settings.
|
1005 |
+
|
1006 |
+
Examples:
|
1007 |
+
>>> copy_default_cfg()
|
1008 |
+
# Output: default.yaml copied to /path/to/current/directory/default_copy.yaml
|
1009 |
+
# Example YOLO command with this new custom cfg:
|
1010 |
+
# yolo cfg='/path/to/current/directory/default_copy.yaml' imgsz=320 batch=8
|
1011 |
+
|
1012 |
+
Notes:
|
1013 |
+
- The new configuration file is created in the current working directory.
|
1014 |
+
- After copying, the function prints a message with the new file's location and an example
|
1015 |
+
YOLO command demonstrating how to use the new configuration file.
|
1016 |
+
- This function is useful for users who want to modify the default configuration without
|
1017 |
+
altering the original file.
|
1018 |
+
"""
|
1019 |
+
new_file = Path.cwd() / DEFAULT_CFG_PATH.name.replace(".yaml", "_copy.yaml")
|
1020 |
+
shutil.copy2(DEFAULT_CFG_PATH, new_file)
|
1021 |
+
LOGGER.info(
|
1022 |
+
f"{DEFAULT_CFG_PATH} copied to {new_file}\n"
|
1023 |
+
f"Example YOLO command with this new custom cfg:\n yolo cfg='{new_file}' imgsz=320 batch=8"
|
1024 |
+
)
|
1025 |
+
|
1026 |
+
|
1027 |
+
if __name__ == "__main__":
|
1028 |
+
# Example: entrypoint(debug='yolo predict model=yolo11n.pt')
|
1029 |
+
entrypoint(debug="")
|
ultralytics/cfg/__pycache__/__init__.cpython-311.pyc
ADDED
Binary file (50.5 kB). View file
|
|
ultralytics/cfg/datasets/Argoverse.yaml
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# Argoverse-HD dataset (ring-front-center camera) https://www.cs.cmu.edu/~mengtial/proj/streaming/ by Argo AI
|
4 |
+
# Documentation: https://docs.ultralytics.com/datasets/detect/argoverse/
|
5 |
+
# Example usage: yolo train data=Argoverse.yaml
|
6 |
+
# parent
|
7 |
+
# ├── ultralytics
|
8 |
+
# └── datasets
|
9 |
+
# └── Argoverse ← downloads here (31.5 GB)
|
10 |
+
|
11 |
+
# 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, ..]
|
12 |
+
path: ../datasets/Argoverse # dataset root dir
|
13 |
+
train: Argoverse-1.1/images/train/ # train images (relative to 'path') 39384 images
|
14 |
+
val: Argoverse-1.1/images/val/ # val images (relative to 'path') 15062 images
|
15 |
+
test: Argoverse-1.1/images/test/ # test images (optional) https://eval.ai/web/challenges/challenge-page/800/overview
|
16 |
+
|
17 |
+
# Classes
|
18 |
+
names:
|
19 |
+
0: person
|
20 |
+
1: bicycle
|
21 |
+
2: car
|
22 |
+
3: motorcycle
|
23 |
+
4: bus
|
24 |
+
5: truck
|
25 |
+
6: traffic_light
|
26 |
+
7: stop_sign
|
27 |
+
|
28 |
+
# Download script/URL (optional) ---------------------------------------------------------------------------------------
|
29 |
+
download: |
|
30 |
+
import json
|
31 |
+
from pathlib import Path
|
32 |
+
|
33 |
+
from tqdm import tqdm
|
34 |
+
from ultralytics.utils.downloads import download
|
35 |
+
|
36 |
+
def argoverse2yolo(set):
|
37 |
+
"""Convert Argoverse dataset annotations to YOLO format for object detection tasks."""
|
38 |
+
labels = {}
|
39 |
+
a = json.load(open(set, "rb"))
|
40 |
+
for annot in tqdm(a["annotations"], desc=f"Converting {set} to YOLOv5 format..."):
|
41 |
+
img_id = annot["image_id"]
|
42 |
+
img_name = a["images"][img_id]["name"]
|
43 |
+
img_label_name = f"{img_name[:-3]}txt"
|
44 |
+
|
45 |
+
cls = annot["category_id"] # instance class id
|
46 |
+
x_center, y_center, width, height = annot["bbox"]
|
47 |
+
x_center = (x_center + width / 2) / 1920.0 # offset and scale
|
48 |
+
y_center = (y_center + height / 2) / 1200.0 # offset and scale
|
49 |
+
width /= 1920.0 # scale
|
50 |
+
height /= 1200.0 # scale
|
51 |
+
|
52 |
+
img_dir = set.parents[2] / "Argoverse-1.1" / "labels" / a["seq_dirs"][a["images"][annot["image_id"]]["sid"]]
|
53 |
+
if not img_dir.exists():
|
54 |
+
img_dir.mkdir(parents=True, exist_ok=True)
|
55 |
+
|
56 |
+
k = str(img_dir / img_label_name)
|
57 |
+
if k not in labels:
|
58 |
+
labels[k] = []
|
59 |
+
labels[k].append(f"{cls} {x_center} {y_center} {width} {height}\n")
|
60 |
+
|
61 |
+
for k in labels:
|
62 |
+
with open(k, "w", encoding="utf-8") as f:
|
63 |
+
f.writelines(labels[k])
|
64 |
+
|
65 |
+
|
66 |
+
# Download 'https://argoverse-hd.s3.us-east-2.amazonaws.com/Argoverse-HD-Full.zip' (deprecated S3 link)
|
67 |
+
dir = Path(yaml["path"]) # dataset root dir
|
68 |
+
urls = ["https://drive.google.com/file/d/1st9qW3BeIwQsnR0t8mRpvbsSWIo16ACi/view?usp=drive_link"]
|
69 |
+
print("\n\nWARNING: Argoverse dataset MUST be downloaded manually, autodownload will NOT work.")
|
70 |
+
print(f"WARNING: Manually download Argoverse dataset '{urls[0]}' to '{dir}' and re-run your command.\n\n")
|
71 |
+
# download(urls, dir=dir)
|
72 |
+
|
73 |
+
# Convert
|
74 |
+
annotations_dir = "Argoverse-HD/annotations/"
|
75 |
+
(dir / "Argoverse-1.1" / "tracking").rename(dir / "Argoverse-1.1" / "images") # rename 'tracking' to 'images'
|
76 |
+
for d in "train.json", "val.json":
|
77 |
+
argoverse2yolo(dir / annotations_dir / d) # convert Argoverse annotations to YOLO labels
|
ultralytics/cfg/datasets/DOTAv1.5.yaml
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# DOTA 1.5 dataset https://captain-whu.github.io/DOTA/index.html for object detection in aerial images by Wuhan University
|
4 |
+
# Documentation: https://docs.ultralytics.com/datasets/obb/dota-v2/
|
5 |
+
# Example usage: yolo train model=yolov8n-obb.pt data=DOTAv1.5.yaml
|
6 |
+
# parent
|
7 |
+
# ├── ultralytics
|
8 |
+
# └── datasets
|
9 |
+
# └── dota1.5 ← downloads here (2GB)
|
10 |
+
|
11 |
+
# 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, ..]
|
12 |
+
path: ../datasets/DOTAv1.5 # dataset root dir
|
13 |
+
train: images/train # train images (relative to 'path') 1411 images
|
14 |
+
val: images/val # val images (relative to 'path') 458 images
|
15 |
+
test: images/test # test images (optional) 937 images
|
16 |
+
|
17 |
+
# Classes for DOTA 1.5
|
18 |
+
names:
|
19 |
+
0: plane
|
20 |
+
1: ship
|
21 |
+
2: storage tank
|
22 |
+
3: baseball diamond
|
23 |
+
4: tennis court
|
24 |
+
5: basketball court
|
25 |
+
6: ground track field
|
26 |
+
7: harbor
|
27 |
+
8: bridge
|
28 |
+
9: large vehicle
|
29 |
+
10: small vehicle
|
30 |
+
11: helicopter
|
31 |
+
12: roundabout
|
32 |
+
13: soccer ball field
|
33 |
+
14: swimming pool
|
34 |
+
15: container crane
|
35 |
+
|
36 |
+
# Download script/URL (optional)
|
37 |
+
download: https://github.com/ultralytics/assets/releases/download/v0.0.0/DOTAv1.5.zip
|
ultralytics/cfg/datasets/DOTAv1.yaml
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# DOTA 1.0 dataset https://captain-whu.github.io/DOTA/index.html for object detection in aerial images by Wuhan University
|
4 |
+
# Documentation: https://docs.ultralytics.com/datasets/obb/dota-v2/
|
5 |
+
# Example usage: yolo train model=yolov8n-obb.pt data=DOTAv1.yaml
|
6 |
+
# parent
|
7 |
+
# ├── ultralytics
|
8 |
+
# └── datasets
|
9 |
+
# └── dota1 ← downloads here (2GB)
|
10 |
+
|
11 |
+
# 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, ..]
|
12 |
+
path: ../datasets/DOTAv1 # dataset root dir
|
13 |
+
train: images/train # train images (relative to 'path') 1411 images
|
14 |
+
val: images/val # val images (relative to 'path') 458 images
|
15 |
+
test: images/test # test images (optional) 937 images
|
16 |
+
|
17 |
+
# Classes for DOTA 1.0
|
18 |
+
names:
|
19 |
+
0: plane
|
20 |
+
1: ship
|
21 |
+
2: storage tank
|
22 |
+
3: baseball diamond
|
23 |
+
4: tennis court
|
24 |
+
5: basketball court
|
25 |
+
6: ground track field
|
26 |
+
7: harbor
|
27 |
+
8: bridge
|
28 |
+
9: large vehicle
|
29 |
+
10: small vehicle
|
30 |
+
11: helicopter
|
31 |
+
12: roundabout
|
32 |
+
13: soccer ball field
|
33 |
+
14: swimming pool
|
34 |
+
|
35 |
+
# Download script/URL (optional)
|
36 |
+
download: https://github.com/ultralytics/assets/releases/download/v0.0.0/DOTAv1.zip
|
ultralytics/cfg/datasets/GlobalWheat2020.yaml
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# Global Wheat 2020 dataset https://www.global-wheat.com/ by University of Saskatchewan
|
4 |
+
# Documentation: https://docs.ultralytics.com/datasets/detect/globalwheat2020/
|
5 |
+
# Example usage: yolo train data=GlobalWheat2020.yaml
|
6 |
+
# parent
|
7 |
+
# ├── ultralytics
|
8 |
+
# └── datasets
|
9 |
+
# └── GlobalWheat2020 ← downloads here (7.0 GB)
|
10 |
+
|
11 |
+
# 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, ..]
|
12 |
+
path: ../datasets/GlobalWheat2020 # dataset root dir
|
13 |
+
train: # train images (relative to 'path') 3422 images
|
14 |
+
- images/arvalis_1
|
15 |
+
- images/arvalis_2
|
16 |
+
- images/arvalis_3
|
17 |
+
- images/ethz_1
|
18 |
+
- images/rres_1
|
19 |
+
- images/inrae_1
|
20 |
+
- images/usask_1
|
21 |
+
val: # val images (relative to 'path') 748 images (WARNING: train set contains ethz_1)
|
22 |
+
- images/ethz_1
|
23 |
+
test: # test images (optional) 1276 images
|
24 |
+
- images/utokyo_1
|
25 |
+
- images/utokyo_2
|
26 |
+
- images/nau_1
|
27 |
+
- images/uq_1
|
28 |
+
|
29 |
+
# Classes
|
30 |
+
names:
|
31 |
+
0: wheat_head
|
32 |
+
|
33 |
+
# Download script/URL (optional) ---------------------------------------------------------------------------------------
|
34 |
+
download: |
|
35 |
+
from pathlib import Path
|
36 |
+
|
37 |
+
from ultralytics.utils.downloads import download
|
38 |
+
|
39 |
+
# Download
|
40 |
+
dir = Path(yaml["path"]) # dataset root dir
|
41 |
+
urls = [
|
42 |
+
"https://zenodo.org/record/4298502/files/global-wheat-codalab-official.zip",
|
43 |
+
"https://github.com/ultralytics/assets/releases/download/v0.0.0/GlobalWheat2020_labels.zip",
|
44 |
+
]
|
45 |
+
download(urls, dir=dir)
|
46 |
+
|
47 |
+
# Make Directories
|
48 |
+
for p in "annotations", "images", "labels":
|
49 |
+
(dir / p).mkdir(parents=True, exist_ok=True)
|
50 |
+
|
51 |
+
# Move
|
52 |
+
for p in (
|
53 |
+
"arvalis_1",
|
54 |
+
"arvalis_2",
|
55 |
+
"arvalis_3",
|
56 |
+
"ethz_1",
|
57 |
+
"rres_1",
|
58 |
+
"inrae_1",
|
59 |
+
"usask_1",
|
60 |
+
"utokyo_1",
|
61 |
+
"utokyo_2",
|
62 |
+
"nau_1",
|
63 |
+
"uq_1",
|
64 |
+
):
|
65 |
+
(dir / "global-wheat-codalab-official" / p).rename(dir / "images" / p) # move to /images
|
66 |
+
f = (dir / "global-wheat-codalab-official" / p).with_suffix(".json") # json file
|
67 |
+
if f.exists():
|
68 |
+
f.rename((dir / "annotations" / p).with_suffix(".json")) # move to /annotations
|
ultralytics/cfg/datasets/ImageNet.yaml
ADDED
@@ -0,0 +1,2025 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# ImageNet-1k dataset https://www.image-net.org/index.php by Stanford University
|
4 |
+
# Simplified class names from https://github.com/anishathalye/imagenet-simple-labels
|
5 |
+
# Documentation: https://docs.ultralytics.com/datasets/classify/imagenet/
|
6 |
+
# Example usage: yolo train task=classify data=imagenet
|
7 |
+
# parent
|
8 |
+
# ├── ultralytics
|
9 |
+
# └── datasets
|
10 |
+
# └── imagenet ← downloads here (144 GB)
|
11 |
+
|
12 |
+
# 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, ..]
|
13 |
+
path: ../datasets/imagenet # dataset root dir
|
14 |
+
train: train # train images (relative to 'path') 1281167 images
|
15 |
+
val: val # val images (relative to 'path') 50000 images
|
16 |
+
test: # test images (optional)
|
17 |
+
|
18 |
+
# Classes
|
19 |
+
names:
|
20 |
+
0: tench
|
21 |
+
1: goldfish
|
22 |
+
2: great white shark
|
23 |
+
3: tiger shark
|
24 |
+
4: hammerhead shark
|
25 |
+
5: electric ray
|
26 |
+
6: stingray
|
27 |
+
7: cock
|
28 |
+
8: hen
|
29 |
+
9: ostrich
|
30 |
+
10: brambling
|
31 |
+
11: goldfinch
|
32 |
+
12: house finch
|
33 |
+
13: junco
|
34 |
+
14: indigo bunting
|
35 |
+
15: American robin
|
36 |
+
16: bulbul
|
37 |
+
17: jay
|
38 |
+
18: magpie
|
39 |
+
19: chickadee
|
40 |
+
20: American dipper
|
41 |
+
21: kite
|
42 |
+
22: bald eagle
|
43 |
+
23: vulture
|
44 |
+
24: great grey owl
|
45 |
+
25: fire salamander
|
46 |
+
26: smooth newt
|
47 |
+
27: newt
|
48 |
+
28: spotted salamander
|
49 |
+
29: axolotl
|
50 |
+
30: American bullfrog
|
51 |
+
31: tree frog
|
52 |
+
32: tailed frog
|
53 |
+
33: loggerhead sea turtle
|
54 |
+
34: leatherback sea turtle
|
55 |
+
35: mud turtle
|
56 |
+
36: terrapin
|
57 |
+
37: box turtle
|
58 |
+
38: banded gecko
|
59 |
+
39: green iguana
|
60 |
+
40: Carolina anole
|
61 |
+
41: desert grassland whiptail lizard
|
62 |
+
42: agama
|
63 |
+
43: frilled-necked lizard
|
64 |
+
44: alligator lizard
|
65 |
+
45: Gila monster
|
66 |
+
46: European green lizard
|
67 |
+
47: chameleon
|
68 |
+
48: Komodo dragon
|
69 |
+
49: Nile crocodile
|
70 |
+
50: American alligator
|
71 |
+
51: triceratops
|
72 |
+
52: worm snake
|
73 |
+
53: ring-necked snake
|
74 |
+
54: eastern hog-nosed snake
|
75 |
+
55: smooth green snake
|
76 |
+
56: kingsnake
|
77 |
+
57: garter snake
|
78 |
+
58: water snake
|
79 |
+
59: vine snake
|
80 |
+
60: night snake
|
81 |
+
61: boa constrictor
|
82 |
+
62: African rock python
|
83 |
+
63: Indian cobra
|
84 |
+
64: green mamba
|
85 |
+
65: sea snake
|
86 |
+
66: Saharan horned viper
|
87 |
+
67: eastern diamondback rattlesnake
|
88 |
+
68: sidewinder
|
89 |
+
69: trilobite
|
90 |
+
70: harvestman
|
91 |
+
71: scorpion
|
92 |
+
72: yellow garden spider
|
93 |
+
73: barn spider
|
94 |
+
74: European garden spider
|
95 |
+
75: southern black widow
|
96 |
+
76: tarantula
|
97 |
+
77: wolf spider
|
98 |
+
78: tick
|
99 |
+
79: centipede
|
100 |
+
80: black grouse
|
101 |
+
81: ptarmigan
|
102 |
+
82: ruffed grouse
|
103 |
+
83: prairie grouse
|
104 |
+
84: peacock
|
105 |
+
85: quail
|
106 |
+
86: partridge
|
107 |
+
87: grey parrot
|
108 |
+
88: macaw
|
109 |
+
89: sulphur-crested cockatoo
|
110 |
+
90: lorikeet
|
111 |
+
91: coucal
|
112 |
+
92: bee eater
|
113 |
+
93: hornbill
|
114 |
+
94: hummingbird
|
115 |
+
95: jacamar
|
116 |
+
96: toucan
|
117 |
+
97: duck
|
118 |
+
98: red-breasted merganser
|
119 |
+
99: goose
|
120 |
+
100: black swan
|
121 |
+
101: tusker
|
122 |
+
102: echidna
|
123 |
+
103: platypus
|
124 |
+
104: wallaby
|
125 |
+
105: koala
|
126 |
+
106: wombat
|
127 |
+
107: jellyfish
|
128 |
+
108: sea anemone
|
129 |
+
109: brain coral
|
130 |
+
110: flatworm
|
131 |
+
111: nematode
|
132 |
+
112: conch
|
133 |
+
113: snail
|
134 |
+
114: slug
|
135 |
+
115: sea slug
|
136 |
+
116: chiton
|
137 |
+
117: chambered nautilus
|
138 |
+
118: Dungeness crab
|
139 |
+
119: rock crab
|
140 |
+
120: fiddler crab
|
141 |
+
121: red king crab
|
142 |
+
122: American lobster
|
143 |
+
123: spiny lobster
|
144 |
+
124: crayfish
|
145 |
+
125: hermit crab
|
146 |
+
126: isopod
|
147 |
+
127: white stork
|
148 |
+
128: black stork
|
149 |
+
129: spoonbill
|
150 |
+
130: flamingo
|
151 |
+
131: little blue heron
|
152 |
+
132: great egret
|
153 |
+
133: bittern
|
154 |
+
134: crane (bird)
|
155 |
+
135: limpkin
|
156 |
+
136: common gallinule
|
157 |
+
137: American coot
|
158 |
+
138: bustard
|
159 |
+
139: ruddy turnstone
|
160 |
+
140: dunlin
|
161 |
+
141: common redshank
|
162 |
+
142: dowitcher
|
163 |
+
143: oystercatcher
|
164 |
+
144: pelican
|
165 |
+
145: king penguin
|
166 |
+
146: albatross
|
167 |
+
147: grey whale
|
168 |
+
148: killer whale
|
169 |
+
149: dugong
|
170 |
+
150: sea lion
|
171 |
+
151: Chihuahua
|
172 |
+
152: Japanese Chin
|
173 |
+
153: Maltese
|
174 |
+
154: Pekingese
|
175 |
+
155: Shih Tzu
|
176 |
+
156: King Charles Spaniel
|
177 |
+
157: Papillon
|
178 |
+
158: toy terrier
|
179 |
+
159: Rhodesian Ridgeback
|
180 |
+
160: Afghan Hound
|
181 |
+
161: Basset Hound
|
182 |
+
162: Beagle
|
183 |
+
163: Bloodhound
|
184 |
+
164: Bluetick Coonhound
|
185 |
+
165: Black and Tan Coonhound
|
186 |
+
166: Treeing Walker Coonhound
|
187 |
+
167: English foxhound
|
188 |
+
168: Redbone Coonhound
|
189 |
+
169: borzoi
|
190 |
+
170: Irish Wolfhound
|
191 |
+
171: Italian Greyhound
|
192 |
+
172: Whippet
|
193 |
+
173: Ibizan Hound
|
194 |
+
174: Norwegian Elkhound
|
195 |
+
175: Otterhound
|
196 |
+
176: Saluki
|
197 |
+
177: Scottish Deerhound
|
198 |
+
178: Weimaraner
|
199 |
+
179: Staffordshire Bull Terrier
|
200 |
+
180: American Staffordshire Terrier
|
201 |
+
181: Bedlington Terrier
|
202 |
+
182: Border Terrier
|
203 |
+
183: Kerry Blue Terrier
|
204 |
+
184: Irish Terrier
|
205 |
+
185: Norfolk Terrier
|
206 |
+
186: Norwich Terrier
|
207 |
+
187: Yorkshire Terrier
|
208 |
+
188: Wire Fox Terrier
|
209 |
+
189: Lakeland Terrier
|
210 |
+
190: Sealyham Terrier
|
211 |
+
191: Airedale Terrier
|
212 |
+
192: Cairn Terrier
|
213 |
+
193: Australian Terrier
|
214 |
+
194: Dandie Dinmont Terrier
|
215 |
+
195: Boston Terrier
|
216 |
+
196: Miniature Schnauzer
|
217 |
+
197: Giant Schnauzer
|
218 |
+
198: Standard Schnauzer
|
219 |
+
199: Scottish Terrier
|
220 |
+
200: Tibetan Terrier
|
221 |
+
201: Australian Silky Terrier
|
222 |
+
202: Soft-coated Wheaten Terrier
|
223 |
+
203: West Highland White Terrier
|
224 |
+
204: Lhasa Apso
|
225 |
+
205: Flat-Coated Retriever
|
226 |
+
206: Curly-coated Retriever
|
227 |
+
207: Golden Retriever
|
228 |
+
208: Labrador Retriever
|
229 |
+
209: Chesapeake Bay Retriever
|
230 |
+
210: German Shorthaired Pointer
|
231 |
+
211: Vizsla
|
232 |
+
212: English Setter
|
233 |
+
213: Irish Setter
|
234 |
+
214: Gordon Setter
|
235 |
+
215: Brittany
|
236 |
+
216: Clumber Spaniel
|
237 |
+
217: English Springer Spaniel
|
238 |
+
218: Welsh Springer Spaniel
|
239 |
+
219: Cocker Spaniels
|
240 |
+
220: Sussex Spaniel
|
241 |
+
221: Irish Water Spaniel
|
242 |
+
222: Kuvasz
|
243 |
+
223: Schipperke
|
244 |
+
224: Groenendael
|
245 |
+
225: Malinois
|
246 |
+
226: Briard
|
247 |
+
227: Australian Kelpie
|
248 |
+
228: Komondor
|
249 |
+
229: Old English Sheepdog
|
250 |
+
230: Shetland Sheepdog
|
251 |
+
231: collie
|
252 |
+
232: Border Collie
|
253 |
+
233: Bouvier des Flandres
|
254 |
+
234: Rottweiler
|
255 |
+
235: German Shepherd Dog
|
256 |
+
236: Dobermann
|
257 |
+
237: Miniature Pinscher
|
258 |
+
238: Greater Swiss Mountain Dog
|
259 |
+
239: Bernese Mountain Dog
|
260 |
+
240: Appenzeller Sennenhund
|
261 |
+
241: Entlebucher Sennenhund
|
262 |
+
242: Boxer
|
263 |
+
243: Bullmastiff
|
264 |
+
244: Tibetan Mastiff
|
265 |
+
245: French Bulldog
|
266 |
+
246: Great Dane
|
267 |
+
247: St. Bernard
|
268 |
+
248: husky
|
269 |
+
249: Alaskan Malamute
|
270 |
+
250: Siberian Husky
|
271 |
+
251: Dalmatian
|
272 |
+
252: Affenpinscher
|
273 |
+
253: Basenji
|
274 |
+
254: pug
|
275 |
+
255: Leonberger
|
276 |
+
256: Newfoundland
|
277 |
+
257: Pyrenean Mountain Dog
|
278 |
+
258: Samoyed
|
279 |
+
259: Pomeranian
|
280 |
+
260: Chow Chow
|
281 |
+
261: Keeshond
|
282 |
+
262: Griffon Bruxellois
|
283 |
+
263: Pembroke Welsh Corgi
|
284 |
+
264: Cardigan Welsh Corgi
|
285 |
+
265: Toy Poodle
|
286 |
+
266: Miniature Poodle
|
287 |
+
267: Standard Poodle
|
288 |
+
268: Mexican hairless dog
|
289 |
+
269: grey wolf
|
290 |
+
270: Alaskan tundra wolf
|
291 |
+
271: red wolf
|
292 |
+
272: coyote
|
293 |
+
273: dingo
|
294 |
+
274: dhole
|
295 |
+
275: African wild dog
|
296 |
+
276: hyena
|
297 |
+
277: red fox
|
298 |
+
278: kit fox
|
299 |
+
279: Arctic fox
|
300 |
+
280: grey fox
|
301 |
+
281: tabby cat
|
302 |
+
282: tiger cat
|
303 |
+
283: Persian cat
|
304 |
+
284: Siamese cat
|
305 |
+
285: Egyptian Mau
|
306 |
+
286: cougar
|
307 |
+
287: lynx
|
308 |
+
288: leopard
|
309 |
+
289: snow leopard
|
310 |
+
290: jaguar
|
311 |
+
291: lion
|
312 |
+
292: tiger
|
313 |
+
293: cheetah
|
314 |
+
294: brown bear
|
315 |
+
295: American black bear
|
316 |
+
296: polar bear
|
317 |
+
297: sloth bear
|
318 |
+
298: mongoose
|
319 |
+
299: meerkat
|
320 |
+
300: tiger beetle
|
321 |
+
301: ladybug
|
322 |
+
302: ground beetle
|
323 |
+
303: longhorn beetle
|
324 |
+
304: leaf beetle
|
325 |
+
305: dung beetle
|
326 |
+
306: rhinoceros beetle
|
327 |
+
307: weevil
|
328 |
+
308: fly
|
329 |
+
309: bee
|
330 |
+
310: ant
|
331 |
+
311: grasshopper
|
332 |
+
312: cricket
|
333 |
+
313: stick insect
|
334 |
+
314: cockroach
|
335 |
+
315: mantis
|
336 |
+
316: cicada
|
337 |
+
317: leafhopper
|
338 |
+
318: lacewing
|
339 |
+
319: dragonfly
|
340 |
+
320: damselfly
|
341 |
+
321: red admiral
|
342 |
+
322: ringlet
|
343 |
+
323: monarch butterfly
|
344 |
+
324: small white
|
345 |
+
325: sulphur butterfly
|
346 |
+
326: gossamer-winged butterfly
|
347 |
+
327: starfish
|
348 |
+
328: sea urchin
|
349 |
+
329: sea cucumber
|
350 |
+
330: cottontail rabbit
|
351 |
+
331: hare
|
352 |
+
332: Angora rabbit
|
353 |
+
333: hamster
|
354 |
+
334: porcupine
|
355 |
+
335: fox squirrel
|
356 |
+
336: marmot
|
357 |
+
337: beaver
|
358 |
+
338: guinea pig
|
359 |
+
339: common sorrel
|
360 |
+
340: zebra
|
361 |
+
341: pig
|
362 |
+
342: wild boar
|
363 |
+
343: warthog
|
364 |
+
344: hippopotamus
|
365 |
+
345: ox
|
366 |
+
346: water buffalo
|
367 |
+
347: bison
|
368 |
+
348: ram
|
369 |
+
349: bighorn sheep
|
370 |
+
350: Alpine ibex
|
371 |
+
351: hartebeest
|
372 |
+
352: impala
|
373 |
+
353: gazelle
|
374 |
+
354: dromedary
|
375 |
+
355: llama
|
376 |
+
356: weasel
|
377 |
+
357: mink
|
378 |
+
358: European polecat
|
379 |
+
359: black-footed ferret
|
380 |
+
360: otter
|
381 |
+
361: skunk
|
382 |
+
362: badger
|
383 |
+
363: armadillo
|
384 |
+
364: three-toed sloth
|
385 |
+
365: orangutan
|
386 |
+
366: gorilla
|
387 |
+
367: chimpanzee
|
388 |
+
368: gibbon
|
389 |
+
369: siamang
|
390 |
+
370: guenon
|
391 |
+
371: patas monkey
|
392 |
+
372: baboon
|
393 |
+
373: macaque
|
394 |
+
374: langur
|
395 |
+
375: black-and-white colobus
|
396 |
+
376: proboscis monkey
|
397 |
+
377: marmoset
|
398 |
+
378: white-headed capuchin
|
399 |
+
379: howler monkey
|
400 |
+
380: titi
|
401 |
+
381: Geoffroy's spider monkey
|
402 |
+
382: common squirrel monkey
|
403 |
+
383: ring-tailed lemur
|
404 |
+
384: indri
|
405 |
+
385: Asian elephant
|
406 |
+
386: African bush elephant
|
407 |
+
387: red panda
|
408 |
+
388: giant panda
|
409 |
+
389: snoek
|
410 |
+
390: eel
|
411 |
+
391: coho salmon
|
412 |
+
392: rock beauty
|
413 |
+
393: clownfish
|
414 |
+
394: sturgeon
|
415 |
+
395: garfish
|
416 |
+
396: lionfish
|
417 |
+
397: pufferfish
|
418 |
+
398: abacus
|
419 |
+
399: abaya
|
420 |
+
400: academic gown
|
421 |
+
401: accordion
|
422 |
+
402: acoustic guitar
|
423 |
+
403: aircraft carrier
|
424 |
+
404: airliner
|
425 |
+
405: airship
|
426 |
+
406: altar
|
427 |
+
407: ambulance
|
428 |
+
408: amphibious vehicle
|
429 |
+
409: analog clock
|
430 |
+
410: apiary
|
431 |
+
411: apron
|
432 |
+
412: waste container
|
433 |
+
413: assault rifle
|
434 |
+
414: backpack
|
435 |
+
415: bakery
|
436 |
+
416: balance beam
|
437 |
+
417: balloon
|
438 |
+
418: ballpoint pen
|
439 |
+
419: Band-Aid
|
440 |
+
420: banjo
|
441 |
+
421: baluster
|
442 |
+
422: barbell
|
443 |
+
423: barber chair
|
444 |
+
424: barbershop
|
445 |
+
425: barn
|
446 |
+
426: barometer
|
447 |
+
427: barrel
|
448 |
+
428: wheelbarrow
|
449 |
+
429: baseball
|
450 |
+
430: basketball
|
451 |
+
431: bassinet
|
452 |
+
432: bassoon
|
453 |
+
433: swimming cap
|
454 |
+
434: bath towel
|
455 |
+
435: bathtub
|
456 |
+
436: station wagon
|
457 |
+
437: lighthouse
|
458 |
+
438: beaker
|
459 |
+
439: military cap
|
460 |
+
440: beer bottle
|
461 |
+
441: beer glass
|
462 |
+
442: bell-cot
|
463 |
+
443: bib
|
464 |
+
444: tandem bicycle
|
465 |
+
445: bikini
|
466 |
+
446: ring binder
|
467 |
+
447: binoculars
|
468 |
+
448: birdhouse
|
469 |
+
449: boathouse
|
470 |
+
450: bobsleigh
|
471 |
+
451: bolo tie
|
472 |
+
452: poke bonnet
|
473 |
+
453: bookcase
|
474 |
+
454: bookstore
|
475 |
+
455: bottle cap
|
476 |
+
456: bow
|
477 |
+
457: bow tie
|
478 |
+
458: brass
|
479 |
+
459: bra
|
480 |
+
460: breakwater
|
481 |
+
461: breastplate
|
482 |
+
462: broom
|
483 |
+
463: bucket
|
484 |
+
464: buckle
|
485 |
+
465: bulletproof vest
|
486 |
+
466: high-speed train
|
487 |
+
467: butcher shop
|
488 |
+
468: taxicab
|
489 |
+
469: cauldron
|
490 |
+
470: candle
|
491 |
+
471: cannon
|
492 |
+
472: canoe
|
493 |
+
473: can opener
|
494 |
+
474: cardigan
|
495 |
+
475: car mirror
|
496 |
+
476: carousel
|
497 |
+
477: tool kit
|
498 |
+
478: carton
|
499 |
+
479: car wheel
|
500 |
+
480: automated teller machine
|
501 |
+
481: cassette
|
502 |
+
482: cassette player
|
503 |
+
483: castle
|
504 |
+
484: catamaran
|
505 |
+
485: CD player
|
506 |
+
486: cello
|
507 |
+
487: mobile phone
|
508 |
+
488: chain
|
509 |
+
489: chain-link fence
|
510 |
+
490: chain mail
|
511 |
+
491: chainsaw
|
512 |
+
492: chest
|
513 |
+
493: chiffonier
|
514 |
+
494: chime
|
515 |
+
495: china cabinet
|
516 |
+
496: Christmas stocking
|
517 |
+
497: church
|
518 |
+
498: movie theater
|
519 |
+
499: cleaver
|
520 |
+
500: cliff dwelling
|
521 |
+
501: cloak
|
522 |
+
502: clogs
|
523 |
+
503: cocktail shaker
|
524 |
+
504: coffee mug
|
525 |
+
505: coffeemaker
|
526 |
+
506: coil
|
527 |
+
507: combination lock
|
528 |
+
508: computer keyboard
|
529 |
+
509: confectionery store
|
530 |
+
510: container ship
|
531 |
+
511: convertible
|
532 |
+
512: corkscrew
|
533 |
+
513: cornet
|
534 |
+
514: cowboy boot
|
535 |
+
515: cowboy hat
|
536 |
+
516: cradle
|
537 |
+
517: crane (machine)
|
538 |
+
518: crash helmet
|
539 |
+
519: crate
|
540 |
+
520: infant bed
|
541 |
+
521: Crock Pot
|
542 |
+
522: croquet ball
|
543 |
+
523: crutch
|
544 |
+
524: cuirass
|
545 |
+
525: dam
|
546 |
+
526: desk
|
547 |
+
527: desktop computer
|
548 |
+
528: rotary dial telephone
|
549 |
+
529: diaper
|
550 |
+
530: digital clock
|
551 |
+
531: digital watch
|
552 |
+
532: dining table
|
553 |
+
533: dishcloth
|
554 |
+
534: dishwasher
|
555 |
+
535: disc brake
|
556 |
+
536: dock
|
557 |
+
537: dog sled
|
558 |
+
538: dome
|
559 |
+
539: doormat
|
560 |
+
540: drilling rig
|
561 |
+
541: drum
|
562 |
+
542: drumstick
|
563 |
+
543: dumbbell
|
564 |
+
544: Dutch oven
|
565 |
+
545: electric fan
|
566 |
+
546: electric guitar
|
567 |
+
547: electric locomotive
|
568 |
+
548: entertainment center
|
569 |
+
549: envelope
|
570 |
+
550: espresso machine
|
571 |
+
551: face powder
|
572 |
+
552: feather boa
|
573 |
+
553: filing cabinet
|
574 |
+
554: fireboat
|
575 |
+
555: fire engine
|
576 |
+
556: fire screen sheet
|
577 |
+
557: flagpole
|
578 |
+
558: flute
|
579 |
+
559: folding chair
|
580 |
+
560: football helmet
|
581 |
+
561: forklift
|
582 |
+
562: fountain
|
583 |
+
563: fountain pen
|
584 |
+
564: four-poster bed
|
585 |
+
565: freight car
|
586 |
+
566: French horn
|
587 |
+
567: frying pan
|
588 |
+
568: fur coat
|
589 |
+
569: garbage truck
|
590 |
+
570: gas mask
|
591 |
+
571: gas pump
|
592 |
+
572: goblet
|
593 |
+
573: go-kart
|
594 |
+
574: golf ball
|
595 |
+
575: golf cart
|
596 |
+
576: gondola
|
597 |
+
577: gong
|
598 |
+
578: gown
|
599 |
+
579: grand piano
|
600 |
+
580: greenhouse
|
601 |
+
581: grille
|
602 |
+
582: grocery store
|
603 |
+
583: guillotine
|
604 |
+
584: barrette
|
605 |
+
585: hair spray
|
606 |
+
586: half-track
|
607 |
+
587: hammer
|
608 |
+
588: hamper
|
609 |
+
589: hair dryer
|
610 |
+
590: hand-held computer
|
611 |
+
591: handkerchief
|
612 |
+
592: hard disk drive
|
613 |
+
593: harmonica
|
614 |
+
594: harp
|
615 |
+
595: harvester
|
616 |
+
596: hatchet
|
617 |
+
597: holster
|
618 |
+
598: home theater
|
619 |
+
599: honeycomb
|
620 |
+
600: hook
|
621 |
+
601: hoop skirt
|
622 |
+
602: horizontal bar
|
623 |
+
603: horse-drawn vehicle
|
624 |
+
604: hourglass
|
625 |
+
605: iPod
|
626 |
+
606: clothes iron
|
627 |
+
607: jack-o'-lantern
|
628 |
+
608: jeans
|
629 |
+
609: jeep
|
630 |
+
610: T-shirt
|
631 |
+
611: jigsaw puzzle
|
632 |
+
612: pulled rickshaw
|
633 |
+
613: joystick
|
634 |
+
614: kimono
|
635 |
+
615: knee pad
|
636 |
+
616: knot
|
637 |
+
617: lab coat
|
638 |
+
618: ladle
|
639 |
+
619: lampshade
|
640 |
+
620: laptop computer
|
641 |
+
621: lawn mower
|
642 |
+
622: lens cap
|
643 |
+
623: paper knife
|
644 |
+
624: library
|
645 |
+
625: lifeboat
|
646 |
+
626: lighter
|
647 |
+
627: limousine
|
648 |
+
628: ocean liner
|
649 |
+
629: lipstick
|
650 |
+
630: slip-on shoe
|
651 |
+
631: lotion
|
652 |
+
632: speaker
|
653 |
+
633: loupe
|
654 |
+
634: sawmill
|
655 |
+
635: magnetic compass
|
656 |
+
636: mail bag
|
657 |
+
637: mailbox
|
658 |
+
638: tights
|
659 |
+
639: tank suit
|
660 |
+
640: manhole cover
|
661 |
+
641: maraca
|
662 |
+
642: marimba
|
663 |
+
643: mask
|
664 |
+
644: match
|
665 |
+
645: maypole
|
666 |
+
646: maze
|
667 |
+
647: measuring cup
|
668 |
+
648: medicine chest
|
669 |
+
649: megalith
|
670 |
+
650: microphone
|
671 |
+
651: microwave oven
|
672 |
+
652: military uniform
|
673 |
+
653: milk can
|
674 |
+
654: minibus
|
675 |
+
655: miniskirt
|
676 |
+
656: minivan
|
677 |
+
657: missile
|
678 |
+
658: mitten
|
679 |
+
659: mixing bowl
|
680 |
+
660: mobile home
|
681 |
+
661: Model T
|
682 |
+
662: modem
|
683 |
+
663: monastery
|
684 |
+
664: monitor
|
685 |
+
665: moped
|
686 |
+
666: mortar
|
687 |
+
667: square academic cap
|
688 |
+
668: mosque
|
689 |
+
669: mosquito net
|
690 |
+
670: scooter
|
691 |
+
671: mountain bike
|
692 |
+
672: tent
|
693 |
+
673: computer mouse
|
694 |
+
674: mousetrap
|
695 |
+
675: moving van
|
696 |
+
676: muzzle
|
697 |
+
677: nail
|
698 |
+
678: neck brace
|
699 |
+
679: necklace
|
700 |
+
680: nipple
|
701 |
+
681: notebook computer
|
702 |
+
682: obelisk
|
703 |
+
683: oboe
|
704 |
+
684: ocarina
|
705 |
+
685: odometer
|
706 |
+
686: oil filter
|
707 |
+
687: organ
|
708 |
+
688: oscilloscope
|
709 |
+
689: overskirt
|
710 |
+
690: bullock cart
|
711 |
+
691: oxygen mask
|
712 |
+
692: packet
|
713 |
+
693: paddle
|
714 |
+
694: paddle wheel
|
715 |
+
695: padlock
|
716 |
+
696: paintbrush
|
717 |
+
697: pajamas
|
718 |
+
698: palace
|
719 |
+
699: pan flute
|
720 |
+
700: paper towel
|
721 |
+
701: parachute
|
722 |
+
702: parallel bars
|
723 |
+
703: park bench
|
724 |
+
704: parking meter
|
725 |
+
705: passenger car
|
726 |
+
706: patio
|
727 |
+
707: payphone
|
728 |
+
708: pedestal
|
729 |
+
709: pencil case
|
730 |
+
710: pencil sharpener
|
731 |
+
711: perfume
|
732 |
+
712: Petri dish
|
733 |
+
713: photocopier
|
734 |
+
714: plectrum
|
735 |
+
715: Pickelhaube
|
736 |
+
716: picket fence
|
737 |
+
717: pickup truck
|
738 |
+
718: pier
|
739 |
+
719: piggy bank
|
740 |
+
720: pill bottle
|
741 |
+
721: pillow
|
742 |
+
722: ping-pong ball
|
743 |
+
723: pinwheel
|
744 |
+
724: pirate ship
|
745 |
+
725: pitcher
|
746 |
+
726: hand plane
|
747 |
+
727: planetarium
|
748 |
+
728: plastic bag
|
749 |
+
729: plate rack
|
750 |
+
730: plow
|
751 |
+
731: plunger
|
752 |
+
732: Polaroid camera
|
753 |
+
733: pole
|
754 |
+
734: police van
|
755 |
+
735: poncho
|
756 |
+
736: billiard table
|
757 |
+
737: soda bottle
|
758 |
+
738: pot
|
759 |
+
739: potter's wheel
|
760 |
+
740: power drill
|
761 |
+
741: prayer rug
|
762 |
+
742: printer
|
763 |
+
743: prison
|
764 |
+
744: projectile
|
765 |
+
745: projector
|
766 |
+
746: hockey puck
|
767 |
+
747: punching bag
|
768 |
+
748: purse
|
769 |
+
749: quill
|
770 |
+
750: quilt
|
771 |
+
751: race car
|
772 |
+
752: racket
|
773 |
+
753: radiator
|
774 |
+
754: radio
|
775 |
+
755: radio telescope
|
776 |
+
756: rain barrel
|
777 |
+
757: recreational vehicle
|
778 |
+
758: reel
|
779 |
+
759: reflex camera
|
780 |
+
760: refrigerator
|
781 |
+
761: remote control
|
782 |
+
762: restaurant
|
783 |
+
763: revolver
|
784 |
+
764: rifle
|
785 |
+
765: rocking chair
|
786 |
+
766: rotisserie
|
787 |
+
767: eraser
|
788 |
+
768: rugby ball
|
789 |
+
769: ruler
|
790 |
+
770: running shoe
|
791 |
+
771: safe
|
792 |
+
772: safety pin
|
793 |
+
773: salt shaker
|
794 |
+
774: sandal
|
795 |
+
775: sarong
|
796 |
+
776: saxophone
|
797 |
+
777: scabbard
|
798 |
+
778: weighing scale
|
799 |
+
779: school bus
|
800 |
+
780: schooner
|
801 |
+
781: scoreboard
|
802 |
+
782: CRT screen
|
803 |
+
783: screw
|
804 |
+
784: screwdriver
|
805 |
+
785: seat belt
|
806 |
+
786: sewing machine
|
807 |
+
787: shield
|
808 |
+
788: shoe store
|
809 |
+
789: shoji
|
810 |
+
790: shopping basket
|
811 |
+
791: shopping cart
|
812 |
+
792: shovel
|
813 |
+
793: shower cap
|
814 |
+
794: shower curtain
|
815 |
+
795: ski
|
816 |
+
796: ski mask
|
817 |
+
797: sleeping bag
|
818 |
+
798: slide rule
|
819 |
+
799: sliding door
|
820 |
+
800: slot machine
|
821 |
+
801: snorkel
|
822 |
+
802: snowmobile
|
823 |
+
803: snowplow
|
824 |
+
804: soap dispenser
|
825 |
+
805: soccer ball
|
826 |
+
806: sock
|
827 |
+
807: solar thermal collector
|
828 |
+
808: sombrero
|
829 |
+
809: soup bowl
|
830 |
+
810: space bar
|
831 |
+
811: space heater
|
832 |
+
812: space shuttle
|
833 |
+
813: spatula
|
834 |
+
814: motorboat
|
835 |
+
815: spider web
|
836 |
+
816: spindle
|
837 |
+
817: sports car
|
838 |
+
818: spotlight
|
839 |
+
819: stage
|
840 |
+
820: steam locomotive
|
841 |
+
821: through arch bridge
|
842 |
+
822: steel drum
|
843 |
+
823: stethoscope
|
844 |
+
824: scarf
|
845 |
+
825: stone wall
|
846 |
+
826: stopwatch
|
847 |
+
827: stove
|
848 |
+
828: strainer
|
849 |
+
829: tram
|
850 |
+
830: stretcher
|
851 |
+
831: couch
|
852 |
+
832: stupa
|
853 |
+
833: submarine
|
854 |
+
834: suit
|
855 |
+
835: sundial
|
856 |
+
836: sunglass
|
857 |
+
837: sunglasses
|
858 |
+
838: sunscreen
|
859 |
+
839: suspension bridge
|
860 |
+
840: mop
|
861 |
+
841: sweatshirt
|
862 |
+
842: swimsuit
|
863 |
+
843: swing
|
864 |
+
844: switch
|
865 |
+
845: syringe
|
866 |
+
846: table lamp
|
867 |
+
847: tank
|
868 |
+
848: tape player
|
869 |
+
849: teapot
|
870 |
+
850: teddy bear
|
871 |
+
851: television
|
872 |
+
852: tennis ball
|
873 |
+
853: thatched roof
|
874 |
+
854: front curtain
|
875 |
+
855: thimble
|
876 |
+
856: threshing machine
|
877 |
+
857: throne
|
878 |
+
858: tile roof
|
879 |
+
859: toaster
|
880 |
+
860: tobacco shop
|
881 |
+
861: toilet seat
|
882 |
+
862: torch
|
883 |
+
863: totem pole
|
884 |
+
864: tow truck
|
885 |
+
865: toy store
|
886 |
+
866: tractor
|
887 |
+
867: semi-trailer truck
|
888 |
+
868: tray
|
889 |
+
869: trench coat
|
890 |
+
870: tricycle
|
891 |
+
871: trimaran
|
892 |
+
872: tripod
|
893 |
+
873: triumphal arch
|
894 |
+
874: trolleybus
|
895 |
+
875: trombone
|
896 |
+
876: tub
|
897 |
+
877: turnstile
|
898 |
+
878: typewriter keyboard
|
899 |
+
879: umbrella
|
900 |
+
880: unicycle
|
901 |
+
881: upright piano
|
902 |
+
882: vacuum cleaner
|
903 |
+
883: vase
|
904 |
+
884: vault
|
905 |
+
885: velvet
|
906 |
+
886: vending machine
|
907 |
+
887: vestment
|
908 |
+
888: viaduct
|
909 |
+
889: violin
|
910 |
+
890: volleyball
|
911 |
+
891: waffle iron
|
912 |
+
892: wall clock
|
913 |
+
893: wallet
|
914 |
+
894: wardrobe
|
915 |
+
895: military aircraft
|
916 |
+
896: sink
|
917 |
+
897: washing machine
|
918 |
+
898: water bottle
|
919 |
+
899: water jug
|
920 |
+
900: water tower
|
921 |
+
901: whiskey jug
|
922 |
+
902: whistle
|
923 |
+
903: wig
|
924 |
+
904: window screen
|
925 |
+
905: window shade
|
926 |
+
906: Windsor tie
|
927 |
+
907: wine bottle
|
928 |
+
908: wing
|
929 |
+
909: wok
|
930 |
+
910: wooden spoon
|
931 |
+
911: wool
|
932 |
+
912: split-rail fence
|
933 |
+
913: shipwreck
|
934 |
+
914: yawl
|
935 |
+
915: yurt
|
936 |
+
916: website
|
937 |
+
917: comic book
|
938 |
+
918: crossword
|
939 |
+
919: traffic sign
|
940 |
+
920: traffic light
|
941 |
+
921: dust jacket
|
942 |
+
922: menu
|
943 |
+
923: plate
|
944 |
+
924: guacamole
|
945 |
+
925: consomme
|
946 |
+
926: hot pot
|
947 |
+
927: trifle
|
948 |
+
928: ice cream
|
949 |
+
929: ice pop
|
950 |
+
930: baguette
|
951 |
+
931: bagel
|
952 |
+
932: pretzel
|
953 |
+
933: cheeseburger
|
954 |
+
934: hot dog
|
955 |
+
935: mashed potato
|
956 |
+
936: cabbage
|
957 |
+
937: broccoli
|
958 |
+
938: cauliflower
|
959 |
+
939: zucchini
|
960 |
+
940: spaghetti squash
|
961 |
+
941: acorn squash
|
962 |
+
942: butternut squash
|
963 |
+
943: cucumber
|
964 |
+
944: artichoke
|
965 |
+
945: bell pepper
|
966 |
+
946: cardoon
|
967 |
+
947: mushroom
|
968 |
+
948: Granny Smith
|
969 |
+
949: strawberry
|
970 |
+
950: orange
|
971 |
+
951: lemon
|
972 |
+
952: fig
|
973 |
+
953: pineapple
|
974 |
+
954: banana
|
975 |
+
955: jackfruit
|
976 |
+
956: custard apple
|
977 |
+
957: pomegranate
|
978 |
+
958: hay
|
979 |
+
959: carbonara
|
980 |
+
960: chocolate syrup
|
981 |
+
961: dough
|
982 |
+
962: meatloaf
|
983 |
+
963: pizza
|
984 |
+
964: pot pie
|
985 |
+
965: burrito
|
986 |
+
966: red wine
|
987 |
+
967: espresso
|
988 |
+
968: cup
|
989 |
+
969: eggnog
|
990 |
+
970: alp
|
991 |
+
971: bubble
|
992 |
+
972: cliff
|
993 |
+
973: coral reef
|
994 |
+
974: geyser
|
995 |
+
975: lakeshore
|
996 |
+
976: promontory
|
997 |
+
977: shoal
|
998 |
+
978: seashore
|
999 |
+
979: valley
|
1000 |
+
980: volcano
|
1001 |
+
981: baseball player
|
1002 |
+
982: bridegroom
|
1003 |
+
983: scuba diver
|
1004 |
+
984: rapeseed
|
1005 |
+
985: daisy
|
1006 |
+
986: yellow lady's slipper
|
1007 |
+
987: corn
|
1008 |
+
988: acorn
|
1009 |
+
989: rose hip
|
1010 |
+
990: horse chestnut seed
|
1011 |
+
991: coral fungus
|
1012 |
+
992: agaric
|
1013 |
+
993: gyromitra
|
1014 |
+
994: stinkhorn mushroom
|
1015 |
+
995: earth star
|
1016 |
+
996: hen-of-the-woods
|
1017 |
+
997: bolete
|
1018 |
+
998: ear
|
1019 |
+
999: toilet paper
|
1020 |
+
|
1021 |
+
# Imagenet class codes to human-readable names
|
1022 |
+
map:
|
1023 |
+
n01440764: tench
|
1024 |
+
n01443537: goldfish
|
1025 |
+
n01484850: great_white_shark
|
1026 |
+
n01491361: tiger_shark
|
1027 |
+
n01494475: hammerhead
|
1028 |
+
n01496331: electric_ray
|
1029 |
+
n01498041: stingray
|
1030 |
+
n01514668: cock
|
1031 |
+
n01514859: hen
|
1032 |
+
n01518878: ostrich
|
1033 |
+
n01530575: brambling
|
1034 |
+
n01531178: goldfinch
|
1035 |
+
n01532829: house_finch
|
1036 |
+
n01534433: junco
|
1037 |
+
n01537544: indigo_bunting
|
1038 |
+
n01558993: robin
|
1039 |
+
n01560419: bulbul
|
1040 |
+
n01580077: jay
|
1041 |
+
n01582220: magpie
|
1042 |
+
n01592084: chickadee
|
1043 |
+
n01601694: water_ouzel
|
1044 |
+
n01608432: kite
|
1045 |
+
n01614925: bald_eagle
|
1046 |
+
n01616318: vulture
|
1047 |
+
n01622779: great_grey_owl
|
1048 |
+
n01629819: European_fire_salamander
|
1049 |
+
n01630670: common_newt
|
1050 |
+
n01631663: eft
|
1051 |
+
n01632458: spotted_salamander
|
1052 |
+
n01632777: axolotl
|
1053 |
+
n01641577: bullfrog
|
1054 |
+
n01644373: tree_frog
|
1055 |
+
n01644900: tailed_frog
|
1056 |
+
n01664065: loggerhead
|
1057 |
+
n01665541: leatherback_turtle
|
1058 |
+
n01667114: mud_turtle
|
1059 |
+
n01667778: terrapin
|
1060 |
+
n01669191: box_turtle
|
1061 |
+
n01675722: banded_gecko
|
1062 |
+
n01677366: common_iguana
|
1063 |
+
n01682714: American_chameleon
|
1064 |
+
n01685808: whiptail
|
1065 |
+
n01687978: agama
|
1066 |
+
n01688243: frilled_lizard
|
1067 |
+
n01689811: alligator_lizard
|
1068 |
+
n01692333: Gila_monster
|
1069 |
+
n01693334: green_lizard
|
1070 |
+
n01694178: African_chameleon
|
1071 |
+
n01695060: Komodo_dragon
|
1072 |
+
n01697457: African_crocodile
|
1073 |
+
n01698640: American_alligator
|
1074 |
+
n01704323: triceratops
|
1075 |
+
n01728572: thunder_snake
|
1076 |
+
n01728920: ringneck_snake
|
1077 |
+
n01729322: hognose_snake
|
1078 |
+
n01729977: green_snake
|
1079 |
+
n01734418: king_snake
|
1080 |
+
n01735189: garter_snake
|
1081 |
+
n01737021: water_snake
|
1082 |
+
n01739381: vine_snake
|
1083 |
+
n01740131: night_snake
|
1084 |
+
n01742172: boa_constrictor
|
1085 |
+
n01744401: rock_python
|
1086 |
+
n01748264: Indian_cobra
|
1087 |
+
n01749939: green_mamba
|
1088 |
+
n01751748: sea_snake
|
1089 |
+
n01753488: horned_viper
|
1090 |
+
n01755581: diamondback
|
1091 |
+
n01756291: sidewinder
|
1092 |
+
n01768244: trilobite
|
1093 |
+
n01770081: harvestman
|
1094 |
+
n01770393: scorpion
|
1095 |
+
n01773157: black_and_gold_garden_spider
|
1096 |
+
n01773549: barn_spider
|
1097 |
+
n01773797: garden_spider
|
1098 |
+
n01774384: black_widow
|
1099 |
+
n01774750: tarantula
|
1100 |
+
n01775062: wolf_spider
|
1101 |
+
n01776313: tick
|
1102 |
+
n01784675: centipede
|
1103 |
+
n01795545: black_grouse
|
1104 |
+
n01796340: ptarmigan
|
1105 |
+
n01797886: ruffed_grouse
|
1106 |
+
n01798484: prairie_chicken
|
1107 |
+
n01806143: peacock
|
1108 |
+
n01806567: quail
|
1109 |
+
n01807496: partridge
|
1110 |
+
n01817953: African_grey
|
1111 |
+
n01818515: macaw
|
1112 |
+
n01819313: sulphur-crested_cockatoo
|
1113 |
+
n01820546: lorikeet
|
1114 |
+
n01824575: coucal
|
1115 |
+
n01828970: bee_eater
|
1116 |
+
n01829413: hornbill
|
1117 |
+
n01833805: hummingbird
|
1118 |
+
n01843065: jacamar
|
1119 |
+
n01843383: toucan
|
1120 |
+
n01847000: drake
|
1121 |
+
n01855032: red-breasted_merganser
|
1122 |
+
n01855672: goose
|
1123 |
+
n01860187: black_swan
|
1124 |
+
n01871265: tusker
|
1125 |
+
n01872401: echidna
|
1126 |
+
n01873310: platypus
|
1127 |
+
n01877812: wallaby
|
1128 |
+
n01882714: koala
|
1129 |
+
n01883070: wombat
|
1130 |
+
n01910747: jellyfish
|
1131 |
+
n01914609: sea_anemone
|
1132 |
+
n01917289: brain_coral
|
1133 |
+
n01924916: flatworm
|
1134 |
+
n01930112: nematode
|
1135 |
+
n01943899: conch
|
1136 |
+
n01944390: snail
|
1137 |
+
n01945685: slug
|
1138 |
+
n01950731: sea_slug
|
1139 |
+
n01955084: chiton
|
1140 |
+
n01968897: chambered_nautilus
|
1141 |
+
n01978287: Dungeness_crab
|
1142 |
+
n01978455: rock_crab
|
1143 |
+
n01980166: fiddler_crab
|
1144 |
+
n01981276: king_crab
|
1145 |
+
n01983481: American_lobster
|
1146 |
+
n01984695: spiny_lobster
|
1147 |
+
n01985128: crayfish
|
1148 |
+
n01986214: hermit_crab
|
1149 |
+
n01990800: isopod
|
1150 |
+
n02002556: white_stork
|
1151 |
+
n02002724: black_stork
|
1152 |
+
n02006656: spoonbill
|
1153 |
+
n02007558: flamingo
|
1154 |
+
n02009229: little_blue_heron
|
1155 |
+
n02009912: American_egret
|
1156 |
+
n02011460: bittern
|
1157 |
+
n02012849: crane_(bird)
|
1158 |
+
n02013706: limpkin
|
1159 |
+
n02017213: European_gallinule
|
1160 |
+
n02018207: American_coot
|
1161 |
+
n02018795: bustard
|
1162 |
+
n02025239: ruddy_turnstone
|
1163 |
+
n02027492: red-backed_sandpiper
|
1164 |
+
n02028035: redshank
|
1165 |
+
n02033041: dowitcher
|
1166 |
+
n02037110: oystercatcher
|
1167 |
+
n02051845: pelican
|
1168 |
+
n02056570: king_penguin
|
1169 |
+
n02058221: albatross
|
1170 |
+
n02066245: grey_whale
|
1171 |
+
n02071294: killer_whale
|
1172 |
+
n02074367: dugong
|
1173 |
+
n02077923: sea_lion
|
1174 |
+
n02085620: Chihuahua
|
1175 |
+
n02085782: Japanese_spaniel
|
1176 |
+
n02085936: Maltese_dog
|
1177 |
+
n02086079: Pekinese
|
1178 |
+
n02086240: Shih-Tzu
|
1179 |
+
n02086646: Blenheim_spaniel
|
1180 |
+
n02086910: papillon
|
1181 |
+
n02087046: toy_terrier
|
1182 |
+
n02087394: Rhodesian_ridgeback
|
1183 |
+
n02088094: Afghan_hound
|
1184 |
+
n02088238: basset
|
1185 |
+
n02088364: beagle
|
1186 |
+
n02088466: bloodhound
|
1187 |
+
n02088632: bluetick
|
1188 |
+
n02089078: black-and-tan_coonhound
|
1189 |
+
n02089867: Walker_hound
|
1190 |
+
n02089973: English_foxhound
|
1191 |
+
n02090379: redbone
|
1192 |
+
n02090622: borzoi
|
1193 |
+
n02090721: Irish_wolfhound
|
1194 |
+
n02091032: Italian_greyhound
|
1195 |
+
n02091134: whippet
|
1196 |
+
n02091244: Ibizan_hound
|
1197 |
+
n02091467: Norwegian_elkhound
|
1198 |
+
n02091635: otterhound
|
1199 |
+
n02091831: Saluki
|
1200 |
+
n02092002: Scottish_deerhound
|
1201 |
+
n02092339: Weimaraner
|
1202 |
+
n02093256: Staffordshire_bullterrier
|
1203 |
+
n02093428: American_Staffordshire_terrier
|
1204 |
+
n02093647: Bedlington_terrier
|
1205 |
+
n02093754: Border_terrier
|
1206 |
+
n02093859: Kerry_blue_terrier
|
1207 |
+
n02093991: Irish_terrier
|
1208 |
+
n02094114: Norfolk_terrier
|
1209 |
+
n02094258: Norwich_terrier
|
1210 |
+
n02094433: Yorkshire_terrier
|
1211 |
+
n02095314: wire-haired_fox_terrier
|
1212 |
+
n02095570: Lakeland_terrier
|
1213 |
+
n02095889: Sealyham_terrier
|
1214 |
+
n02096051: Airedale
|
1215 |
+
n02096177: cairn
|
1216 |
+
n02096294: Australian_terrier
|
1217 |
+
n02096437: Dandie_Dinmont
|
1218 |
+
n02096585: Boston_bull
|
1219 |
+
n02097047: miniature_schnauzer
|
1220 |
+
n02097130: giant_schnauzer
|
1221 |
+
n02097209: standard_schnauzer
|
1222 |
+
n02097298: Scotch_terrier
|
1223 |
+
n02097474: Tibetan_terrier
|
1224 |
+
n02097658: silky_terrier
|
1225 |
+
n02098105: soft-coated_wheaten_terrier
|
1226 |
+
n02098286: West_Highland_white_terrier
|
1227 |
+
n02098413: Lhasa
|
1228 |
+
n02099267: flat-coated_retriever
|
1229 |
+
n02099429: curly-coated_retriever
|
1230 |
+
n02099601: golden_retriever
|
1231 |
+
n02099712: Labrador_retriever
|
1232 |
+
n02099849: Chesapeake_Bay_retriever
|
1233 |
+
n02100236: German_short-haired_pointer
|
1234 |
+
n02100583: vizsla
|
1235 |
+
n02100735: English_setter
|
1236 |
+
n02100877: Irish_setter
|
1237 |
+
n02101006: Gordon_setter
|
1238 |
+
n02101388: Brittany_spaniel
|
1239 |
+
n02101556: clumber
|
1240 |
+
n02102040: English_springer
|
1241 |
+
n02102177: Welsh_springer_spaniel
|
1242 |
+
n02102318: cocker_spaniel
|
1243 |
+
n02102480: Sussex_spaniel
|
1244 |
+
n02102973: Irish_water_spaniel
|
1245 |
+
n02104029: kuvasz
|
1246 |
+
n02104365: schipperke
|
1247 |
+
n02105056: groenendael
|
1248 |
+
n02105162: malinois
|
1249 |
+
n02105251: briard
|
1250 |
+
n02105412: kelpie
|
1251 |
+
n02105505: komondor
|
1252 |
+
n02105641: Old_English_sheepdog
|
1253 |
+
n02105855: Shetland_sheepdog
|
1254 |
+
n02106030: collie
|
1255 |
+
n02106166: Border_collie
|
1256 |
+
n02106382: Bouvier_des_Flandres
|
1257 |
+
n02106550: Rottweiler
|
1258 |
+
n02106662: German_shepherd
|
1259 |
+
n02107142: Doberman
|
1260 |
+
n02107312: miniature_pinscher
|
1261 |
+
n02107574: Greater_Swiss_Mountain_dog
|
1262 |
+
n02107683: Bernese_mountain_dog
|
1263 |
+
n02107908: Appenzeller
|
1264 |
+
n02108000: EntleBucher
|
1265 |
+
n02108089: boxer
|
1266 |
+
n02108422: bull_mastiff
|
1267 |
+
n02108551: Tibetan_mastiff
|
1268 |
+
n02108915: French_bulldog
|
1269 |
+
n02109047: Great_Dane
|
1270 |
+
n02109525: Saint_Bernard
|
1271 |
+
n02109961: Eskimo_dog
|
1272 |
+
n02110063: malamute
|
1273 |
+
n02110185: Siberian_husky
|
1274 |
+
n02110341: dalmatian
|
1275 |
+
n02110627: affenpinscher
|
1276 |
+
n02110806: basenji
|
1277 |
+
n02110958: pug
|
1278 |
+
n02111129: Leonberg
|
1279 |
+
n02111277: Newfoundland
|
1280 |
+
n02111500: Great_Pyrenees
|
1281 |
+
n02111889: Samoyed
|
1282 |
+
n02112018: Pomeranian
|
1283 |
+
n02112137: chow
|
1284 |
+
n02112350: keeshond
|
1285 |
+
n02112706: Brabancon_griffon
|
1286 |
+
n02113023: Pembroke
|
1287 |
+
n02113186: Cardigan
|
1288 |
+
n02113624: toy_poodle
|
1289 |
+
n02113712: miniature_poodle
|
1290 |
+
n02113799: standard_poodle
|
1291 |
+
n02113978: Mexican_hairless
|
1292 |
+
n02114367: timber_wolf
|
1293 |
+
n02114548: white_wolf
|
1294 |
+
n02114712: red_wolf
|
1295 |
+
n02114855: coyote
|
1296 |
+
n02115641: dingo
|
1297 |
+
n02115913: dhole
|
1298 |
+
n02116738: African_hunting_dog
|
1299 |
+
n02117135: hyena
|
1300 |
+
n02119022: red_fox
|
1301 |
+
n02119789: kit_fox
|
1302 |
+
n02120079: Arctic_fox
|
1303 |
+
n02120505: grey_fox
|
1304 |
+
n02123045: tabby
|
1305 |
+
n02123159: tiger_cat
|
1306 |
+
n02123394: Persian_cat
|
1307 |
+
n02123597: Siamese_cat
|
1308 |
+
n02124075: Egyptian_cat
|
1309 |
+
n02125311: cougar
|
1310 |
+
n02127052: lynx
|
1311 |
+
n02128385: leopard
|
1312 |
+
n02128757: snow_leopard
|
1313 |
+
n02128925: jaguar
|
1314 |
+
n02129165: lion
|
1315 |
+
n02129604: tiger
|
1316 |
+
n02130308: cheetah
|
1317 |
+
n02132136: brown_bear
|
1318 |
+
n02133161: American_black_bear
|
1319 |
+
n02134084: ice_bear
|
1320 |
+
n02134418: sloth_bear
|
1321 |
+
n02137549: mongoose
|
1322 |
+
n02138441: meerkat
|
1323 |
+
n02165105: tiger_beetle
|
1324 |
+
n02165456: ladybug
|
1325 |
+
n02167151: ground_beetle
|
1326 |
+
n02168699: long-horned_beetle
|
1327 |
+
n02169497: leaf_beetle
|
1328 |
+
n02172182: dung_beetle
|
1329 |
+
n02174001: rhinoceros_beetle
|
1330 |
+
n02177972: weevil
|
1331 |
+
n02190166: fly
|
1332 |
+
n02206856: bee
|
1333 |
+
n02219486: ant
|
1334 |
+
n02226429: grasshopper
|
1335 |
+
n02229544: cricket
|
1336 |
+
n02231487: walking_stick
|
1337 |
+
n02233338: cockroach
|
1338 |
+
n02236044: mantis
|
1339 |
+
n02256656: cicada
|
1340 |
+
n02259212: leafhopper
|
1341 |
+
n02264363: lacewing
|
1342 |
+
n02268443: dragonfly
|
1343 |
+
n02268853: damselfly
|
1344 |
+
n02276258: admiral
|
1345 |
+
n02277742: ringlet
|
1346 |
+
n02279972: monarch
|
1347 |
+
n02280649: cabbage_butterfly
|
1348 |
+
n02281406: sulphur_butterfly
|
1349 |
+
n02281787: lycaenid
|
1350 |
+
n02317335: starfish
|
1351 |
+
n02319095: sea_urchin
|
1352 |
+
n02321529: sea_cucumber
|
1353 |
+
n02325366: wood_rabbit
|
1354 |
+
n02326432: hare
|
1355 |
+
n02328150: Angora
|
1356 |
+
n02342885: hamster
|
1357 |
+
n02346627: porcupine
|
1358 |
+
n02356798: fox_squirrel
|
1359 |
+
n02361337: marmot
|
1360 |
+
n02363005: beaver
|
1361 |
+
n02364673: guinea_pig
|
1362 |
+
n02389026: sorrel
|
1363 |
+
n02391049: zebra
|
1364 |
+
n02395406: hog
|
1365 |
+
n02396427: wild_boar
|
1366 |
+
n02397096: warthog
|
1367 |
+
n02398521: hippopotamus
|
1368 |
+
n02403003: ox
|
1369 |
+
n02408429: water_buffalo
|
1370 |
+
n02410509: bison
|
1371 |
+
n02412080: ram
|
1372 |
+
n02415577: bighorn
|
1373 |
+
n02417914: ibex
|
1374 |
+
n02422106: hartebeest
|
1375 |
+
n02422699: impala
|
1376 |
+
n02423022: gazelle
|
1377 |
+
n02437312: Arabian_camel
|
1378 |
+
n02437616: llama
|
1379 |
+
n02441942: weasel
|
1380 |
+
n02442845: mink
|
1381 |
+
n02443114: polecat
|
1382 |
+
n02443484: black-footed_ferret
|
1383 |
+
n02444819: otter
|
1384 |
+
n02445715: skunk
|
1385 |
+
n02447366: badger
|
1386 |
+
n02454379: armadillo
|
1387 |
+
n02457408: three-toed_sloth
|
1388 |
+
n02480495: orangutan
|
1389 |
+
n02480855: gorilla
|
1390 |
+
n02481823: chimpanzee
|
1391 |
+
n02483362: gibbon
|
1392 |
+
n02483708: siamang
|
1393 |
+
n02484975: guenon
|
1394 |
+
n02486261: patas
|
1395 |
+
n02486410: baboon
|
1396 |
+
n02487347: macaque
|
1397 |
+
n02488291: langur
|
1398 |
+
n02488702: colobus
|
1399 |
+
n02489166: proboscis_monkey
|
1400 |
+
n02490219: marmoset
|
1401 |
+
n02492035: capuchin
|
1402 |
+
n02492660: howler_monkey
|
1403 |
+
n02493509: titi
|
1404 |
+
n02493793: spider_monkey
|
1405 |
+
n02494079: squirrel_monkey
|
1406 |
+
n02497673: Madagascar_cat
|
1407 |
+
n02500267: indri
|
1408 |
+
n02504013: Indian_elephant
|
1409 |
+
n02504458: African_elephant
|
1410 |
+
n02509815: lesser_panda
|
1411 |
+
n02510455: giant_panda
|
1412 |
+
n02514041: barracouta
|
1413 |
+
n02526121: eel
|
1414 |
+
n02536864: coho
|
1415 |
+
n02606052: rock_beauty
|
1416 |
+
n02607072: anemone_fish
|
1417 |
+
n02640242: sturgeon
|
1418 |
+
n02641379: gar
|
1419 |
+
n02643566: lionfish
|
1420 |
+
n02655020: puffer
|
1421 |
+
n02666196: abacus
|
1422 |
+
n02667093: abaya
|
1423 |
+
n02669723: academic_gown
|
1424 |
+
n02672831: accordion
|
1425 |
+
n02676566: acoustic_guitar
|
1426 |
+
n02687172: aircraft_carrier
|
1427 |
+
n02690373: airliner
|
1428 |
+
n02692877: airship
|
1429 |
+
n02699494: altar
|
1430 |
+
n02701002: ambulance
|
1431 |
+
n02704792: amphibian
|
1432 |
+
n02708093: analog_clock
|
1433 |
+
n02727426: apiary
|
1434 |
+
n02730930: apron
|
1435 |
+
n02747177: ashcan
|
1436 |
+
n02749479: assault_rifle
|
1437 |
+
n02769748: backpack
|
1438 |
+
n02776631: bakery
|
1439 |
+
n02777292: balance_beam
|
1440 |
+
n02782093: balloon
|
1441 |
+
n02783161: ballpoint
|
1442 |
+
n02786058: Band_Aid
|
1443 |
+
n02787622: banjo
|
1444 |
+
n02788148: bannister
|
1445 |
+
n02790996: barbell
|
1446 |
+
n02791124: barber_chair
|
1447 |
+
n02791270: barbershop
|
1448 |
+
n02793495: barn
|
1449 |
+
n02794156: barometer
|
1450 |
+
n02795169: barrel
|
1451 |
+
n02797295: barrow
|
1452 |
+
n02799071: baseball
|
1453 |
+
n02802426: basketball
|
1454 |
+
n02804414: bassinet
|
1455 |
+
n02804610: bassoon
|
1456 |
+
n02807133: bathing_cap
|
1457 |
+
n02808304: bath_towel
|
1458 |
+
n02808440: bathtub
|
1459 |
+
n02814533: beach_wagon
|
1460 |
+
n02814860: beacon
|
1461 |
+
n02815834: beaker
|
1462 |
+
n02817516: bearskin
|
1463 |
+
n02823428: beer_bottle
|
1464 |
+
n02823750: beer_glass
|
1465 |
+
n02825657: bell_cote
|
1466 |
+
n02834397: bib
|
1467 |
+
n02835271: bicycle-built-for-two
|
1468 |
+
n02837789: bikini
|
1469 |
+
n02840245: binder
|
1470 |
+
n02841315: binoculars
|
1471 |
+
n02843684: birdhouse
|
1472 |
+
n02859443: boathouse
|
1473 |
+
n02860847: bobsled
|
1474 |
+
n02865351: bolo_tie
|
1475 |
+
n02869837: bonnet
|
1476 |
+
n02870880: bookcase
|
1477 |
+
n02871525: bookshop
|
1478 |
+
n02877765: bottlecap
|
1479 |
+
n02879718: bow
|
1480 |
+
n02883205: bow_tie
|
1481 |
+
n02892201: brass
|
1482 |
+
n02892767: brassiere
|
1483 |
+
n02894605: breakwater
|
1484 |
+
n02895154: breastplate
|
1485 |
+
n02906734: broom
|
1486 |
+
n02909870: bucket
|
1487 |
+
n02910353: buckle
|
1488 |
+
n02916936: bulletproof_vest
|
1489 |
+
n02917067: bullet_train
|
1490 |
+
n02927161: butcher_shop
|
1491 |
+
n02930766: cab
|
1492 |
+
n02939185: caldron
|
1493 |
+
n02948072: candle
|
1494 |
+
n02950826: cannon
|
1495 |
+
n02951358: canoe
|
1496 |
+
n02951585: can_opener
|
1497 |
+
n02963159: cardigan
|
1498 |
+
n02965783: car_mirror
|
1499 |
+
n02966193: carousel
|
1500 |
+
n02966687: carpenter's_kit
|
1501 |
+
n02971356: carton
|
1502 |
+
n02974003: car_wheel
|
1503 |
+
n02977058: cash_machine
|
1504 |
+
n02978881: cassette
|
1505 |
+
n02979186: cassette_player
|
1506 |
+
n02980441: castle
|
1507 |
+
n02981792: catamaran
|
1508 |
+
n02988304: CD_player
|
1509 |
+
n02992211: cello
|
1510 |
+
n02992529: cellular_telephone
|
1511 |
+
n02999410: chain
|
1512 |
+
n03000134: chainlink_fence
|
1513 |
+
n03000247: chain_mail
|
1514 |
+
n03000684: chain_saw
|
1515 |
+
n03014705: chest
|
1516 |
+
n03016953: chiffonier
|
1517 |
+
n03017168: chime
|
1518 |
+
n03018349: china_cabinet
|
1519 |
+
n03026506: Christmas_stocking
|
1520 |
+
n03028079: church
|
1521 |
+
n03032252: cinema
|
1522 |
+
n03041632: cleaver
|
1523 |
+
n03042490: cliff_dwelling
|
1524 |
+
n03045698: cloak
|
1525 |
+
n03047690: clog
|
1526 |
+
n03062245: cocktail_shaker
|
1527 |
+
n03063599: coffee_mug
|
1528 |
+
n03063689: coffeepot
|
1529 |
+
n03065424: coil
|
1530 |
+
n03075370: combination_lock
|
1531 |
+
n03085013: computer_keyboard
|
1532 |
+
n03089624: confectionery
|
1533 |
+
n03095699: container_ship
|
1534 |
+
n03100240: convertible
|
1535 |
+
n03109150: corkscrew
|
1536 |
+
n03110669: cornet
|
1537 |
+
n03124043: cowboy_boot
|
1538 |
+
n03124170: cowboy_hat
|
1539 |
+
n03125729: cradle
|
1540 |
+
n03126707: crane_(machine)
|
1541 |
+
n03127747: crash_helmet
|
1542 |
+
n03127925: crate
|
1543 |
+
n03131574: crib
|
1544 |
+
n03133878: Crock_Pot
|
1545 |
+
n03134739: croquet_ball
|
1546 |
+
n03141823: crutch
|
1547 |
+
n03146219: cuirass
|
1548 |
+
n03160309: dam
|
1549 |
+
n03179701: desk
|
1550 |
+
n03180011: desktop_computer
|
1551 |
+
n03187595: dial_telephone
|
1552 |
+
n03188531: diaper
|
1553 |
+
n03196217: digital_clock
|
1554 |
+
n03197337: digital_watch
|
1555 |
+
n03201208: dining_table
|
1556 |
+
n03207743: dishrag
|
1557 |
+
n03207941: dishwasher
|
1558 |
+
n03208938: disk_brake
|
1559 |
+
n03216828: dock
|
1560 |
+
n03218198: dogsled
|
1561 |
+
n03220513: dome
|
1562 |
+
n03223299: doormat
|
1563 |
+
n03240683: drilling_platform
|
1564 |
+
n03249569: drum
|
1565 |
+
n03250847: drumstick
|
1566 |
+
n03255030: dumbbell
|
1567 |
+
n03259280: Dutch_oven
|
1568 |
+
n03271574: electric_fan
|
1569 |
+
n03272010: electric_guitar
|
1570 |
+
n03272562: electric_locomotive
|
1571 |
+
n03290653: entertainment_center
|
1572 |
+
n03291819: envelope
|
1573 |
+
n03297495: espresso_maker
|
1574 |
+
n03314780: face_powder
|
1575 |
+
n03325584: feather_boa
|
1576 |
+
n03337140: file
|
1577 |
+
n03344393: fireboat
|
1578 |
+
n03345487: fire_engine
|
1579 |
+
n03347037: fire_screen
|
1580 |
+
n03355925: flagpole
|
1581 |
+
n03372029: flute
|
1582 |
+
n03376595: folding_chair
|
1583 |
+
n03379051: football_helmet
|
1584 |
+
n03384352: forklift
|
1585 |
+
n03388043: fountain
|
1586 |
+
n03388183: fountain_pen
|
1587 |
+
n03388549: four-poster
|
1588 |
+
n03393912: freight_car
|
1589 |
+
n03394916: French_horn
|
1590 |
+
n03400231: frying_pan
|
1591 |
+
n03404251: fur_coat
|
1592 |
+
n03417042: garbage_truck
|
1593 |
+
n03424325: gasmask
|
1594 |
+
n03425413: gas_pump
|
1595 |
+
n03443371: goblet
|
1596 |
+
n03444034: go-kart
|
1597 |
+
n03445777: golf_ball
|
1598 |
+
n03445924: golfcart
|
1599 |
+
n03447447: gondola
|
1600 |
+
n03447721: gong
|
1601 |
+
n03450230: gown
|
1602 |
+
n03452741: grand_piano
|
1603 |
+
n03457902: greenhouse
|
1604 |
+
n03459775: grille
|
1605 |
+
n03461385: grocery_store
|
1606 |
+
n03467068: guillotine
|
1607 |
+
n03476684: hair_slide
|
1608 |
+
n03476991: hair_spray
|
1609 |
+
n03478589: half_track
|
1610 |
+
n03481172: hammer
|
1611 |
+
n03482405: hamper
|
1612 |
+
n03483316: hand_blower
|
1613 |
+
n03485407: hand-held_computer
|
1614 |
+
n03485794: handkerchief
|
1615 |
+
n03492542: hard_disc
|
1616 |
+
n03494278: harmonica
|
1617 |
+
n03495258: harp
|
1618 |
+
n03496892: harvester
|
1619 |
+
n03498962: hatchet
|
1620 |
+
n03527444: holster
|
1621 |
+
n03529860: home_theater
|
1622 |
+
n03530642: honeycomb
|
1623 |
+
n03532672: hook
|
1624 |
+
n03534580: hoopskirt
|
1625 |
+
n03535780: horizontal_bar
|
1626 |
+
n03538406: horse_cart
|
1627 |
+
n03544143: hourglass
|
1628 |
+
n03584254: iPod
|
1629 |
+
n03584829: iron
|
1630 |
+
n03590841: jack-o'-lantern
|
1631 |
+
n03594734: jean
|
1632 |
+
n03594945: jeep
|
1633 |
+
n03595614: jersey
|
1634 |
+
n03598930: jigsaw_puzzle
|
1635 |
+
n03599486: jinrikisha
|
1636 |
+
n03602883: joystick
|
1637 |
+
n03617480: kimono
|
1638 |
+
n03623198: knee_pad
|
1639 |
+
n03627232: knot
|
1640 |
+
n03630383: lab_coat
|
1641 |
+
n03633091: ladle
|
1642 |
+
n03637318: lampshade
|
1643 |
+
n03642806: laptop
|
1644 |
+
n03649909: lawn_mower
|
1645 |
+
n03657121: lens_cap
|
1646 |
+
n03658185: letter_opener
|
1647 |
+
n03661043: library
|
1648 |
+
n03662601: lifeboat
|
1649 |
+
n03666591: lighter
|
1650 |
+
n03670208: limousine
|
1651 |
+
n03673027: liner
|
1652 |
+
n03676483: lipstick
|
1653 |
+
n03680355: Loafer
|
1654 |
+
n03690938: lotion
|
1655 |
+
n03691459: loudspeaker
|
1656 |
+
n03692522: loupe
|
1657 |
+
n03697007: lumbermill
|
1658 |
+
n03706229: magnetic_compass
|
1659 |
+
n03709823: mailbag
|
1660 |
+
n03710193: mailbox
|
1661 |
+
n03710637: maillot_(tights)
|
1662 |
+
n03710721: maillot_(tank_suit)
|
1663 |
+
n03717622: manhole_cover
|
1664 |
+
n03720891: maraca
|
1665 |
+
n03721384: marimba
|
1666 |
+
n03724870: mask
|
1667 |
+
n03729826: matchstick
|
1668 |
+
n03733131: maypole
|
1669 |
+
n03733281: maze
|
1670 |
+
n03733805: measuring_cup
|
1671 |
+
n03742115: medicine_chest
|
1672 |
+
n03743016: megalith
|
1673 |
+
n03759954: microphone
|
1674 |
+
n03761084: microwave
|
1675 |
+
n03763968: military_uniform
|
1676 |
+
n03764736: milk_can
|
1677 |
+
n03769881: minibus
|
1678 |
+
n03770439: miniskirt
|
1679 |
+
n03770679: minivan
|
1680 |
+
n03773504: missile
|
1681 |
+
n03775071: mitten
|
1682 |
+
n03775546: mixing_bowl
|
1683 |
+
n03776460: mobile_home
|
1684 |
+
n03777568: Model_T
|
1685 |
+
n03777754: modem
|
1686 |
+
n03781244: monastery
|
1687 |
+
n03782006: monitor
|
1688 |
+
n03785016: moped
|
1689 |
+
n03786901: mortar
|
1690 |
+
n03787032: mortarboard
|
1691 |
+
n03788195: mosque
|
1692 |
+
n03788365: mosquito_net
|
1693 |
+
n03791053: motor_scooter
|
1694 |
+
n03792782: mountain_bike
|
1695 |
+
n03792972: mountain_tent
|
1696 |
+
n03793489: mouse
|
1697 |
+
n03794056: mousetrap
|
1698 |
+
n03796401: moving_van
|
1699 |
+
n03803284: muzzle
|
1700 |
+
n03804744: nail
|
1701 |
+
n03814639: neck_brace
|
1702 |
+
n03814906: necklace
|
1703 |
+
n03825788: nipple
|
1704 |
+
n03832673: notebook
|
1705 |
+
n03837869: obelisk
|
1706 |
+
n03838899: oboe
|
1707 |
+
n03840681: ocarina
|
1708 |
+
n03841143: odometer
|
1709 |
+
n03843555: oil_filter
|
1710 |
+
n03854065: organ
|
1711 |
+
n03857828: oscilloscope
|
1712 |
+
n03866082: overskirt
|
1713 |
+
n03868242: oxcart
|
1714 |
+
n03868863: oxygen_mask
|
1715 |
+
n03871628: packet
|
1716 |
+
n03873416: paddle
|
1717 |
+
n03874293: paddlewheel
|
1718 |
+
n03874599: padlock
|
1719 |
+
n03876231: paintbrush
|
1720 |
+
n03877472: pajama
|
1721 |
+
n03877845: palace
|
1722 |
+
n03884397: panpipe
|
1723 |
+
n03887697: paper_towel
|
1724 |
+
n03888257: parachute
|
1725 |
+
n03888605: parallel_bars
|
1726 |
+
n03891251: park_bench
|
1727 |
+
n03891332: parking_meter
|
1728 |
+
n03895866: passenger_car
|
1729 |
+
n03899768: patio
|
1730 |
+
n03902125: pay-phone
|
1731 |
+
n03903868: pedestal
|
1732 |
+
n03908618: pencil_box
|
1733 |
+
n03908714: pencil_sharpener
|
1734 |
+
n03916031: perfume
|
1735 |
+
n03920288: Petri_dish
|
1736 |
+
n03924679: photocopier
|
1737 |
+
n03929660: pick
|
1738 |
+
n03929855: pickelhaube
|
1739 |
+
n03930313: picket_fence
|
1740 |
+
n03930630: pickup
|
1741 |
+
n03933933: pier
|
1742 |
+
n03935335: piggy_bank
|
1743 |
+
n03937543: pill_bottle
|
1744 |
+
n03938244: pillow
|
1745 |
+
n03942813: ping-pong_ball
|
1746 |
+
n03944341: pinwheel
|
1747 |
+
n03947888: pirate
|
1748 |
+
n03950228: pitcher
|
1749 |
+
n03954731: plane
|
1750 |
+
n03956157: planetarium
|
1751 |
+
n03958227: plastic_bag
|
1752 |
+
n03961711: plate_rack
|
1753 |
+
n03967562: plow
|
1754 |
+
n03970156: plunger
|
1755 |
+
n03976467: Polaroid_camera
|
1756 |
+
n03976657: pole
|
1757 |
+
n03977966: police_van
|
1758 |
+
n03980874: poncho
|
1759 |
+
n03982430: pool_table
|
1760 |
+
n03983396: pop_bottle
|
1761 |
+
n03991062: pot
|
1762 |
+
n03992509: potter's_wheel
|
1763 |
+
n03995372: power_drill
|
1764 |
+
n03998194: prayer_rug
|
1765 |
+
n04004767: printer
|
1766 |
+
n04005630: prison
|
1767 |
+
n04008634: projectile
|
1768 |
+
n04009552: projector
|
1769 |
+
n04019541: puck
|
1770 |
+
n04023962: punching_bag
|
1771 |
+
n04026417: purse
|
1772 |
+
n04033901: quill
|
1773 |
+
n04033995: quilt
|
1774 |
+
n04037443: racer
|
1775 |
+
n04039381: racket
|
1776 |
+
n04040759: radiator
|
1777 |
+
n04041544: radio
|
1778 |
+
n04044716: radio_telescope
|
1779 |
+
n04049303: rain_barrel
|
1780 |
+
n04065272: recreational_vehicle
|
1781 |
+
n04067472: reel
|
1782 |
+
n04069434: reflex_camera
|
1783 |
+
n04070727: refrigerator
|
1784 |
+
n04074963: remote_control
|
1785 |
+
n04081281: restaurant
|
1786 |
+
n04086273: revolver
|
1787 |
+
n04090263: rifle
|
1788 |
+
n04099969: rocking_chair
|
1789 |
+
n04111531: rotisserie
|
1790 |
+
n04116512: rubber_eraser
|
1791 |
+
n04118538: rugby_ball
|
1792 |
+
n04118776: rule
|
1793 |
+
n04120489: running_shoe
|
1794 |
+
n04125021: safe
|
1795 |
+
n04127249: safety_pin
|
1796 |
+
n04131690: saltshaker
|
1797 |
+
n04133789: sandal
|
1798 |
+
n04136333: sarong
|
1799 |
+
n04141076: sax
|
1800 |
+
n04141327: scabbard
|
1801 |
+
n04141975: scale
|
1802 |
+
n04146614: school_bus
|
1803 |
+
n04147183: schooner
|
1804 |
+
n04149813: scoreboard
|
1805 |
+
n04152593: screen
|
1806 |
+
n04153751: screw
|
1807 |
+
n04154565: screwdriver
|
1808 |
+
n04162706: seat_belt
|
1809 |
+
n04179913: sewing_machine
|
1810 |
+
n04192698: shield
|
1811 |
+
n04200800: shoe_shop
|
1812 |
+
n04201297: shoji
|
1813 |
+
n04204238: shopping_basket
|
1814 |
+
n04204347: shopping_cart
|
1815 |
+
n04208210: shovel
|
1816 |
+
n04209133: shower_cap
|
1817 |
+
n04209239: shower_curtain
|
1818 |
+
n04228054: ski
|
1819 |
+
n04229816: ski_mask
|
1820 |
+
n04235860: sleeping_bag
|
1821 |
+
n04238763: slide_rule
|
1822 |
+
n04239074: sliding_door
|
1823 |
+
n04243546: slot
|
1824 |
+
n04251144: snorkel
|
1825 |
+
n04252077: snowmobile
|
1826 |
+
n04252225: snowplow
|
1827 |
+
n04254120: soap_dispenser
|
1828 |
+
n04254680: soccer_ball
|
1829 |
+
n04254777: sock
|
1830 |
+
n04258138: solar_dish
|
1831 |
+
n04259630: sombrero
|
1832 |
+
n04263257: soup_bowl
|
1833 |
+
n04264628: space_bar
|
1834 |
+
n04265275: space_heater
|
1835 |
+
n04266014: space_shuttle
|
1836 |
+
n04270147: spatula
|
1837 |
+
n04273569: speedboat
|
1838 |
+
n04275548: spider_web
|
1839 |
+
n04277352: spindle
|
1840 |
+
n04285008: sports_car
|
1841 |
+
n04286575: spotlight
|
1842 |
+
n04296562: stage
|
1843 |
+
n04310018: steam_locomotive
|
1844 |
+
n04311004: steel_arch_bridge
|
1845 |
+
n04311174: steel_drum
|
1846 |
+
n04317175: stethoscope
|
1847 |
+
n04325704: stole
|
1848 |
+
n04326547: stone_wall
|
1849 |
+
n04328186: stopwatch
|
1850 |
+
n04330267: stove
|
1851 |
+
n04332243: strainer
|
1852 |
+
n04335435: streetcar
|
1853 |
+
n04336792: stretcher
|
1854 |
+
n04344873: studio_couch
|
1855 |
+
n04346328: stupa
|
1856 |
+
n04347754: submarine
|
1857 |
+
n04350905: suit
|
1858 |
+
n04355338: sundial
|
1859 |
+
n04355933: sunglass
|
1860 |
+
n04356056: sunglasses
|
1861 |
+
n04357314: sunscreen
|
1862 |
+
n04366367: suspension_bridge
|
1863 |
+
n04367480: swab
|
1864 |
+
n04370456: sweatshirt
|
1865 |
+
n04371430: swimming_trunks
|
1866 |
+
n04371774: swing
|
1867 |
+
n04372370: switch
|
1868 |
+
n04376876: syringe
|
1869 |
+
n04380533: table_lamp
|
1870 |
+
n04389033: tank
|
1871 |
+
n04392985: tape_player
|
1872 |
+
n04398044: teapot
|
1873 |
+
n04399382: teddy
|
1874 |
+
n04404412: television
|
1875 |
+
n04409515: tennis_ball
|
1876 |
+
n04417672: thatch
|
1877 |
+
n04418357: theater_curtain
|
1878 |
+
n04423845: thimble
|
1879 |
+
n04428191: thresher
|
1880 |
+
n04429376: throne
|
1881 |
+
n04435653: tile_roof
|
1882 |
+
n04442312: toaster
|
1883 |
+
n04443257: tobacco_shop
|
1884 |
+
n04447861: toilet_seat
|
1885 |
+
n04456115: torch
|
1886 |
+
n04458633: totem_pole
|
1887 |
+
n04461696: tow_truck
|
1888 |
+
n04462240: toyshop
|
1889 |
+
n04465501: tractor
|
1890 |
+
n04467665: trailer_truck
|
1891 |
+
n04476259: tray
|
1892 |
+
n04479046: trench_coat
|
1893 |
+
n04482393: tricycle
|
1894 |
+
n04483307: trimaran
|
1895 |
+
n04485082: tripod
|
1896 |
+
n04486054: triumphal_arch
|
1897 |
+
n04487081: trolleybus
|
1898 |
+
n04487394: trombone
|
1899 |
+
n04493381: tub
|
1900 |
+
n04501370: turnstile
|
1901 |
+
n04505470: typewriter_keyboard
|
1902 |
+
n04507155: umbrella
|
1903 |
+
n04509417: unicycle
|
1904 |
+
n04515003: upright
|
1905 |
+
n04517823: vacuum
|
1906 |
+
n04522168: vase
|
1907 |
+
n04523525: vault
|
1908 |
+
n04525038: velvet
|
1909 |
+
n04525305: vending_machine
|
1910 |
+
n04532106: vestment
|
1911 |
+
n04532670: viaduct
|
1912 |
+
n04536866: violin
|
1913 |
+
n04540053: volleyball
|
1914 |
+
n04542943: waffle_iron
|
1915 |
+
n04548280: wall_clock
|
1916 |
+
n04548362: wallet
|
1917 |
+
n04550184: wardrobe
|
1918 |
+
n04552348: warplane
|
1919 |
+
n04553703: washbasin
|
1920 |
+
n04554684: washer
|
1921 |
+
n04557648: water_bottle
|
1922 |
+
n04560804: water_jug
|
1923 |
+
n04562935: water_tower
|
1924 |
+
n04579145: whiskey_jug
|
1925 |
+
n04579432: whistle
|
1926 |
+
n04584207: wig
|
1927 |
+
n04589890: window_screen
|
1928 |
+
n04590129: window_shade
|
1929 |
+
n04591157: Windsor_tie
|
1930 |
+
n04591713: wine_bottle
|
1931 |
+
n04592741: wing
|
1932 |
+
n04596742: wok
|
1933 |
+
n04597913: wooden_spoon
|
1934 |
+
n04599235: wool
|
1935 |
+
n04604644: worm_fence
|
1936 |
+
n04606251: wreck
|
1937 |
+
n04612504: yawl
|
1938 |
+
n04613696: yurt
|
1939 |
+
n06359193: web_site
|
1940 |
+
n06596364: comic_book
|
1941 |
+
n06785654: crossword_puzzle
|
1942 |
+
n06794110: street_sign
|
1943 |
+
n06874185: traffic_light
|
1944 |
+
n07248320: book_jacket
|
1945 |
+
n07565083: menu
|
1946 |
+
n07579787: plate
|
1947 |
+
n07583066: guacamole
|
1948 |
+
n07584110: consomme
|
1949 |
+
n07590611: hot_pot
|
1950 |
+
n07613480: trifle
|
1951 |
+
n07614500: ice_cream
|
1952 |
+
n07615774: ice_lolly
|
1953 |
+
n07684084: French_loaf
|
1954 |
+
n07693725: bagel
|
1955 |
+
n07695742: pretzel
|
1956 |
+
n07697313: cheeseburger
|
1957 |
+
n07697537: hotdog
|
1958 |
+
n07711569: mashed_potato
|
1959 |
+
n07714571: head_cabbage
|
1960 |
+
n07714990: broccoli
|
1961 |
+
n07715103: cauliflower
|
1962 |
+
n07716358: zucchini
|
1963 |
+
n07716906: spaghetti_squash
|
1964 |
+
n07717410: acorn_squash
|
1965 |
+
n07717556: butternut_squash
|
1966 |
+
n07718472: cucumber
|
1967 |
+
n07718747: artichoke
|
1968 |
+
n07720875: bell_pepper
|
1969 |
+
n07730033: cardoon
|
1970 |
+
n07734744: mushroom
|
1971 |
+
n07742313: Granny_Smith
|
1972 |
+
n07745940: strawberry
|
1973 |
+
n07747607: orange
|
1974 |
+
n07749582: lemon
|
1975 |
+
n07753113: fig
|
1976 |
+
n07753275: pineapple
|
1977 |
+
n07753592: banana
|
1978 |
+
n07754684: jackfruit
|
1979 |
+
n07760859: custard_apple
|
1980 |
+
n07768694: pomegranate
|
1981 |
+
n07802026: hay
|
1982 |
+
n07831146: carbonara
|
1983 |
+
n07836838: chocolate_sauce
|
1984 |
+
n07860988: dough
|
1985 |
+
n07871810: meat_loaf
|
1986 |
+
n07873807: pizza
|
1987 |
+
n07875152: potpie
|
1988 |
+
n07880968: burrito
|
1989 |
+
n07892512: red_wine
|
1990 |
+
n07920052: espresso
|
1991 |
+
n07930864: cup
|
1992 |
+
n07932039: eggnog
|
1993 |
+
n09193705: alp
|
1994 |
+
n09229709: bubble
|
1995 |
+
n09246464: cliff
|
1996 |
+
n09256479: coral_reef
|
1997 |
+
n09288635: geyser
|
1998 |
+
n09332890: lakeside
|
1999 |
+
n09399592: promontory
|
2000 |
+
n09421951: sandbar
|
2001 |
+
n09428293: seashore
|
2002 |
+
n09468604: valley
|
2003 |
+
n09472597: volcano
|
2004 |
+
n09835506: ballplayer
|
2005 |
+
n10148035: groom
|
2006 |
+
n10565667: scuba_diver
|
2007 |
+
n11879895: rapeseed
|
2008 |
+
n11939491: daisy
|
2009 |
+
n12057211: yellow_lady's_slipper
|
2010 |
+
n12144580: corn
|
2011 |
+
n12267677: acorn
|
2012 |
+
n12620546: hip
|
2013 |
+
n12768682: buckeye
|
2014 |
+
n12985857: coral_fungus
|
2015 |
+
n12998815: agaric
|
2016 |
+
n13037406: gyromitra
|
2017 |
+
n13040303: stinkhorn
|
2018 |
+
n13044778: earthstar
|
2019 |
+
n13052670: hen-of-the-woods
|
2020 |
+
n13054560: bolete
|
2021 |
+
n13133613: ear
|
2022 |
+
n15075141: toilet_tissue
|
2023 |
+
|
2024 |
+
# Download script/URL (optional)
|
2025 |
+
download: ultralytics/data/scripts/get_imagenet.sh
|
ultralytics/cfg/datasets/Objects365.yaml
ADDED
@@ -0,0 +1,443 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# Objects365 dataset https://www.objects365.org/ by Megvii
|
4 |
+
# Documentation: https://docs.ultralytics.com/datasets/detect/objects365/
|
5 |
+
# Example usage: yolo train data=Objects365.yaml
|
6 |
+
# parent
|
7 |
+
# ├── ultralytics
|
8 |
+
# └── datasets
|
9 |
+
# └── Objects365 ← downloads here (712 GB = 367G data + 345G zips)
|
10 |
+
|
11 |
+
# 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, ..]
|
12 |
+
path: ../datasets/Objects365 # dataset root dir
|
13 |
+
train: images/train # train images (relative to 'path') 1742289 images
|
14 |
+
val: images/val # val images (relative to 'path') 80000 images
|
15 |
+
test: # test images (optional)
|
16 |
+
|
17 |
+
# Classes
|
18 |
+
names:
|
19 |
+
0: Person
|
20 |
+
1: Sneakers
|
21 |
+
2: Chair
|
22 |
+
3: Other Shoes
|
23 |
+
4: Hat
|
24 |
+
5: Car
|
25 |
+
6: Lamp
|
26 |
+
7: Glasses
|
27 |
+
8: Bottle
|
28 |
+
9: Desk
|
29 |
+
10: Cup
|
30 |
+
11: Street Lights
|
31 |
+
12: Cabinet/shelf
|
32 |
+
13: Handbag/Satchel
|
33 |
+
14: Bracelet
|
34 |
+
15: Plate
|
35 |
+
16: Picture/Frame
|
36 |
+
17: Helmet
|
37 |
+
18: Book
|
38 |
+
19: Gloves
|
39 |
+
20: Storage box
|
40 |
+
21: Boat
|
41 |
+
22: Leather Shoes
|
42 |
+
23: Flower
|
43 |
+
24: Bench
|
44 |
+
25: Potted Plant
|
45 |
+
26: Bowl/Basin
|
46 |
+
27: Flag
|
47 |
+
28: Pillow
|
48 |
+
29: Boots
|
49 |
+
30: Vase
|
50 |
+
31: Microphone
|
51 |
+
32: Necklace
|
52 |
+
33: Ring
|
53 |
+
34: SUV
|
54 |
+
35: Wine Glass
|
55 |
+
36: Belt
|
56 |
+
37: Monitor/TV
|
57 |
+
38: Backpack
|
58 |
+
39: Umbrella
|
59 |
+
40: Traffic Light
|
60 |
+
41: Speaker
|
61 |
+
42: Watch
|
62 |
+
43: Tie
|
63 |
+
44: Trash bin Can
|
64 |
+
45: Slippers
|
65 |
+
46: Bicycle
|
66 |
+
47: Stool
|
67 |
+
48: Barrel/bucket
|
68 |
+
49: Van
|
69 |
+
50: Couch
|
70 |
+
51: Sandals
|
71 |
+
52: Basket
|
72 |
+
53: Drum
|
73 |
+
54: Pen/Pencil
|
74 |
+
55: Bus
|
75 |
+
56: Wild Bird
|
76 |
+
57: High Heels
|
77 |
+
58: Motorcycle
|
78 |
+
59: Guitar
|
79 |
+
60: Carpet
|
80 |
+
61: Cell Phone
|
81 |
+
62: Bread
|
82 |
+
63: Camera
|
83 |
+
64: Canned
|
84 |
+
65: Truck
|
85 |
+
66: Traffic cone
|
86 |
+
67: Cymbal
|
87 |
+
68: Lifesaver
|
88 |
+
69: Towel
|
89 |
+
70: Stuffed Toy
|
90 |
+
71: Candle
|
91 |
+
72: Sailboat
|
92 |
+
73: Laptop
|
93 |
+
74: Awning
|
94 |
+
75: Bed
|
95 |
+
76: Faucet
|
96 |
+
77: Tent
|
97 |
+
78: Horse
|
98 |
+
79: Mirror
|
99 |
+
80: Power outlet
|
100 |
+
81: Sink
|
101 |
+
82: Apple
|
102 |
+
83: Air Conditioner
|
103 |
+
84: Knife
|
104 |
+
85: Hockey Stick
|
105 |
+
86: Paddle
|
106 |
+
87: Pickup Truck
|
107 |
+
88: Fork
|
108 |
+
89: Traffic Sign
|
109 |
+
90: Balloon
|
110 |
+
91: Tripod
|
111 |
+
92: Dog
|
112 |
+
93: Spoon
|
113 |
+
94: Clock
|
114 |
+
95: Pot
|
115 |
+
96: Cow
|
116 |
+
97: Cake
|
117 |
+
98: Dining Table
|
118 |
+
99: Sheep
|
119 |
+
100: Hanger
|
120 |
+
101: Blackboard/Whiteboard
|
121 |
+
102: Napkin
|
122 |
+
103: Other Fish
|
123 |
+
104: Orange/Tangerine
|
124 |
+
105: Toiletry
|
125 |
+
106: Keyboard
|
126 |
+
107: Tomato
|
127 |
+
108: Lantern
|
128 |
+
109: Machinery Vehicle
|
129 |
+
110: Fan
|
130 |
+
111: Green Vegetables
|
131 |
+
112: Banana
|
132 |
+
113: Baseball Glove
|
133 |
+
114: Airplane
|
134 |
+
115: Mouse
|
135 |
+
116: Train
|
136 |
+
117: Pumpkin
|
137 |
+
118: Soccer
|
138 |
+
119: Skiboard
|
139 |
+
120: Luggage
|
140 |
+
121: Nightstand
|
141 |
+
122: Tea pot
|
142 |
+
123: Telephone
|
143 |
+
124: Trolley
|
144 |
+
125: Head Phone
|
145 |
+
126: Sports Car
|
146 |
+
127: Stop Sign
|
147 |
+
128: Dessert
|
148 |
+
129: Scooter
|
149 |
+
130: Stroller
|
150 |
+
131: Crane
|
151 |
+
132: Remote
|
152 |
+
133: Refrigerator
|
153 |
+
134: Oven
|
154 |
+
135: Lemon
|
155 |
+
136: Duck
|
156 |
+
137: Baseball Bat
|
157 |
+
138: Surveillance Camera
|
158 |
+
139: Cat
|
159 |
+
140: Jug
|
160 |
+
141: Broccoli
|
161 |
+
142: Piano
|
162 |
+
143: Pizza
|
163 |
+
144: Elephant
|
164 |
+
145: Skateboard
|
165 |
+
146: Surfboard
|
166 |
+
147: Gun
|
167 |
+
148: Skating and Skiing shoes
|
168 |
+
149: Gas stove
|
169 |
+
150: Donut
|
170 |
+
151: Bow Tie
|
171 |
+
152: Carrot
|
172 |
+
153: Toilet
|
173 |
+
154: Kite
|
174 |
+
155: Strawberry
|
175 |
+
156: Other Balls
|
176 |
+
157: Shovel
|
177 |
+
158: Pepper
|
178 |
+
159: Computer Box
|
179 |
+
160: Toilet Paper
|
180 |
+
161: Cleaning Products
|
181 |
+
162: Chopsticks
|
182 |
+
163: Microwave
|
183 |
+
164: Pigeon
|
184 |
+
165: Baseball
|
185 |
+
166: Cutting/chopping Board
|
186 |
+
167: Coffee Table
|
187 |
+
168: Side Table
|
188 |
+
169: Scissors
|
189 |
+
170: Marker
|
190 |
+
171: Pie
|
191 |
+
172: Ladder
|
192 |
+
173: Snowboard
|
193 |
+
174: Cookies
|
194 |
+
175: Radiator
|
195 |
+
176: Fire Hydrant
|
196 |
+
177: Basketball
|
197 |
+
178: Zebra
|
198 |
+
179: Grape
|
199 |
+
180: Giraffe
|
200 |
+
181: Potato
|
201 |
+
182: Sausage
|
202 |
+
183: Tricycle
|
203 |
+
184: Violin
|
204 |
+
185: Egg
|
205 |
+
186: Fire Extinguisher
|
206 |
+
187: Candy
|
207 |
+
188: Fire Truck
|
208 |
+
189: Billiards
|
209 |
+
190: Converter
|
210 |
+
191: Bathtub
|
211 |
+
192: Wheelchair
|
212 |
+
193: Golf Club
|
213 |
+
194: Briefcase
|
214 |
+
195: Cucumber
|
215 |
+
196: Cigar/Cigarette
|
216 |
+
197: Paint Brush
|
217 |
+
198: Pear
|
218 |
+
199: Heavy Truck
|
219 |
+
200: Hamburger
|
220 |
+
201: Extractor
|
221 |
+
202: Extension Cord
|
222 |
+
203: Tong
|
223 |
+
204: Tennis Racket
|
224 |
+
205: Folder
|
225 |
+
206: American Football
|
226 |
+
207: earphone
|
227 |
+
208: Mask
|
228 |
+
209: Kettle
|
229 |
+
210: Tennis
|
230 |
+
211: Ship
|
231 |
+
212: Swing
|
232 |
+
213: Coffee Machine
|
233 |
+
214: Slide
|
234 |
+
215: Carriage
|
235 |
+
216: Onion
|
236 |
+
217: Green beans
|
237 |
+
218: Projector
|
238 |
+
219: Frisbee
|
239 |
+
220: Washing Machine/Drying Machine
|
240 |
+
221: Chicken
|
241 |
+
222: Printer
|
242 |
+
223: Watermelon
|
243 |
+
224: Saxophone
|
244 |
+
225: Tissue
|
245 |
+
226: Toothbrush
|
246 |
+
227: Ice cream
|
247 |
+
228: Hot-air balloon
|
248 |
+
229: Cello
|
249 |
+
230: French Fries
|
250 |
+
231: Scale
|
251 |
+
232: Trophy
|
252 |
+
233: Cabbage
|
253 |
+
234: Hot dog
|
254 |
+
235: Blender
|
255 |
+
236: Peach
|
256 |
+
237: Rice
|
257 |
+
238: Wallet/Purse
|
258 |
+
239: Volleyball
|
259 |
+
240: Deer
|
260 |
+
241: Goose
|
261 |
+
242: Tape
|
262 |
+
243: Tablet
|
263 |
+
244: Cosmetics
|
264 |
+
245: Trumpet
|
265 |
+
246: Pineapple
|
266 |
+
247: Golf Ball
|
267 |
+
248: Ambulance
|
268 |
+
249: Parking meter
|
269 |
+
250: Mango
|
270 |
+
251: Key
|
271 |
+
252: Hurdle
|
272 |
+
253: Fishing Rod
|
273 |
+
254: Medal
|
274 |
+
255: Flute
|
275 |
+
256: Brush
|
276 |
+
257: Penguin
|
277 |
+
258: Megaphone
|
278 |
+
259: Corn
|
279 |
+
260: Lettuce
|
280 |
+
261: Garlic
|
281 |
+
262: Swan
|
282 |
+
263: Helicopter
|
283 |
+
264: Green Onion
|
284 |
+
265: Sandwich
|
285 |
+
266: Nuts
|
286 |
+
267: Speed Limit Sign
|
287 |
+
268: Induction Cooker
|
288 |
+
269: Broom
|
289 |
+
270: Trombone
|
290 |
+
271: Plum
|
291 |
+
272: Rickshaw
|
292 |
+
273: Goldfish
|
293 |
+
274: Kiwi fruit
|
294 |
+
275: Router/modem
|
295 |
+
276: Poker Card
|
296 |
+
277: Toaster
|
297 |
+
278: Shrimp
|
298 |
+
279: Sushi
|
299 |
+
280: Cheese
|
300 |
+
281: Notepaper
|
301 |
+
282: Cherry
|
302 |
+
283: Pliers
|
303 |
+
284: CD
|
304 |
+
285: Pasta
|
305 |
+
286: Hammer
|
306 |
+
287: Cue
|
307 |
+
288: Avocado
|
308 |
+
289: Hami melon
|
309 |
+
290: Flask
|
310 |
+
291: Mushroom
|
311 |
+
292: Screwdriver
|
312 |
+
293: Soap
|
313 |
+
294: Recorder
|
314 |
+
295: Bear
|
315 |
+
296: Eggplant
|
316 |
+
297: Board Eraser
|
317 |
+
298: Coconut
|
318 |
+
299: Tape Measure/Ruler
|
319 |
+
300: Pig
|
320 |
+
301: Showerhead
|
321 |
+
302: Globe
|
322 |
+
303: Chips
|
323 |
+
304: Steak
|
324 |
+
305: Crosswalk Sign
|
325 |
+
306: Stapler
|
326 |
+
307: Camel
|
327 |
+
308: Formula 1
|
328 |
+
309: Pomegranate
|
329 |
+
310: Dishwasher
|
330 |
+
311: Crab
|
331 |
+
312: Hoverboard
|
332 |
+
313: Meatball
|
333 |
+
314: Rice Cooker
|
334 |
+
315: Tuba
|
335 |
+
316: Calculator
|
336 |
+
317: Papaya
|
337 |
+
318: Antelope
|
338 |
+
319: Parrot
|
339 |
+
320: Seal
|
340 |
+
321: Butterfly
|
341 |
+
322: Dumbbell
|
342 |
+
323: Donkey
|
343 |
+
324: Lion
|
344 |
+
325: Urinal
|
345 |
+
326: Dolphin
|
346 |
+
327: Electric Drill
|
347 |
+
328: Hair Dryer
|
348 |
+
329: Egg tart
|
349 |
+
330: Jellyfish
|
350 |
+
331: Treadmill
|
351 |
+
332: Lighter
|
352 |
+
333: Grapefruit
|
353 |
+
334: Game board
|
354 |
+
335: Mop
|
355 |
+
336: Radish
|
356 |
+
337: Baozi
|
357 |
+
338: Target
|
358 |
+
339: French
|
359 |
+
340: Spring Rolls
|
360 |
+
341: Monkey
|
361 |
+
342: Rabbit
|
362 |
+
343: Pencil Case
|
363 |
+
344: Yak
|
364 |
+
345: Red Cabbage
|
365 |
+
346: Binoculars
|
366 |
+
347: Asparagus
|
367 |
+
348: Barbell
|
368 |
+
349: Scallop
|
369 |
+
350: Noddles
|
370 |
+
351: Comb
|
371 |
+
352: Dumpling
|
372 |
+
353: Oyster
|
373 |
+
354: Table Tennis paddle
|
374 |
+
355: Cosmetics Brush/Eyeliner Pencil
|
375 |
+
356: Chainsaw
|
376 |
+
357: Eraser
|
377 |
+
358: Lobster
|
378 |
+
359: Durian
|
379 |
+
360: Okra
|
380 |
+
361: Lipstick
|
381 |
+
362: Cosmetics Mirror
|
382 |
+
363: Curling
|
383 |
+
364: Table Tennis
|
384 |
+
|
385 |
+
# Download script/URL (optional) ---------------------------------------------------------------------------------------
|
386 |
+
download: |
|
387 |
+
from pathlib import Path
|
388 |
+
|
389 |
+
import numpy as np
|
390 |
+
from tqdm import tqdm
|
391 |
+
|
392 |
+
from ultralytics.utils.checks import check_requirements
|
393 |
+
from ultralytics.utils.downloads import download
|
394 |
+
from ultralytics.utils.ops import xyxy2xywhn
|
395 |
+
|
396 |
+
check_requirements(("pycocotools>=2.0",))
|
397 |
+
from pycocotools.coco import COCO
|
398 |
+
|
399 |
+
# Make Directories
|
400 |
+
dir = Path(yaml["path"]) # dataset root dir
|
401 |
+
for p in "images", "labels":
|
402 |
+
(dir / p).mkdir(parents=True, exist_ok=True)
|
403 |
+
for q in "train", "val":
|
404 |
+
(dir / p / q).mkdir(parents=True, exist_ok=True)
|
405 |
+
|
406 |
+
# Train, Val Splits
|
407 |
+
for split, patches in [("train", 50 + 1), ("val", 43 + 1)]:
|
408 |
+
print(f"Processing {split} in {patches} patches ...")
|
409 |
+
images, labels = dir / "images" / split, dir / "labels" / split
|
410 |
+
|
411 |
+
# Download
|
412 |
+
url = f"https://dorc.ks3-cn-beijing.ksyun.com/data-set/2020Objects365%E6%95%B0%E6%8D%AE%E9%9B%86/{split}/"
|
413 |
+
if split == "train":
|
414 |
+
download([f"{url}zhiyuan_objv2_{split}.tar.gz"], dir=dir) # annotations json
|
415 |
+
download([f"{url}patch{i}.tar.gz" for i in range(patches)], dir=images, curl=True, threads=8)
|
416 |
+
elif split == "val":
|
417 |
+
download([f"{url}zhiyuan_objv2_{split}.json"], dir=dir) # annotations json
|
418 |
+
download([f"{url}images/v1/patch{i}.tar.gz" for i in range(15 + 1)], dir=images, curl=True, threads=8)
|
419 |
+
download([f"{url}images/v2/patch{i}.tar.gz" for i in range(16, patches)], dir=images, curl=True, threads=8)
|
420 |
+
|
421 |
+
# Move
|
422 |
+
for f in tqdm(images.rglob("*.jpg"), desc=f"Moving {split} images"):
|
423 |
+
f.rename(images / f.name) # move to /images/{split}
|
424 |
+
|
425 |
+
# Labels
|
426 |
+
coco = COCO(dir / f"zhiyuan_objv2_{split}.json")
|
427 |
+
names = [x["name"] for x in coco.loadCats(coco.getCatIds())]
|
428 |
+
for cid, cat in enumerate(names):
|
429 |
+
catIds = coco.getCatIds(catNms=[cat])
|
430 |
+
imgIds = coco.getImgIds(catIds=catIds)
|
431 |
+
for im in tqdm(coco.loadImgs(imgIds), desc=f"Class {cid + 1}/{len(names)} {cat}"):
|
432 |
+
width, height = im["width"], im["height"]
|
433 |
+
path = Path(im["file_name"]) # image filename
|
434 |
+
try:
|
435 |
+
with open(labels / path.with_suffix(".txt").name, "a", encoding="utf-8") as file:
|
436 |
+
annIds = coco.getAnnIds(imgIds=im["id"], catIds=catIds, iscrowd=None)
|
437 |
+
for a in coco.loadAnns(annIds):
|
438 |
+
x, y, w, h = a["bbox"] # bounding box in xywh (xy top-left corner)
|
439 |
+
xyxy = np.array([x, y, x + w, y + h])[None] # pixels(1,4)
|
440 |
+
x, y, w, h = xyxy2xywhn(xyxy, w=width, h=height, clip=True)[0] # normalized and clipped
|
441 |
+
file.write(f"{cid} {x:.5f} {y:.5f} {w:.5f} {h:.5f}\n")
|
442 |
+
except Exception as e:
|
443 |
+
print(e)
|
ultralytics/cfg/datasets/SKU-110K.yaml
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# SKU-110K retail items dataset https://github.com/eg4000/SKU110K_CVPR19 by Trax Retail
|
4 |
+
# Documentation: https://docs.ultralytics.com/datasets/detect/sku-110k/
|
5 |
+
# Example usage: yolo train data=SKU-110K.yaml
|
6 |
+
# parent
|
7 |
+
# ├── ultralytics
|
8 |
+
# └── datasets
|
9 |
+
# └── SKU-110K ← downloads here (13.6 GB)
|
10 |
+
|
11 |
+
# 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, ..]
|
12 |
+
path: ../datasets/SKU-110K # dataset root dir
|
13 |
+
train: train.txt # train images (relative to 'path') 8219 images
|
14 |
+
val: val.txt # val images (relative to 'path') 588 images
|
15 |
+
test: test.txt # test images (optional) 2936 images
|
16 |
+
|
17 |
+
# Classes
|
18 |
+
names:
|
19 |
+
0: object
|
20 |
+
|
21 |
+
# Download script/URL (optional) ---------------------------------------------------------------------------------------
|
22 |
+
download: |
|
23 |
+
import shutil
|
24 |
+
from pathlib import Path
|
25 |
+
|
26 |
+
import numpy as np
|
27 |
+
import pandas as pd
|
28 |
+
from tqdm import tqdm
|
29 |
+
|
30 |
+
from ultralytics.utils.downloads import download
|
31 |
+
from ultralytics.utils.ops import xyxy2xywh
|
32 |
+
|
33 |
+
# Download
|
34 |
+
dir = Path(yaml["path"]) # dataset root dir
|
35 |
+
parent = Path(dir.parent) # download dir
|
36 |
+
urls = ["http://trax-geometry.s3.amazonaws.com/cvpr_challenge/SKU110K_fixed.tar.gz"]
|
37 |
+
download(urls, dir=parent)
|
38 |
+
|
39 |
+
# Rename directories
|
40 |
+
if dir.exists():
|
41 |
+
shutil.rmtree(dir)
|
42 |
+
(parent / "SKU110K_fixed").rename(dir) # rename dir
|
43 |
+
(dir / "labels").mkdir(parents=True, exist_ok=True) # create labels dir
|
44 |
+
|
45 |
+
# Convert labels
|
46 |
+
names = "image", "x1", "y1", "x2", "y2", "class", "image_width", "image_height" # column names
|
47 |
+
for d in "annotations_train.csv", "annotations_val.csv", "annotations_test.csv":
|
48 |
+
x = pd.read_csv(dir / "annotations" / d, names=names).values # annotations
|
49 |
+
images, unique_images = x[:, 0], np.unique(x[:, 0])
|
50 |
+
with open((dir / d).with_suffix(".txt").__str__().replace("annotations_", ""), "w", encoding="utf-8") as f:
|
51 |
+
f.writelines(f"./images/{s}\n" for s in unique_images)
|
52 |
+
for im in tqdm(unique_images, desc=f"Converting {dir / d}"):
|
53 |
+
cls = 0 # single-class dataset
|
54 |
+
with open((dir / "labels" / im).with_suffix(".txt"), "a", encoding="utf-8") as f:
|
55 |
+
for r in x[images == im]:
|
56 |
+
w, h = r[6], r[7] # image width, height
|
57 |
+
xywh = xyxy2xywh(np.array([[r[1] / w, r[2] / h, r[3] / w, r[4] / h]]))[0] # instance
|
58 |
+
f.write(f"{cls} {xywh[0]:.5f} {xywh[1]:.5f} {xywh[2]:.5f} {xywh[3]:.5f}\n") # write label
|
ultralytics/cfg/datasets/VOC.yaml
ADDED
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# PASCAL VOC dataset http://host.robots.ox.ac.uk/pascal/VOC by University of Oxford
|
4 |
+
# Documentation: # Documentation: https://docs.ultralytics.com/datasets/detect/voc/
|
5 |
+
# Example usage: yolo train data=VOC.yaml
|
6 |
+
# parent
|
7 |
+
# ├── ultralytics
|
8 |
+
# └── datasets
|
9 |
+
# └── VOC ← downloads here (2.8 GB)
|
10 |
+
|
11 |
+
# 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, ..]
|
12 |
+
path: ../datasets/VOC
|
13 |
+
train: # train images (relative to 'path') 16551 images
|
14 |
+
- images/train2012
|
15 |
+
- images/train2007
|
16 |
+
- images/val2012
|
17 |
+
- images/val2007
|
18 |
+
val: # val images (relative to 'path') 4952 images
|
19 |
+
- images/test2007
|
20 |
+
test: # test images (optional)
|
21 |
+
- images/test2007
|
22 |
+
|
23 |
+
# Classes
|
24 |
+
names:
|
25 |
+
0: aeroplane
|
26 |
+
1: bicycle
|
27 |
+
2: bird
|
28 |
+
3: boat
|
29 |
+
4: bottle
|
30 |
+
5: bus
|
31 |
+
6: car
|
32 |
+
7: cat
|
33 |
+
8: chair
|
34 |
+
9: cow
|
35 |
+
10: diningtable
|
36 |
+
11: dog
|
37 |
+
12: horse
|
38 |
+
13: motorbike
|
39 |
+
14: person
|
40 |
+
15: pottedplant
|
41 |
+
16: sheep
|
42 |
+
17: sofa
|
43 |
+
18: train
|
44 |
+
19: tvmonitor
|
45 |
+
|
46 |
+
# Download script/URL (optional) ---------------------------------------------------------------------------------------
|
47 |
+
download: |
|
48 |
+
import xml.etree.ElementTree as ET
|
49 |
+
from pathlib import Path
|
50 |
+
|
51 |
+
from tqdm import tqdm
|
52 |
+
|
53 |
+
from ultralytics.utils.downloads import download
|
54 |
+
|
55 |
+
|
56 |
+
def convert_label(path, lb_path, year, image_id):
|
57 |
+
"""Converts XML annotations from VOC format to YOLO format by extracting bounding boxes and class IDs."""
|
58 |
+
|
59 |
+
def convert_box(size, box):
|
60 |
+
dw, dh = 1.0 / size[0], 1.0 / size[1]
|
61 |
+
x, y, w, h = (box[0] + box[1]) / 2.0 - 1, (box[2] + box[3]) / 2.0 - 1, box[1] - box[0], box[3] - box[2]
|
62 |
+
return x * dw, y * dh, w * dw, h * dh
|
63 |
+
|
64 |
+
in_file = open(path / f"VOC{year}/Annotations/{image_id}.xml")
|
65 |
+
out_file = open(lb_path, "w")
|
66 |
+
tree = ET.parse(in_file)
|
67 |
+
root = tree.getroot()
|
68 |
+
size = root.find("size")
|
69 |
+
w = int(size.find("width").text)
|
70 |
+
h = int(size.find("height").text)
|
71 |
+
|
72 |
+
names = list(yaml["names"].values()) # names list
|
73 |
+
for obj in root.iter("object"):
|
74 |
+
cls = obj.find("name").text
|
75 |
+
if cls in names and int(obj.find("difficult").text) != 1:
|
76 |
+
xmlbox = obj.find("bndbox")
|
77 |
+
bb = convert_box((w, h), [float(xmlbox.find(x).text) for x in ("xmin", "xmax", "ymin", "ymax")])
|
78 |
+
cls_id = names.index(cls) # class id
|
79 |
+
out_file.write(" ".join(str(a) for a in (cls_id, *bb)) + "\n")
|
80 |
+
|
81 |
+
|
82 |
+
# Download
|
83 |
+
dir = Path(yaml["path"]) # dataset root dir
|
84 |
+
url = "https://github.com/ultralytics/assets/releases/download/v0.0.0/"
|
85 |
+
urls = [
|
86 |
+
f"{url}VOCtrainval_06-Nov-2007.zip", # 446MB, 5012 images
|
87 |
+
f"{url}VOCtest_06-Nov-2007.zip", # 438MB, 4953 images
|
88 |
+
f"{url}VOCtrainval_11-May-2012.zip", # 1.95GB, 17126 images
|
89 |
+
]
|
90 |
+
download(urls, dir=dir / "images", curl=True, threads=3, exist_ok=True) # download and unzip over existing (required)
|
91 |
+
|
92 |
+
# Convert
|
93 |
+
path = dir / "images/VOCdevkit"
|
94 |
+
for year, image_set in ("2012", "train"), ("2012", "val"), ("2007", "train"), ("2007", "val"), ("2007", "test"):
|
95 |
+
imgs_path = dir / "images" / f"{image_set}{year}"
|
96 |
+
lbs_path = dir / "labels" / f"{image_set}{year}"
|
97 |
+
imgs_path.mkdir(exist_ok=True, parents=True)
|
98 |
+
lbs_path.mkdir(exist_ok=True, parents=True)
|
99 |
+
|
100 |
+
with open(path / f"VOC{year}/ImageSets/Main/{image_set}.txt") as f:
|
101 |
+
image_ids = f.read().strip().split()
|
102 |
+
for id in tqdm(image_ids, desc=f"{image_set}{year}"):
|
103 |
+
f = path / f"VOC{year}/JPEGImages/{id}.jpg" # old img path
|
104 |
+
lb_path = (lbs_path / f.name).with_suffix(".txt") # new label path
|
105 |
+
f.rename(imgs_path / f.name) # move image
|
106 |
+
convert_label(path, lb_path, year, id) # convert labels to YOLO format
|
ultralytics/cfg/datasets/VisDrone.yaml
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# VisDrone2019-DET dataset https://github.com/VisDrone/VisDrone-Dataset by Tianjin University
|
4 |
+
# Documentation: https://docs.ultralytics.com/datasets/detect/visdrone/
|
5 |
+
# Example usage: yolo train data=VisDrone.yaml
|
6 |
+
# parent
|
7 |
+
# ├── ultralytics
|
8 |
+
# └── datasets
|
9 |
+
# └── VisDrone ← downloads here (2.3 GB)
|
10 |
+
|
11 |
+
# 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, ..]
|
12 |
+
path: ../datasets/VisDrone # dataset root dir
|
13 |
+
train: VisDrone2019-DET-train/images # train images (relative to 'path') 6471 images
|
14 |
+
val: VisDrone2019-DET-val/images # val images (relative to 'path') 548 images
|
15 |
+
test: VisDrone2019-DET-test-dev/images # test images (optional) 1610 images
|
16 |
+
|
17 |
+
# Classes
|
18 |
+
names:
|
19 |
+
0: pedestrian
|
20 |
+
1: people
|
21 |
+
2: bicycle
|
22 |
+
3: car
|
23 |
+
4: van
|
24 |
+
5: truck
|
25 |
+
6: tricycle
|
26 |
+
7: awning-tricycle
|
27 |
+
8: bus
|
28 |
+
9: motor
|
29 |
+
|
30 |
+
# Download script/URL (optional) ---------------------------------------------------------------------------------------
|
31 |
+
download: |
|
32 |
+
import os
|
33 |
+
from pathlib import Path
|
34 |
+
|
35 |
+
from ultralytics.utils.downloads import download
|
36 |
+
|
37 |
+
|
38 |
+
def visdrone2yolo(dir):
|
39 |
+
"""Convert VisDrone annotations to YOLO format, creating label files with normalized bounding box coordinates."""
|
40 |
+
from PIL import Image
|
41 |
+
from tqdm import tqdm
|
42 |
+
|
43 |
+
def convert_box(size, box):
|
44 |
+
# Convert VisDrone box to YOLO xywh box
|
45 |
+
dw = 1.0 / size[0]
|
46 |
+
dh = 1.0 / size[1]
|
47 |
+
return (box[0] + box[2] / 2) * dw, (box[1] + box[3] / 2) * dh, box[2] * dw, box[3] * dh
|
48 |
+
|
49 |
+
(dir / "labels").mkdir(parents=True, exist_ok=True) # make labels directory
|
50 |
+
pbar = tqdm((dir / "annotations").glob("*.txt"), desc=f"Converting {dir}")
|
51 |
+
for f in pbar:
|
52 |
+
img_size = Image.open((dir / "images" / f.name).with_suffix(".jpg")).size
|
53 |
+
lines = []
|
54 |
+
with open(f, encoding="utf-8") as file: # read annotation.txt
|
55 |
+
for row in [x.split(",") for x in file.read().strip().splitlines()]:
|
56 |
+
if row[4] == "0": # VisDrone 'ignored regions' class 0
|
57 |
+
continue
|
58 |
+
cls = int(row[5]) - 1
|
59 |
+
box = convert_box(img_size, tuple(map(int, row[:4])))
|
60 |
+
lines.append(f"{cls} {' '.join(f'{x:.6f}' for x in box)}\n")
|
61 |
+
with open(str(f).replace(f"{os.sep}annotations{os.sep}", f"{os.sep}labels{os.sep}"), "w", encoding="utf-8") as fl:
|
62 |
+
fl.writelines(lines) # write label.txt
|
63 |
+
|
64 |
+
|
65 |
+
# Download
|
66 |
+
dir = Path(yaml["path"]) # dataset root dir
|
67 |
+
urls = [
|
68 |
+
"https://github.com/ultralytics/assets/releases/download/v0.0.0/VisDrone2019-DET-train.zip",
|
69 |
+
"https://github.com/ultralytics/assets/releases/download/v0.0.0/VisDrone2019-DET-val.zip",
|
70 |
+
"https://github.com/ultralytics/assets/releases/download/v0.0.0/VisDrone2019-DET-test-dev.zip",
|
71 |
+
"https://github.com/ultralytics/assets/releases/download/v0.0.0/VisDrone2019-DET-test-challenge.zip",
|
72 |
+
]
|
73 |
+
download(urls, dir=dir, curl=True, threads=4)
|
74 |
+
|
75 |
+
# Convert
|
76 |
+
for d in "VisDrone2019-DET-train", "VisDrone2019-DET-val", "VisDrone2019-DET-test-dev":
|
77 |
+
visdrone2yolo(dir / d) # convert VisDrone annotations to YOLO labels
|
ultralytics/cfg/datasets/african-wildlife.yaml
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# African-wildlife dataset by Ultralytics
|
4 |
+
# Documentation: https://docs.ultralytics.com/datasets/detect/african-wildlife/
|
5 |
+
# Example usage: yolo train data=african-wildlife.yaml
|
6 |
+
# parent
|
7 |
+
# ├── ultralytics
|
8 |
+
# └── datasets
|
9 |
+
# └── african-wildlife ← downloads here (100 MB)
|
10 |
+
|
11 |
+
# 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, ..]
|
12 |
+
path: ../datasets/african-wildlife # dataset root dir
|
13 |
+
train: train/images # train images (relative to 'path') 1052 images
|
14 |
+
val: valid/images # val images (relative to 'path') 225 images
|
15 |
+
test: test/images # test images (relative to 'path') 227 images
|
16 |
+
|
17 |
+
# Classes
|
18 |
+
names:
|
19 |
+
0: buffalo
|
20 |
+
1: elephant
|
21 |
+
2: rhino
|
22 |
+
3: zebra
|
23 |
+
|
24 |
+
# Download script/URL (optional)
|
25 |
+
download: https://github.com/ultralytics/assets/releases/download/v0.0.0/african-wildlife.zip
|
ultralytics/cfg/datasets/brain-tumor.yaml
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# Brain-tumor dataset by Ultralytics
|
4 |
+
# Documentation: https://docs.ultralytics.com/datasets/detect/brain-tumor/
|
5 |
+
# Example usage: yolo train data=brain-tumor.yaml
|
6 |
+
# parent
|
7 |
+
# ├── ultralytics
|
8 |
+
# └── datasets
|
9 |
+
# └── brain-tumor ← downloads here (4.05 MB)
|
10 |
+
|
11 |
+
# 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, ..]
|
12 |
+
path: ../datasets/brain-tumor # dataset root dir
|
13 |
+
train: train/images # train images (relative to 'path') 893 images
|
14 |
+
val: valid/images # val images (relative to 'path') 223 images
|
15 |
+
test: # test images (relative to 'path')
|
16 |
+
|
17 |
+
# Classes
|
18 |
+
names:
|
19 |
+
0: negative
|
20 |
+
1: positive
|
21 |
+
|
22 |
+
# Download script/URL (optional)
|
23 |
+
download: https://github.com/ultralytics/assets/releases/download/v0.0.0/brain-tumor.zip
|
ultralytics/cfg/datasets/carparts-seg.yaml
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# Carparts-seg dataset by Ultralytics
|
4 |
+
# Documentation: https://docs.ultralytics.com/datasets/segment/carparts-seg/
|
5 |
+
# Example usage: yolo train data=carparts-seg.yaml
|
6 |
+
# parent
|
7 |
+
# ├── ultralytics
|
8 |
+
# └── datasets
|
9 |
+
# └── carparts-seg ← downloads here (132 MB)
|
10 |
+
|
11 |
+
# 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, ..]
|
12 |
+
path: ../datasets/carparts-seg # dataset root dir
|
13 |
+
train: train/images # train images (relative to 'path') 3516 images
|
14 |
+
val: valid/images # val images (relative to 'path') 276 images
|
15 |
+
test: test/images # test images (relative to 'path') 401 images
|
16 |
+
|
17 |
+
# Classes
|
18 |
+
names:
|
19 |
+
0: back_bumper
|
20 |
+
1: back_door
|
21 |
+
2: back_glass
|
22 |
+
3: back_left_door
|
23 |
+
4: back_left_light
|
24 |
+
5: back_light
|
25 |
+
6: back_right_door
|
26 |
+
7: back_right_light
|
27 |
+
8: front_bumper
|
28 |
+
9: front_door
|
29 |
+
10: front_glass
|
30 |
+
11: front_left_door
|
31 |
+
12: front_left_light
|
32 |
+
13: front_light
|
33 |
+
14: front_right_door
|
34 |
+
15: front_right_light
|
35 |
+
16: hood
|
36 |
+
17: left_mirror
|
37 |
+
18: object
|
38 |
+
19: right_mirror
|
39 |
+
20: tailgate
|
40 |
+
21: trunk
|
41 |
+
22: wheel
|
42 |
+
|
43 |
+
# Download script/URL (optional)
|
44 |
+
download: https://github.com/ultralytics/assets/releases/download/v0.0.0/carparts-seg.zip
|
ultralytics/cfg/datasets/coco-pose.yaml
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# COCO 2017 Keypoints dataset https://cocodataset.org by Microsoft
|
4 |
+
# Documentation: https://docs.ultralytics.com/datasets/pose/coco/
|
5 |
+
# Example usage: yolo train data=coco-pose.yaml
|
6 |
+
# parent
|
7 |
+
# ├── ultralytics
|
8 |
+
# └── datasets
|
9 |
+
# └── coco-pose ← downloads here (20.1 GB)
|
10 |
+
|
11 |
+
# 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, ..]
|
12 |
+
path: ../datasets/coco-pose # dataset root dir
|
13 |
+
train: train2017.txt # train images (relative to 'path') 56599 images
|
14 |
+
val: val2017.txt # val images (relative to 'path') 2346 images
|
15 |
+
test: test-dev2017.txt # 20288 of 40670 images, submit to https://codalab.lisn.upsaclay.fr/competitions/7403
|
16 |
+
|
17 |
+
# Keypoints
|
18 |
+
kpt_shape: [17, 3] # number of keypoints, number of dims (2 for x,y or 3 for x,y,visible)
|
19 |
+
flip_idx: [0, 2, 1, 4, 3, 6, 5, 8, 7, 10, 9, 12, 11, 14, 13, 16, 15]
|
20 |
+
|
21 |
+
# Classes
|
22 |
+
names:
|
23 |
+
0: person
|
24 |
+
|
25 |
+
# Download script/URL (optional)
|
26 |
+
download: |
|
27 |
+
from pathlib import Path
|
28 |
+
|
29 |
+
from ultralytics.utils.downloads import download
|
30 |
+
|
31 |
+
# Download labels
|
32 |
+
dir = Path(yaml["path"]) # dataset root dir
|
33 |
+
url = "https://github.com/ultralytics/assets/releases/download/v0.0.0/"
|
34 |
+
urls = [f"{url}coco2017labels-pose.zip"]
|
35 |
+
download(urls, dir=dir.parent)
|
36 |
+
# Download data
|
37 |
+
urls = [
|
38 |
+
"http://images.cocodataset.org/zips/train2017.zip", # 19G, 118k images
|
39 |
+
"http://images.cocodataset.org/zips/val2017.zip", # 1G, 5k images
|
40 |
+
"http://images.cocodataset.org/zips/test2017.zip", # 7G, 41k images (optional)
|
41 |
+
]
|
42 |
+
download(urls, dir=dir / "images", threads=3)
|
ultralytics/cfg/datasets/coco.yaml
ADDED
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# COCO 2017 dataset https://cocodataset.org by Microsoft
|
4 |
+
# Documentation: https://docs.ultralytics.com/datasets/detect/coco/
|
5 |
+
# Example usage: yolo train data=coco.yaml
|
6 |
+
# parent
|
7 |
+
# ├── ultralytics
|
8 |
+
# └── datasets
|
9 |
+
# └── coco ← downloads here (20.1 GB)
|
10 |
+
|
11 |
+
# 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, ..]
|
12 |
+
path: ../datasets/coco # dataset root dir
|
13 |
+
train: train2017.txt # train images (relative to 'path') 118287 images
|
14 |
+
val: val2017.txt # val images (relative to 'path') 5000 images
|
15 |
+
test: test-dev2017.txt # 20288 of 40670 images, submit to https://competitions.codalab.org/competitions/20794
|
16 |
+
|
17 |
+
# Classes
|
18 |
+
names:
|
19 |
+
0: person
|
20 |
+
1: bicycle
|
21 |
+
2: car
|
22 |
+
3: motorcycle
|
23 |
+
4: airplane
|
24 |
+
5: bus
|
25 |
+
6: train
|
26 |
+
7: truck
|
27 |
+
8: boat
|
28 |
+
9: traffic light
|
29 |
+
10: fire hydrant
|
30 |
+
11: stop sign
|
31 |
+
12: parking meter
|
32 |
+
13: bench
|
33 |
+
14: bird
|
34 |
+
15: cat
|
35 |
+
16: dog
|
36 |
+
17: horse
|
37 |
+
18: sheep
|
38 |
+
19: cow
|
39 |
+
20: elephant
|
40 |
+
21: bear
|
41 |
+
22: zebra
|
42 |
+
23: giraffe
|
43 |
+
24: backpack
|
44 |
+
25: umbrella
|
45 |
+
26: handbag
|
46 |
+
27: tie
|
47 |
+
28: suitcase
|
48 |
+
29: frisbee
|
49 |
+
30: skis
|
50 |
+
31: snowboard
|
51 |
+
32: sports ball
|
52 |
+
33: kite
|
53 |
+
34: baseball bat
|
54 |
+
35: baseball glove
|
55 |
+
36: skateboard
|
56 |
+
37: surfboard
|
57 |
+
38: tennis racket
|
58 |
+
39: bottle
|
59 |
+
40: wine glass
|
60 |
+
41: cup
|
61 |
+
42: fork
|
62 |
+
43: knife
|
63 |
+
44: spoon
|
64 |
+
45: bowl
|
65 |
+
46: banana
|
66 |
+
47: apple
|
67 |
+
48: sandwich
|
68 |
+
49: orange
|
69 |
+
50: broccoli
|
70 |
+
51: carrot
|
71 |
+
52: hot dog
|
72 |
+
53: pizza
|
73 |
+
54: donut
|
74 |
+
55: cake
|
75 |
+
56: chair
|
76 |
+
57: couch
|
77 |
+
58: potted plant
|
78 |
+
59: bed
|
79 |
+
60: dining table
|
80 |
+
61: toilet
|
81 |
+
62: tv
|
82 |
+
63: laptop
|
83 |
+
64: mouse
|
84 |
+
65: remote
|
85 |
+
66: keyboard
|
86 |
+
67: cell phone
|
87 |
+
68: microwave
|
88 |
+
69: oven
|
89 |
+
70: toaster
|
90 |
+
71: sink
|
91 |
+
72: refrigerator
|
92 |
+
73: book
|
93 |
+
74: clock
|
94 |
+
75: vase
|
95 |
+
76: scissors
|
96 |
+
77: teddy bear
|
97 |
+
78: hair drier
|
98 |
+
79: toothbrush
|
99 |
+
|
100 |
+
# Download script/URL (optional)
|
101 |
+
download: |
|
102 |
+
from pathlib import Path
|
103 |
+
|
104 |
+
from ultralytics.utils.downloads import download
|
105 |
+
|
106 |
+
# Download labels
|
107 |
+
segments = True # segment or box labels
|
108 |
+
dir = Path(yaml["path"]) # dataset root dir
|
109 |
+
url = "https://github.com/ultralytics/assets/releases/download/v0.0.0/"
|
110 |
+
urls = [url + ("coco2017labels-segments.zip" if segments else "coco2017labels.zip")] # labels
|
111 |
+
download(urls, dir=dir.parent)
|
112 |
+
# Download data
|
113 |
+
urls = [
|
114 |
+
"http://images.cocodataset.org/zips/train2017.zip", # 19G, 118k images
|
115 |
+
"http://images.cocodataset.org/zips/val2017.zip", # 1G, 5k images
|
116 |
+
"http://images.cocodataset.org/zips/test2017.zip", # 7G, 41k images (optional)
|
117 |
+
]
|
118 |
+
download(urls, dir=dir / "images", threads=3)
|
ultralytics/cfg/datasets/coco128-seg.yaml
ADDED
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# COCO128-seg dataset https://www.kaggle.com/datasets/ultralytics/coco128 (first 128 images from COCO train2017) by Ultralytics
|
4 |
+
# Documentation: https://docs.ultralytics.com/datasets/segment/coco/
|
5 |
+
# Example usage: yolo train data=coco128.yaml
|
6 |
+
# parent
|
7 |
+
# ├── ultralytics
|
8 |
+
# └── datasets
|
9 |
+
# └── coco128-seg ← downloads here (7 MB)
|
10 |
+
|
11 |
+
# 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, ..]
|
12 |
+
path: ../datasets/coco128-seg # dataset root dir
|
13 |
+
train: images/train2017 # train images (relative to 'path') 128 images
|
14 |
+
val: images/train2017 # val images (relative to 'path') 128 images
|
15 |
+
test: # test images (optional)
|
16 |
+
|
17 |
+
# Classes
|
18 |
+
names:
|
19 |
+
0: person
|
20 |
+
1: bicycle
|
21 |
+
2: car
|
22 |
+
3: motorcycle
|
23 |
+
4: airplane
|
24 |
+
5: bus
|
25 |
+
6: train
|
26 |
+
7: truck
|
27 |
+
8: boat
|
28 |
+
9: traffic light
|
29 |
+
10: fire hydrant
|
30 |
+
11: stop sign
|
31 |
+
12: parking meter
|
32 |
+
13: bench
|
33 |
+
14: bird
|
34 |
+
15: cat
|
35 |
+
16: dog
|
36 |
+
17: horse
|
37 |
+
18: sheep
|
38 |
+
19: cow
|
39 |
+
20: elephant
|
40 |
+
21: bear
|
41 |
+
22: zebra
|
42 |
+
23: giraffe
|
43 |
+
24: backpack
|
44 |
+
25: umbrella
|
45 |
+
26: handbag
|
46 |
+
27: tie
|
47 |
+
28: suitcase
|
48 |
+
29: frisbee
|
49 |
+
30: skis
|
50 |
+
31: snowboard
|
51 |
+
32: sports ball
|
52 |
+
33: kite
|
53 |
+
34: baseball bat
|
54 |
+
35: baseball glove
|
55 |
+
36: skateboard
|
56 |
+
37: surfboard
|
57 |
+
38: tennis racket
|
58 |
+
39: bottle
|
59 |
+
40: wine glass
|
60 |
+
41: cup
|
61 |
+
42: fork
|
62 |
+
43: knife
|
63 |
+
44: spoon
|
64 |
+
45: bowl
|
65 |
+
46: banana
|
66 |
+
47: apple
|
67 |
+
48: sandwich
|
68 |
+
49: orange
|
69 |
+
50: broccoli
|
70 |
+
51: carrot
|
71 |
+
52: hot dog
|
72 |
+
53: pizza
|
73 |
+
54: donut
|
74 |
+
55: cake
|
75 |
+
56: chair
|
76 |
+
57: couch
|
77 |
+
58: potted plant
|
78 |
+
59: bed
|
79 |
+
60: dining table
|
80 |
+
61: toilet
|
81 |
+
62: tv
|
82 |
+
63: laptop
|
83 |
+
64: mouse
|
84 |
+
65: remote
|
85 |
+
66: keyboard
|
86 |
+
67: cell phone
|
87 |
+
68: microwave
|
88 |
+
69: oven
|
89 |
+
70: toaster
|
90 |
+
71: sink
|
91 |
+
72: refrigerator
|
92 |
+
73: book
|
93 |
+
74: clock
|
94 |
+
75: vase
|
95 |
+
76: scissors
|
96 |
+
77: teddy bear
|
97 |
+
78: hair drier
|
98 |
+
79: toothbrush
|
99 |
+
|
100 |
+
# Download script/URL (optional)
|
101 |
+
download: https://github.com/ultralytics/assets/releases/download/v0.0.0/coco128-seg.zip
|
ultralytics/cfg/datasets/coco128.yaml
ADDED
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# COCO128 dataset https://www.kaggle.com/datasets/ultralytics/coco128 (first 128 images from COCO train2017) by Ultralytics
|
4 |
+
# Documentation: https://docs.ultralytics.com/datasets/detect/coco/
|
5 |
+
# Example usage: yolo train data=coco128.yaml
|
6 |
+
# parent
|
7 |
+
# ├── ultralytics
|
8 |
+
# └── datasets
|
9 |
+
# └── coco128 ← downloads here (7 MB)
|
10 |
+
|
11 |
+
# 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, ..]
|
12 |
+
path: ../datasets/coco128 # dataset root dir
|
13 |
+
train: images/train2017 # train images (relative to 'path') 128 images
|
14 |
+
val: images/train2017 # val images (relative to 'path') 128 images
|
15 |
+
test: # test images (optional)
|
16 |
+
|
17 |
+
# Classes
|
18 |
+
names:
|
19 |
+
0: person
|
20 |
+
1: bicycle
|
21 |
+
2: car
|
22 |
+
3: motorcycle
|
23 |
+
4: airplane
|
24 |
+
5: bus
|
25 |
+
6: train
|
26 |
+
7: truck
|
27 |
+
8: boat
|
28 |
+
9: traffic light
|
29 |
+
10: fire hydrant
|
30 |
+
11: stop sign
|
31 |
+
12: parking meter
|
32 |
+
13: bench
|
33 |
+
14: bird
|
34 |
+
15: cat
|
35 |
+
16: dog
|
36 |
+
17: horse
|
37 |
+
18: sheep
|
38 |
+
19: cow
|
39 |
+
20: elephant
|
40 |
+
21: bear
|
41 |
+
22: zebra
|
42 |
+
23: giraffe
|
43 |
+
24: backpack
|
44 |
+
25: umbrella
|
45 |
+
26: handbag
|
46 |
+
27: tie
|
47 |
+
28: suitcase
|
48 |
+
29: frisbee
|
49 |
+
30: skis
|
50 |
+
31: snowboard
|
51 |
+
32: sports ball
|
52 |
+
33: kite
|
53 |
+
34: baseball bat
|
54 |
+
35: baseball glove
|
55 |
+
36: skateboard
|
56 |
+
37: surfboard
|
57 |
+
38: tennis racket
|
58 |
+
39: bottle
|
59 |
+
40: wine glass
|
60 |
+
41: cup
|
61 |
+
42: fork
|
62 |
+
43: knife
|
63 |
+
44: spoon
|
64 |
+
45: bowl
|
65 |
+
46: banana
|
66 |
+
47: apple
|
67 |
+
48: sandwich
|
68 |
+
49: orange
|
69 |
+
50: broccoli
|
70 |
+
51: carrot
|
71 |
+
52: hot dog
|
72 |
+
53: pizza
|
73 |
+
54: donut
|
74 |
+
55: cake
|
75 |
+
56: chair
|
76 |
+
57: couch
|
77 |
+
58: potted plant
|
78 |
+
59: bed
|
79 |
+
60: dining table
|
80 |
+
61: toilet
|
81 |
+
62: tv
|
82 |
+
63: laptop
|
83 |
+
64: mouse
|
84 |
+
65: remote
|
85 |
+
66: keyboard
|
86 |
+
67: cell phone
|
87 |
+
68: microwave
|
88 |
+
69: oven
|
89 |
+
70: toaster
|
90 |
+
71: sink
|
91 |
+
72: refrigerator
|
92 |
+
73: book
|
93 |
+
74: clock
|
94 |
+
75: vase
|
95 |
+
76: scissors
|
96 |
+
77: teddy bear
|
97 |
+
78: hair drier
|
98 |
+
79: toothbrush
|
99 |
+
|
100 |
+
# Download script/URL (optional)
|
101 |
+
download: https://github.com/ultralytics/assets/releases/download/v0.0.0/coco128.zip
|
ultralytics/cfg/datasets/coco8-pose.yaml
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# COCO8-pose dataset (first 8 images from COCO train2017) by Ultralytics
|
4 |
+
# Documentation: https://docs.ultralytics.com/datasets/pose/coco8-pose/
|
5 |
+
# Example usage: yolo train data=coco8-pose.yaml
|
6 |
+
# parent
|
7 |
+
# ├── ultralytics
|
8 |
+
# └── datasets
|
9 |
+
# └── coco8-pose ← downloads here (1 MB)
|
10 |
+
|
11 |
+
# 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, ..]
|
12 |
+
path: ../datasets/coco8-pose # dataset root dir
|
13 |
+
train: images/train # train images (relative to 'path') 4 images
|
14 |
+
val: images/val # val images (relative to 'path') 4 images
|
15 |
+
test: # test images (optional)
|
16 |
+
|
17 |
+
# Keypoints
|
18 |
+
kpt_shape: [17, 3] # number of keypoints, number of dims (2 for x,y or 3 for x,y,visible)
|
19 |
+
flip_idx: [0, 2, 1, 4, 3, 6, 5, 8, 7, 10, 9, 12, 11, 14, 13, 16, 15]
|
20 |
+
|
21 |
+
# Classes
|
22 |
+
names:
|
23 |
+
0: person
|
24 |
+
|
25 |
+
# Download script/URL (optional)
|
26 |
+
download: https://github.com/ultralytics/assets/releases/download/v0.0.0/coco8-pose.zip
|
ultralytics/cfg/datasets/coco8-seg.yaml
ADDED
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# COCO8-seg dataset (first 8 images from COCO train2017) by Ultralytics
|
4 |
+
# Documentation: https://docs.ultralytics.com/datasets/segment/coco8-seg/
|
5 |
+
# Example usage: yolo train data=coco8-seg.yaml
|
6 |
+
# parent
|
7 |
+
# ├── ultralytics
|
8 |
+
# └── datasets
|
9 |
+
# └── coco8-seg ← downloads here (1 MB)
|
10 |
+
|
11 |
+
# 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, ..]
|
12 |
+
path: ../datasets/coco8-seg # dataset root dir
|
13 |
+
train: images/train # train images (relative to 'path') 4 images
|
14 |
+
val: images/val # val images (relative to 'path') 4 images
|
15 |
+
test: # test images (optional)
|
16 |
+
|
17 |
+
# Classes
|
18 |
+
names:
|
19 |
+
0: person
|
20 |
+
1: bicycle
|
21 |
+
2: car
|
22 |
+
3: motorcycle
|
23 |
+
4: airplane
|
24 |
+
5: bus
|
25 |
+
6: train
|
26 |
+
7: truck
|
27 |
+
8: boat
|
28 |
+
9: traffic light
|
29 |
+
10: fire hydrant
|
30 |
+
11: stop sign
|
31 |
+
12: parking meter
|
32 |
+
13: bench
|
33 |
+
14: bird
|
34 |
+
15: cat
|
35 |
+
16: dog
|
36 |
+
17: horse
|
37 |
+
18: sheep
|
38 |
+
19: cow
|
39 |
+
20: elephant
|
40 |
+
21: bear
|
41 |
+
22: zebra
|
42 |
+
23: giraffe
|
43 |
+
24: backpack
|
44 |
+
25: umbrella
|
45 |
+
26: handbag
|
46 |
+
27: tie
|
47 |
+
28: suitcase
|
48 |
+
29: frisbee
|
49 |
+
30: skis
|
50 |
+
31: snowboard
|
51 |
+
32: sports ball
|
52 |
+
33: kite
|
53 |
+
34: baseball bat
|
54 |
+
35: baseball glove
|
55 |
+
36: skateboard
|
56 |
+
37: surfboard
|
57 |
+
38: tennis racket
|
58 |
+
39: bottle
|
59 |
+
40: wine glass
|
60 |
+
41: cup
|
61 |
+
42: fork
|
62 |
+
43: knife
|
63 |
+
44: spoon
|
64 |
+
45: bowl
|
65 |
+
46: banana
|
66 |
+
47: apple
|
67 |
+
48: sandwich
|
68 |
+
49: orange
|
69 |
+
50: broccoli
|
70 |
+
51: carrot
|
71 |
+
52: hot dog
|
72 |
+
53: pizza
|
73 |
+
54: donut
|
74 |
+
55: cake
|
75 |
+
56: chair
|
76 |
+
57: couch
|
77 |
+
58: potted plant
|
78 |
+
59: bed
|
79 |
+
60: dining table
|
80 |
+
61: toilet
|
81 |
+
62: tv
|
82 |
+
63: laptop
|
83 |
+
64: mouse
|
84 |
+
65: remote
|
85 |
+
66: keyboard
|
86 |
+
67: cell phone
|
87 |
+
68: microwave
|
88 |
+
69: oven
|
89 |
+
70: toaster
|
90 |
+
71: sink
|
91 |
+
72: refrigerator
|
92 |
+
73: book
|
93 |
+
74: clock
|
94 |
+
75: vase
|
95 |
+
76: scissors
|
96 |
+
77: teddy bear
|
97 |
+
78: hair drier
|
98 |
+
79: toothbrush
|
99 |
+
|
100 |
+
# Download script/URL (optional)
|
101 |
+
download: https://github.com/ultralytics/assets/releases/download/v0.0.0/coco8-seg.zip
|
ultralytics/cfg/datasets/coco8.yaml
ADDED
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# COCO8 dataset (first 8 images from COCO train2017) by Ultralytics
|
4 |
+
# Documentation: https://docs.ultralytics.com/datasets/detect/coco8/
|
5 |
+
# Example usage: yolo train data=coco8.yaml
|
6 |
+
# parent
|
7 |
+
# ├── ultralytics
|
8 |
+
# └── datasets
|
9 |
+
# └── coco8 ← downloads here (1 MB)
|
10 |
+
|
11 |
+
# 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, ..]
|
12 |
+
path: ../datasets/coco8 # dataset root dir
|
13 |
+
train: images/train # train images (relative to 'path') 4 images
|
14 |
+
val: images/val # val images (relative to 'path') 4 images
|
15 |
+
test: # test images (optional)
|
16 |
+
|
17 |
+
# Classes
|
18 |
+
names:
|
19 |
+
0: person
|
20 |
+
1: bicycle
|
21 |
+
2: car
|
22 |
+
3: motorcycle
|
23 |
+
4: airplane
|
24 |
+
5: bus
|
25 |
+
6: train
|
26 |
+
7: truck
|
27 |
+
8: boat
|
28 |
+
9: traffic light
|
29 |
+
10: fire hydrant
|
30 |
+
11: stop sign
|
31 |
+
12: parking meter
|
32 |
+
13: bench
|
33 |
+
14: bird
|
34 |
+
15: cat
|
35 |
+
16: dog
|
36 |
+
17: horse
|
37 |
+
18: sheep
|
38 |
+
19: cow
|
39 |
+
20: elephant
|
40 |
+
21: bear
|
41 |
+
22: zebra
|
42 |
+
23: giraffe
|
43 |
+
24: backpack
|
44 |
+
25: umbrella
|
45 |
+
26: handbag
|
46 |
+
27: tie
|
47 |
+
28: suitcase
|
48 |
+
29: frisbee
|
49 |
+
30: skis
|
50 |
+
31: snowboard
|
51 |
+
32: sports ball
|
52 |
+
33: kite
|
53 |
+
34: baseball bat
|
54 |
+
35: baseball glove
|
55 |
+
36: skateboard
|
56 |
+
37: surfboard
|
57 |
+
38: tennis racket
|
58 |
+
39: bottle
|
59 |
+
40: wine glass
|
60 |
+
41: cup
|
61 |
+
42: fork
|
62 |
+
43: knife
|
63 |
+
44: spoon
|
64 |
+
45: bowl
|
65 |
+
46: banana
|
66 |
+
47: apple
|
67 |
+
48: sandwich
|
68 |
+
49: orange
|
69 |
+
50: broccoli
|
70 |
+
51: carrot
|
71 |
+
52: hot dog
|
72 |
+
53: pizza
|
73 |
+
54: donut
|
74 |
+
55: cake
|
75 |
+
56: chair
|
76 |
+
57: couch
|
77 |
+
58: potted plant
|
78 |
+
59: bed
|
79 |
+
60: dining table
|
80 |
+
61: toilet
|
81 |
+
62: tv
|
82 |
+
63: laptop
|
83 |
+
64: mouse
|
84 |
+
65: remote
|
85 |
+
66: keyboard
|
86 |
+
67: cell phone
|
87 |
+
68: microwave
|
88 |
+
69: oven
|
89 |
+
70: toaster
|
90 |
+
71: sink
|
91 |
+
72: refrigerator
|
92 |
+
73: book
|
93 |
+
74: clock
|
94 |
+
75: vase
|
95 |
+
76: scissors
|
96 |
+
77: teddy bear
|
97 |
+
78: hair drier
|
98 |
+
79: toothbrush
|
99 |
+
|
100 |
+
# Download script/URL (optional)
|
101 |
+
download: https://github.com/ultralytics/assets/releases/download/v0.0.0/coco8.zip
|
ultralytics/cfg/datasets/crack-seg.yaml
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# Crack-seg dataset by Ultralytics
|
4 |
+
# Documentation: https://docs.ultralytics.com/datasets/segment/crack-seg/
|
5 |
+
# Example usage: yolo train data=crack-seg.yaml
|
6 |
+
# parent
|
7 |
+
# ├── ultralytics
|
8 |
+
# └── datasets
|
9 |
+
# └── crack-seg ← downloads here (91.2 MB)
|
10 |
+
|
11 |
+
# 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, ..]
|
12 |
+
path: ../datasets/crack-seg # dataset root dir
|
13 |
+
train: train/images # train images (relative to 'path') 3717 images
|
14 |
+
val: valid/images # val images (relative to 'path') 112 images
|
15 |
+
test: test/images # test images (relative to 'path') 200 images
|
16 |
+
|
17 |
+
# Classes
|
18 |
+
names:
|
19 |
+
0: crack
|
20 |
+
|
21 |
+
# Download script/URL (optional)
|
22 |
+
download: https://github.com/ultralytics/assets/releases/download/v0.0.0/crack-seg.zip
|
ultralytics/cfg/datasets/dog-pose.yaml
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# Dogs dataset http://vision.stanford.edu/aditya86/ImageNetDogs/ by Stanford
|
4 |
+
# Documentation: https://docs.ultralytics.com/datasets/pose/dog-pose/
|
5 |
+
# Example usage: yolo train data=dog-pose.yaml
|
6 |
+
# parent
|
7 |
+
# ├── ultralytics
|
8 |
+
# └── datasets
|
9 |
+
# └── dog-pose ← downloads here (337 MB)
|
10 |
+
|
11 |
+
# 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, ..]
|
12 |
+
path: ../datasets/dog-pose # dataset root dir
|
13 |
+
train: train # train images (relative to 'path') 6773 images
|
14 |
+
val: val # val images (relative to 'path') 1703 images
|
15 |
+
|
16 |
+
# Keypoints
|
17 |
+
kpt_shape: [24, 3] # number of keypoints, number of dims (2 for x,y or 3 for x,y,visible)
|
18 |
+
|
19 |
+
# Classes
|
20 |
+
names:
|
21 |
+
0: dog
|
22 |
+
|
23 |
+
# Download script/URL (optional)
|
24 |
+
download: https://github.com/ultralytics/assets/releases/download/v0.0.0/dog-pose.zip
|
ultralytics/cfg/datasets/dota8.yaml
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# DOTA8 dataset 8 images from split DOTAv1 dataset by Ultralytics
|
4 |
+
# Documentation: https://docs.ultralytics.com/datasets/obb/dota8/
|
5 |
+
# Example usage: yolo train model=yolov8n-obb.pt data=dota8.yaml
|
6 |
+
# parent
|
7 |
+
# ├── ultralytics
|
8 |
+
# └── datasets
|
9 |
+
# └── dota8 ← downloads here (1MB)
|
10 |
+
|
11 |
+
# 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, ..]
|
12 |
+
path: ../datasets/dota8 # dataset root dir
|
13 |
+
train: images/train # train images (relative to 'path') 4 images
|
14 |
+
val: images/val # val images (relative to 'path') 4 images
|
15 |
+
|
16 |
+
# Classes for DOTA 1.0
|
17 |
+
names:
|
18 |
+
0: plane
|
19 |
+
1: ship
|
20 |
+
2: storage tank
|
21 |
+
3: baseball diamond
|
22 |
+
4: tennis court
|
23 |
+
5: basketball court
|
24 |
+
6: ground track field
|
25 |
+
7: harbor
|
26 |
+
8: bridge
|
27 |
+
9: large vehicle
|
28 |
+
10: small vehicle
|
29 |
+
11: helicopter
|
30 |
+
12: roundabout
|
31 |
+
13: soccer ball field
|
32 |
+
14: swimming pool
|
33 |
+
|
34 |
+
# Download script/URL (optional)
|
35 |
+
download: https://github.com/ultralytics/assets/releases/download/v0.0.0/dota8.zip
|
ultralytics/cfg/datasets/hand-keypoints.yaml
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# Hand Keypoints dataset by Ultralytics
|
4 |
+
# Documentation: https://docs.ultralytics.com/datasets/pose/hand-keypoints/
|
5 |
+
# Example usage: yolo train data=hand-keypoints.yaml
|
6 |
+
# parent
|
7 |
+
# ├── ultralytics
|
8 |
+
# └── datasets
|
9 |
+
# └── hand-keypoints ← downloads here (369 MB)
|
10 |
+
|
11 |
+
# 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, ..]
|
12 |
+
path: ../datasets/hand-keypoints # dataset root dir
|
13 |
+
train: train # train images (relative to 'path') 18776 images
|
14 |
+
val: val # val images (relative to 'path') 7992 images
|
15 |
+
|
16 |
+
# Keypoints
|
17 |
+
kpt_shape: [21, 3] # number of keypoints, number of dims (2 for x,y or 3 for x,y,visible)
|
18 |
+
flip_idx:
|
19 |
+
[0, 1, 2, 4, 3, 10, 11, 12, 13, 14, 5, 6, 7, 8, 9, 15, 16, 17, 18, 19, 20]
|
20 |
+
|
21 |
+
# Classes
|
22 |
+
names:
|
23 |
+
0: hand
|
24 |
+
|
25 |
+
# Download script/URL (optional)
|
26 |
+
download: https://github.com/ultralytics/assets/releases/download/v0.0.0/hand-keypoints.zip
|
ultralytics/cfg/datasets/lvis.yaml
ADDED
@@ -0,0 +1,1240 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# LVIS dataset http://www.lvisdataset.org by Facebook AI Research.
|
4 |
+
# Documentation: https://docs.ultralytics.com/datasets/detect/lvis/
|
5 |
+
# Example usage: yolo train data=lvis.yaml
|
6 |
+
# parent
|
7 |
+
# ├── ultralytics
|
8 |
+
# └── datasets
|
9 |
+
# └── lvis ← downloads here (20.1 GB)
|
10 |
+
|
11 |
+
# 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, ..]
|
12 |
+
path: ../datasets/lvis # dataset root dir
|
13 |
+
train: train.txt # train images (relative to 'path') 100170 images
|
14 |
+
val: val.txt # val images (relative to 'path') 19809 images
|
15 |
+
minival: minival.txt # minival images (relative to 'path') 5000 images
|
16 |
+
|
17 |
+
names:
|
18 |
+
0: aerosol can/spray can
|
19 |
+
1: air conditioner
|
20 |
+
2: airplane/aeroplane
|
21 |
+
3: alarm clock
|
22 |
+
4: alcohol/alcoholic beverage
|
23 |
+
5: alligator/gator
|
24 |
+
6: almond
|
25 |
+
7: ambulance
|
26 |
+
8: amplifier
|
27 |
+
9: anklet/ankle bracelet
|
28 |
+
10: antenna/aerial/transmitting aerial
|
29 |
+
11: apple
|
30 |
+
12: applesauce
|
31 |
+
13: apricot
|
32 |
+
14: apron
|
33 |
+
15: aquarium/fish tank
|
34 |
+
16: arctic/arctic type of shoe/galosh/golosh/rubber/rubber type of shoe/gumshoe
|
35 |
+
17: armband
|
36 |
+
18: armchair
|
37 |
+
19: armoire
|
38 |
+
20: armor/armour
|
39 |
+
21: artichoke
|
40 |
+
22: trash can/garbage can/wastebin/dustbin/trash barrel/trash bin
|
41 |
+
23: ashtray
|
42 |
+
24: asparagus
|
43 |
+
25: atomizer/atomiser/spray/sprayer/nebulizer/nebuliser
|
44 |
+
26: avocado
|
45 |
+
27: award/accolade
|
46 |
+
28: awning
|
47 |
+
29: ax/axe
|
48 |
+
30: baboon
|
49 |
+
31: baby buggy/baby carriage/perambulator/pram/stroller
|
50 |
+
32: basketball backboard
|
51 |
+
33: backpack/knapsack/packsack/rucksack/haversack
|
52 |
+
34: handbag/purse/pocketbook
|
53 |
+
35: suitcase/baggage/luggage
|
54 |
+
36: bagel/beigel
|
55 |
+
37: bagpipe
|
56 |
+
38: baguet/baguette
|
57 |
+
39: bait/lure
|
58 |
+
40: ball
|
59 |
+
41: ballet skirt/tutu
|
60 |
+
42: balloon
|
61 |
+
43: bamboo
|
62 |
+
44: banana
|
63 |
+
45: Band Aid
|
64 |
+
46: bandage
|
65 |
+
47: bandanna/bandana
|
66 |
+
48: banjo
|
67 |
+
49: banner/streamer
|
68 |
+
50: barbell
|
69 |
+
51: barge
|
70 |
+
52: barrel/cask
|
71 |
+
53: barrette
|
72 |
+
54: barrow/garden cart/lawn cart/wheelbarrow
|
73 |
+
55: baseball base
|
74 |
+
56: baseball
|
75 |
+
57: baseball bat
|
76 |
+
58: baseball cap/jockey cap/golf cap
|
77 |
+
59: baseball glove/baseball mitt
|
78 |
+
60: basket/handbasket
|
79 |
+
61: basketball
|
80 |
+
62: bass horn/sousaphone/tuba
|
81 |
+
63: bat/bat animal
|
82 |
+
64: bath mat
|
83 |
+
65: bath towel
|
84 |
+
66: bathrobe
|
85 |
+
67: bathtub/bathing tub
|
86 |
+
68: batter/batter food
|
87 |
+
69: battery
|
88 |
+
70: beachball
|
89 |
+
71: bead
|
90 |
+
72: bean curd/tofu
|
91 |
+
73: beanbag
|
92 |
+
74: beanie/beany
|
93 |
+
75: bear
|
94 |
+
76: bed
|
95 |
+
77: bedpan
|
96 |
+
78: bedspread/bedcover/bed covering/counterpane/spread
|
97 |
+
79: cow
|
98 |
+
80: beef/beef food/boeuf/boeuf food
|
99 |
+
81: beeper/pager
|
100 |
+
82: beer bottle
|
101 |
+
83: beer can
|
102 |
+
84: beetle
|
103 |
+
85: bell
|
104 |
+
86: bell pepper/capsicum
|
105 |
+
87: belt
|
106 |
+
88: belt buckle
|
107 |
+
89: bench
|
108 |
+
90: beret
|
109 |
+
91: bib
|
110 |
+
92: Bible
|
111 |
+
93: bicycle/bike/bike bicycle
|
112 |
+
94: visor/vizor
|
113 |
+
95: billboard
|
114 |
+
96: binder/ring-binder
|
115 |
+
97: binoculars/field glasses/opera glasses
|
116 |
+
98: bird
|
117 |
+
99: birdfeeder
|
118 |
+
100: birdbath
|
119 |
+
101: birdcage
|
120 |
+
102: birdhouse
|
121 |
+
103: birthday cake
|
122 |
+
104: birthday card
|
123 |
+
105: pirate flag
|
124 |
+
106: black sheep
|
125 |
+
107: blackberry
|
126 |
+
108: blackboard/chalkboard
|
127 |
+
109: blanket
|
128 |
+
110: blazer/sport jacket/sport coat/sports jacket/sports coat
|
129 |
+
111: blender/liquidizer/liquidiser
|
130 |
+
112: blimp
|
131 |
+
113: blinker/flasher
|
132 |
+
114: blouse
|
133 |
+
115: blueberry
|
134 |
+
116: gameboard
|
135 |
+
117: boat/ship/ship boat
|
136 |
+
118: bob/bobber/bobfloat
|
137 |
+
119: bobbin/spool/reel
|
138 |
+
120: bobby pin/hairgrip
|
139 |
+
121: boiled egg/coddled egg
|
140 |
+
122: bolo tie/bolo/bola tie/bola
|
141 |
+
123: deadbolt
|
142 |
+
124: bolt
|
143 |
+
125: bonnet
|
144 |
+
126: book
|
145 |
+
127: bookcase
|
146 |
+
128: booklet/brochure/leaflet/pamphlet
|
147 |
+
129: bookmark/bookmarker
|
148 |
+
130: boom microphone/microphone boom
|
149 |
+
131: boot
|
150 |
+
132: bottle
|
151 |
+
133: bottle opener
|
152 |
+
134: bouquet
|
153 |
+
135: bow/bow weapon
|
154 |
+
136: bow/bow decorative ribbons
|
155 |
+
137: bow-tie/bowtie
|
156 |
+
138: bowl
|
157 |
+
139: pipe bowl
|
158 |
+
140: bowler hat/bowler/derby hat/derby/plug hat
|
159 |
+
141: bowling ball
|
160 |
+
142: box
|
161 |
+
143: boxing glove
|
162 |
+
144: suspenders
|
163 |
+
145: bracelet/bangle
|
164 |
+
146: brass plaque
|
165 |
+
147: brassiere/bra/bandeau
|
166 |
+
148: bread-bin/breadbox
|
167 |
+
149: bread
|
168 |
+
150: breechcloth/breechclout/loincloth
|
169 |
+
151: bridal gown/wedding gown/wedding dress
|
170 |
+
152: briefcase
|
171 |
+
153: broccoli
|
172 |
+
154: broach
|
173 |
+
155: broom
|
174 |
+
156: brownie
|
175 |
+
157: brussels sprouts
|
176 |
+
158: bubble gum
|
177 |
+
159: bucket/pail
|
178 |
+
160: horse buggy
|
179 |
+
161: horned cow
|
180 |
+
162: bulldog
|
181 |
+
163: bulldozer/dozer
|
182 |
+
164: bullet train
|
183 |
+
165: bulletin board/notice board
|
184 |
+
166: bulletproof vest
|
185 |
+
167: bullhorn/megaphone
|
186 |
+
168: bun/roll
|
187 |
+
169: bunk bed
|
188 |
+
170: buoy
|
189 |
+
171: burrito
|
190 |
+
172: bus/bus vehicle/autobus/charabanc/double-decker/motorbus/motorcoach
|
191 |
+
173: business card
|
192 |
+
174: butter
|
193 |
+
175: butterfly
|
194 |
+
176: button
|
195 |
+
177: cab/cab taxi/taxi/taxicab
|
196 |
+
178: cabana
|
197 |
+
179: cabin car/caboose
|
198 |
+
180: cabinet
|
199 |
+
181: locker/storage locker
|
200 |
+
182: cake
|
201 |
+
183: calculator
|
202 |
+
184: calendar
|
203 |
+
185: calf
|
204 |
+
186: camcorder
|
205 |
+
187: camel
|
206 |
+
188: camera
|
207 |
+
189: camera lens
|
208 |
+
190: camper/camper vehicle/camping bus/motor home
|
209 |
+
191: can/tin can
|
210 |
+
192: can opener/tin opener
|
211 |
+
193: candle/candlestick
|
212 |
+
194: candle holder
|
213 |
+
195: candy bar
|
214 |
+
196: candy cane
|
215 |
+
197: walking cane
|
216 |
+
198: canister/canister
|
217 |
+
199: canoe
|
218 |
+
200: cantaloup/cantaloupe
|
219 |
+
201: canteen
|
220 |
+
202: cap/cap headwear
|
221 |
+
203: bottle cap/cap/cap container lid
|
222 |
+
204: cape
|
223 |
+
205: cappuccino/coffee cappuccino
|
224 |
+
206: car/car automobile/auto/auto automobile/automobile
|
225 |
+
207: railcar/railcar part of a train/railway car/railway car part of a train/railroad car/railroad car part of a train
|
226 |
+
208: elevator car
|
227 |
+
209: car battery/automobile battery
|
228 |
+
210: identity card
|
229 |
+
211: card
|
230 |
+
212: cardigan
|
231 |
+
213: cargo ship/cargo vessel
|
232 |
+
214: carnation
|
233 |
+
215: horse carriage
|
234 |
+
216: carrot
|
235 |
+
217: tote bag
|
236 |
+
218: cart
|
237 |
+
219: carton
|
238 |
+
220: cash register/register/register for cash transactions
|
239 |
+
221: casserole
|
240 |
+
222: cassette
|
241 |
+
223: cast/plaster cast/plaster bandage
|
242 |
+
224: cat
|
243 |
+
225: cauliflower
|
244 |
+
226: cayenne/cayenne spice/cayenne pepper/cayenne pepper spice/red pepper/red pepper spice
|
245 |
+
227: CD player
|
246 |
+
228: celery
|
247 |
+
229: cellular telephone/cellular phone/cellphone/mobile phone/smart phone
|
248 |
+
230: chain mail/ring mail/chain armor/chain armour/ring armor/ring armour
|
249 |
+
231: chair
|
250 |
+
232: chaise longue/chaise/daybed
|
251 |
+
233: chalice
|
252 |
+
234: chandelier
|
253 |
+
235: chap
|
254 |
+
236: checkbook/chequebook
|
255 |
+
237: checkerboard
|
256 |
+
238: cherry
|
257 |
+
239: chessboard
|
258 |
+
240: chicken/chicken animal
|
259 |
+
241: chickpea/garbanzo
|
260 |
+
242: chili/chili vegetable/chili pepper/chili pepper vegetable/chilli/chilli vegetable/chilly/chilly vegetable/chile/chile vegetable
|
261 |
+
243: chime/gong
|
262 |
+
244: chinaware
|
263 |
+
245: crisp/crisp potato chip/potato chip
|
264 |
+
246: poker chip
|
265 |
+
247: chocolate bar
|
266 |
+
248: chocolate cake
|
267 |
+
249: chocolate milk
|
268 |
+
250: chocolate mousse
|
269 |
+
251: choker/collar/neckband
|
270 |
+
252: chopping board/cutting board/chopping block
|
271 |
+
253: chopstick
|
272 |
+
254: Christmas tree
|
273 |
+
255: slide
|
274 |
+
256: cider/cyder
|
275 |
+
257: cigar box
|
276 |
+
258: cigarette
|
277 |
+
259: cigarette case/cigarette pack
|
278 |
+
260: cistern/water tank
|
279 |
+
261: clarinet
|
280 |
+
262: clasp
|
281 |
+
263: cleansing agent/cleanser/cleaner
|
282 |
+
264: cleat/cleat for securing rope
|
283 |
+
265: clementine
|
284 |
+
266: clip
|
285 |
+
267: clipboard
|
286 |
+
268: clippers/clippers for plants
|
287 |
+
269: cloak
|
288 |
+
270: clock/timepiece/timekeeper
|
289 |
+
271: clock tower
|
290 |
+
272: clothes hamper/laundry basket/clothes basket
|
291 |
+
273: clothespin/clothes peg
|
292 |
+
274: clutch bag
|
293 |
+
275: coaster
|
294 |
+
276: coat
|
295 |
+
277: coat hanger/clothes hanger/dress hanger
|
296 |
+
278: coatrack/hatrack
|
297 |
+
279: cock/rooster
|
298 |
+
280: cockroach
|
299 |
+
281: cocoa/cocoa beverage/hot chocolate/hot chocolate beverage/drinking chocolate
|
300 |
+
282: coconut/cocoanut
|
301 |
+
283: coffee maker/coffee machine
|
302 |
+
284: coffee table/cocktail table
|
303 |
+
285: coffeepot
|
304 |
+
286: coil
|
305 |
+
287: coin
|
306 |
+
288: colander/cullender
|
307 |
+
289: coleslaw/slaw
|
308 |
+
290: coloring material/colouring material
|
309 |
+
291: combination lock
|
310 |
+
292: pacifier/teething ring
|
311 |
+
293: comic book
|
312 |
+
294: compass
|
313 |
+
295: computer keyboard/keyboard/keyboard computer
|
314 |
+
296: condiment
|
315 |
+
297: cone/traffic cone
|
316 |
+
298: control/controller
|
317 |
+
299: convertible/convertible automobile
|
318 |
+
300: sofa bed
|
319 |
+
301: cooker
|
320 |
+
302: cookie/cooky/biscuit/biscuit cookie
|
321 |
+
303: cooking utensil
|
322 |
+
304: cooler/cooler for food/ice chest
|
323 |
+
305: cork/cork bottle plug/bottle cork
|
324 |
+
306: corkboard
|
325 |
+
307: corkscrew/bottle screw
|
326 |
+
308: edible corn/corn/maize
|
327 |
+
309: cornbread
|
328 |
+
310: cornet/horn/trumpet
|
329 |
+
311: cornice/valance/valance board/pelmet
|
330 |
+
312: cornmeal
|
331 |
+
313: corset/girdle
|
332 |
+
314: costume
|
333 |
+
315: cougar/puma/catamount/mountain lion/panther
|
334 |
+
316: coverall
|
335 |
+
317: cowbell
|
336 |
+
318: cowboy hat/ten-gallon hat
|
337 |
+
319: crab/crab animal
|
338 |
+
320: crabmeat
|
339 |
+
321: cracker
|
340 |
+
322: crape/crepe/French pancake
|
341 |
+
323: crate
|
342 |
+
324: crayon/wax crayon
|
343 |
+
325: cream pitcher
|
344 |
+
326: crescent roll/croissant
|
345 |
+
327: crib/cot
|
346 |
+
328: crock pot/earthenware jar
|
347 |
+
329: crossbar
|
348 |
+
330: crouton
|
349 |
+
331: crow
|
350 |
+
332: crowbar/wrecking bar/pry bar
|
351 |
+
333: crown
|
352 |
+
334: crucifix
|
353 |
+
335: cruise ship/cruise liner
|
354 |
+
336: police cruiser/patrol car/police car/squad car
|
355 |
+
337: crumb
|
356 |
+
338: crutch
|
357 |
+
339: cub/cub animal
|
358 |
+
340: cube/square block
|
359 |
+
341: cucumber/cuke
|
360 |
+
342: cufflink
|
361 |
+
343: cup
|
362 |
+
344: trophy cup
|
363 |
+
345: cupboard/closet
|
364 |
+
346: cupcake
|
365 |
+
347: hair curler/hair roller/hair crimper
|
366 |
+
348: curling iron
|
367 |
+
349: curtain/drapery
|
368 |
+
350: cushion
|
369 |
+
351: cylinder
|
370 |
+
352: cymbal
|
371 |
+
353: dagger
|
372 |
+
354: dalmatian
|
373 |
+
355: dartboard
|
374 |
+
356: date/date fruit
|
375 |
+
357: deck chair/beach chair
|
376 |
+
358: deer/cervid
|
377 |
+
359: dental floss/floss
|
378 |
+
360: desk
|
379 |
+
361: detergent
|
380 |
+
362: diaper
|
381 |
+
363: diary/journal
|
382 |
+
364: die/dice
|
383 |
+
365: dinghy/dory/rowboat
|
384 |
+
366: dining table
|
385 |
+
367: tux/tuxedo
|
386 |
+
368: dish
|
387 |
+
369: dish antenna
|
388 |
+
370: dishrag/dishcloth
|
389 |
+
371: dishtowel/tea towel
|
390 |
+
372: dishwasher/dishwashing machine
|
391 |
+
373: dishwasher detergent/dishwashing detergent/dishwashing liquid/dishsoap
|
392 |
+
374: dispenser
|
393 |
+
375: diving board
|
394 |
+
376: Dixie cup/paper cup
|
395 |
+
377: dog
|
396 |
+
378: dog collar
|
397 |
+
379: doll
|
398 |
+
380: dollar/dollar bill/one dollar bill
|
399 |
+
381: dollhouse/doll's house
|
400 |
+
382: dolphin
|
401 |
+
383: domestic ass/donkey
|
402 |
+
384: doorknob/doorhandle
|
403 |
+
385: doormat/welcome mat
|
404 |
+
386: doughnut/donut
|
405 |
+
387: dove
|
406 |
+
388: dragonfly
|
407 |
+
389: drawer
|
408 |
+
390: underdrawers/boxers/boxershorts
|
409 |
+
391: dress/frock
|
410 |
+
392: dress hat/high hat/opera hat/silk hat/top hat
|
411 |
+
393: dress suit
|
412 |
+
394: dresser
|
413 |
+
395: drill
|
414 |
+
396: drone
|
415 |
+
397: dropper/eye dropper
|
416 |
+
398: drum/drum musical instrument
|
417 |
+
399: drumstick
|
418 |
+
400: duck
|
419 |
+
401: duckling
|
420 |
+
402: duct tape
|
421 |
+
403: duffel bag/duffle bag/duffel/duffle
|
422 |
+
404: dumbbell
|
423 |
+
405: dumpster
|
424 |
+
406: dustpan
|
425 |
+
407: eagle
|
426 |
+
408: earphone/earpiece/headphone
|
427 |
+
409: earplug
|
428 |
+
410: earring
|
429 |
+
411: easel
|
430 |
+
412: eclair
|
431 |
+
413: eel
|
432 |
+
414: egg/eggs
|
433 |
+
415: egg roll/spring roll
|
434 |
+
416: egg yolk/yolk/yolk egg
|
435 |
+
417: eggbeater/eggwhisk
|
436 |
+
418: eggplant/aubergine
|
437 |
+
419: electric chair
|
438 |
+
420: refrigerator
|
439 |
+
421: elephant
|
440 |
+
422: elk/moose
|
441 |
+
423: envelope
|
442 |
+
424: eraser
|
443 |
+
425: escargot
|
444 |
+
426: eyepatch
|
445 |
+
427: falcon
|
446 |
+
428: fan
|
447 |
+
429: faucet/spigot/tap
|
448 |
+
430: fedora
|
449 |
+
431: ferret
|
450 |
+
432: Ferris wheel
|
451 |
+
433: ferry/ferryboat
|
452 |
+
434: fig/fig fruit
|
453 |
+
435: fighter jet/fighter aircraft/attack aircraft
|
454 |
+
436: figurine
|
455 |
+
437: file cabinet/filing cabinet
|
456 |
+
438: file/file tool
|
457 |
+
439: fire alarm/smoke alarm
|
458 |
+
440: fire engine/fire truck
|
459 |
+
441: fire extinguisher/extinguisher
|
460 |
+
442: fire hose
|
461 |
+
443: fireplace
|
462 |
+
444: fireplug/fire hydrant/hydrant
|
463 |
+
445: first-aid kit
|
464 |
+
446: fish
|
465 |
+
447: fish/fish food
|
466 |
+
448: fishbowl/goldfish bowl
|
467 |
+
449: fishing rod/fishing pole
|
468 |
+
450: flag
|
469 |
+
451: flagpole/flagstaff
|
470 |
+
452: flamingo
|
471 |
+
453: flannel
|
472 |
+
454: flap
|
473 |
+
455: flash/flashbulb
|
474 |
+
456: flashlight/torch
|
475 |
+
457: fleece
|
476 |
+
458: flip-flop/flip-flop sandal
|
477 |
+
459: flipper/flipper footwear/fin/fin footwear
|
478 |
+
460: flower arrangement/floral arrangement
|
479 |
+
461: flute glass/champagne flute
|
480 |
+
462: foal
|
481 |
+
463: folding chair
|
482 |
+
464: food processor
|
483 |
+
465: football/football American
|
484 |
+
466: football helmet
|
485 |
+
467: footstool/footrest
|
486 |
+
468: fork
|
487 |
+
469: forklift
|
488 |
+
470: freight car
|
489 |
+
471: French toast
|
490 |
+
472: freshener/air freshener
|
491 |
+
473: frisbee
|
492 |
+
474: frog/toad/toad frog
|
493 |
+
475: fruit juice
|
494 |
+
476: frying pan/frypan/skillet
|
495 |
+
477: fudge
|
496 |
+
478: funnel
|
497 |
+
479: futon
|
498 |
+
480: gag/muzzle
|
499 |
+
481: garbage
|
500 |
+
482: garbage truck
|
501 |
+
483: garden hose
|
502 |
+
484: gargle/mouthwash
|
503 |
+
485: gargoyle
|
504 |
+
486: garlic/ail
|
505 |
+
487: gasmask/respirator/gas helmet
|
506 |
+
488: gazelle
|
507 |
+
489: gelatin/jelly
|
508 |
+
490: gemstone
|
509 |
+
491: generator
|
510 |
+
492: giant panda/panda/panda bear
|
511 |
+
493: gift wrap
|
512 |
+
494: ginger/gingerroot
|
513 |
+
495: giraffe
|
514 |
+
496: cincture/sash/waistband/waistcloth
|
515 |
+
497: glass/glass drink container/drinking glass
|
516 |
+
498: globe
|
517 |
+
499: glove
|
518 |
+
500: goat
|
519 |
+
501: goggles
|
520 |
+
502: goldfish
|
521 |
+
503: golf club/golf-club
|
522 |
+
504: golfcart
|
523 |
+
505: gondola/gondola boat
|
524 |
+
506: goose
|
525 |
+
507: gorilla
|
526 |
+
508: gourd
|
527 |
+
509: grape
|
528 |
+
510: grater
|
529 |
+
511: gravestone/headstone/tombstone
|
530 |
+
512: gravy boat/gravy holder
|
531 |
+
513: green bean
|
532 |
+
514: green onion/spring onion/scallion
|
533 |
+
515: griddle
|
534 |
+
516: grill/grille/grillwork/radiator grille
|
535 |
+
517: grits/hominy grits
|
536 |
+
518: grizzly/grizzly bear
|
537 |
+
519: grocery bag
|
538 |
+
520: guitar
|
539 |
+
521: gull/seagull
|
540 |
+
522: gun
|
541 |
+
523: hairbrush
|
542 |
+
524: hairnet
|
543 |
+
525: hairpin
|
544 |
+
526: halter top
|
545 |
+
527: ham/jambon/gammon
|
546 |
+
528: hamburger/beefburger/burger
|
547 |
+
529: hammer
|
548 |
+
530: hammock
|
549 |
+
531: hamper
|
550 |
+
532: hamster
|
551 |
+
533: hair dryer
|
552 |
+
534: hand glass/hand mirror
|
553 |
+
535: hand towel/face towel
|
554 |
+
536: handcart/pushcart/hand truck
|
555 |
+
537: handcuff
|
556 |
+
538: handkerchief
|
557 |
+
539: handle/grip/handgrip
|
558 |
+
540: handsaw/carpenter's saw
|
559 |
+
541: hardback book/hardcover book
|
560 |
+
542: harmonium/organ/organ musical instrument/reed organ/reed organ musical instrument
|
561 |
+
543: hat
|
562 |
+
544: hatbox
|
563 |
+
545: veil
|
564 |
+
546: headband
|
565 |
+
547: headboard
|
566 |
+
548: headlight/headlamp
|
567 |
+
549: headscarf
|
568 |
+
550: headset
|
569 |
+
551: headstall/headstall for horses/headpiece/headpiece for horses
|
570 |
+
552: heart
|
571 |
+
553: heater/warmer
|
572 |
+
554: helicopter
|
573 |
+
555: helmet
|
574 |
+
556: heron
|
575 |
+
557: highchair/feeding chair
|
576 |
+
558: hinge
|
577 |
+
559: hippopotamus
|
578 |
+
560: hockey stick
|
579 |
+
561: hog/pig
|
580 |
+
562: home plate/home plate baseball/home base/home base baseball
|
581 |
+
563: honey
|
582 |
+
564: fume hood/exhaust hood
|
583 |
+
565: hook
|
584 |
+
566: hookah/narghile/nargileh/sheesha/shisha/water pipe
|
585 |
+
567: hornet
|
586 |
+
568: horse
|
587 |
+
569: hose/hosepipe
|
588 |
+
570: hot-air balloon
|
589 |
+
571: hotplate
|
590 |
+
572: hot sauce
|
591 |
+
573: hourglass
|
592 |
+
574: houseboat
|
593 |
+
575: hummingbird
|
594 |
+
576: hummus/humus/hommos/hoummos/humous
|
595 |
+
577: polar bear
|
596 |
+
578: icecream
|
597 |
+
579: popsicle
|
598 |
+
580: ice maker
|
599 |
+
581: ice pack/ice bag
|
600 |
+
582: ice skate
|
601 |
+
583: igniter/ignitor/lighter
|
602 |
+
584: inhaler/inhalator
|
603 |
+
585: iPod
|
604 |
+
586: iron/iron for clothing/smoothing iron/smoothing iron for clothing
|
605 |
+
587: ironing board
|
606 |
+
588: jacket
|
607 |
+
589: jam
|
608 |
+
590: jar
|
609 |
+
591: jean/blue jean/denim
|
610 |
+
592: jeep/landrover
|
611 |
+
593: jelly bean/jelly egg
|
612 |
+
594: jersey/T-shirt/tee shirt
|
613 |
+
595: jet plane/jet-propelled plane
|
614 |
+
596: jewel/gem/precious stone
|
615 |
+
597: jewelry/jewellery
|
616 |
+
598: joystick
|
617 |
+
599: jumpsuit
|
618 |
+
600: kayak
|
619 |
+
601: keg
|
620 |
+
602: kennel/doghouse
|
621 |
+
603: kettle/boiler
|
622 |
+
604: key
|
623 |
+
605: keycard
|
624 |
+
606: kilt
|
625 |
+
607: kimono
|
626 |
+
608: kitchen sink
|
627 |
+
609: kitchen table
|
628 |
+
610: kite
|
629 |
+
611: kitten/kitty
|
630 |
+
612: kiwi fruit
|
631 |
+
613: knee pad
|
632 |
+
614: knife
|
633 |
+
615: knitting needle
|
634 |
+
616: knob
|
635 |
+
617: knocker/knocker on a door/doorknocker
|
636 |
+
618: koala/koala bear
|
637 |
+
619: lab coat/laboratory coat
|
638 |
+
620: ladder
|
639 |
+
621: ladle
|
640 |
+
622: ladybug/ladybeetle/ladybird beetle
|
641 |
+
623: lamb/lamb animal
|
642 |
+
624: lamb-chop/lambchop
|
643 |
+
625: lamp
|
644 |
+
626: lamppost
|
645 |
+
627: lampshade
|
646 |
+
628: lantern
|
647 |
+
629: lanyard/laniard
|
648 |
+
630: laptop computer/notebook computer
|
649 |
+
631: lasagna/lasagne
|
650 |
+
632: latch
|
651 |
+
633: lawn mower
|
652 |
+
634: leather
|
653 |
+
635: legging/legging clothing/leging/leging clothing/leg covering
|
654 |
+
636: Lego/Lego set
|
655 |
+
637: legume
|
656 |
+
638: lemon
|
657 |
+
639: lemonade
|
658 |
+
640: lettuce
|
659 |
+
641: license plate/numberplate
|
660 |
+
642: life buoy/lifesaver/life belt/life ring
|
661 |
+
643: life jacket/life vest
|
662 |
+
644: lightbulb
|
663 |
+
645: lightning rod/lightning conductor
|
664 |
+
646: lime
|
665 |
+
647: limousine
|
666 |
+
648: lion
|
667 |
+
649: lip balm
|
668 |
+
650: liquor/spirits/hard liquor/liqueur/cordial
|
669 |
+
651: lizard
|
670 |
+
652: log
|
671 |
+
653: lollipop
|
672 |
+
654: speaker/speaker stereo equipment
|
673 |
+
655: loveseat
|
674 |
+
656: machine gun
|
675 |
+
657: magazine
|
676 |
+
658: magnet
|
677 |
+
659: mail slot
|
678 |
+
660: mailbox/mailbox at home/letter box/letter box at home
|
679 |
+
661: mallard
|
680 |
+
662: mallet
|
681 |
+
663: mammoth
|
682 |
+
664: manatee
|
683 |
+
665: mandarin orange
|
684 |
+
666: manager/through
|
685 |
+
667: manhole
|
686 |
+
668: map
|
687 |
+
669: marker
|
688 |
+
670: martini
|
689 |
+
671: mascot
|
690 |
+
672: mashed potato
|
691 |
+
673: masher
|
692 |
+
674: mask/facemask
|
693 |
+
675: mast
|
694 |
+
676: mat/mat gym equipment/gym mat
|
695 |
+
677: matchbox
|
696 |
+
678: mattress
|
697 |
+
679: measuring cup
|
698 |
+
680: measuring stick/ruler/ruler measuring stick/measuring rod
|
699 |
+
681: meatball
|
700 |
+
682: medicine
|
701 |
+
683: melon
|
702 |
+
684: microphone
|
703 |
+
685: microscope
|
704 |
+
686: microwave oven
|
705 |
+
687: milestone/milepost
|
706 |
+
688: milk
|
707 |
+
689: milk can
|
708 |
+
690: milkshake
|
709 |
+
691: minivan
|
710 |
+
692: mint candy
|
711 |
+
693: mirror
|
712 |
+
694: mitten
|
713 |
+
695: mixer/mixer kitchen tool/stand mixer
|
714 |
+
696: money
|
715 |
+
697: monitor/monitor computer equipment
|
716 |
+
698: monkey
|
717 |
+
699: motor
|
718 |
+
700: motor scooter/scooter
|
719 |
+
701: motor vehicle/automotive vehicle
|
720 |
+
702: motorcycle
|
721 |
+
703: mound/mound baseball/pitcher's mound
|
722 |
+
704: mouse/mouse computer equipment/computer mouse
|
723 |
+
705: mousepad
|
724 |
+
706: muffin
|
725 |
+
707: mug
|
726 |
+
708: mushroom
|
727 |
+
709: music stool/piano stool
|
728 |
+
710: musical instrument/instrument/instrument musical
|
729 |
+
711: nailfile
|
730 |
+
712: napkin/table napkin/serviette
|
731 |
+
713: neckerchief
|
732 |
+
714: necklace
|
733 |
+
715: necktie/tie/tie necktie
|
734 |
+
716: needle
|
735 |
+
717: nest
|
736 |
+
718: newspaper/paper/paper newspaper
|
737 |
+
719: newsstand
|
738 |
+
720: nightshirt/nightwear/sleepwear/nightclothes
|
739 |
+
721: nosebag/nosebag for animals/feedbag
|
740 |
+
722: noseband/noseband for animals/nosepiece/nosepiece for animals
|
741 |
+
723: notebook
|
742 |
+
724: notepad
|
743 |
+
725: nut
|
744 |
+
726: nutcracker
|
745 |
+
727: oar
|
746 |
+
728: octopus/octopus food
|
747 |
+
729: octopus/octopus animal
|
748 |
+
730: oil lamp/kerosene lamp/kerosine lamp
|
749 |
+
731: olive oil
|
750 |
+
732: omelet/omelette
|
751 |
+
733: onion
|
752 |
+
734: orange/orange fruit
|
753 |
+
735: orange juice
|
754 |
+
736: ostrich
|
755 |
+
737: ottoman/pouf/pouffe/hassock
|
756 |
+
738: oven
|
757 |
+
739: overalls/overalls clothing
|
758 |
+
740: owl
|
759 |
+
741: packet
|
760 |
+
742: inkpad/inking pad/stamp pad
|
761 |
+
743: pad
|
762 |
+
744: paddle/boat paddle
|
763 |
+
745: padlock
|
764 |
+
746: paintbrush
|
765 |
+
747: painting
|
766 |
+
748: pajamas/pyjamas
|
767 |
+
749: palette/pallet
|
768 |
+
750: pan/pan for cooking/cooking pan
|
769 |
+
751: pan/pan metal container
|
770 |
+
752: pancake
|
771 |
+
753: pantyhose
|
772 |
+
754: papaya
|
773 |
+
755: paper plate
|
774 |
+
756: paper towel
|
775 |
+
757: paperback book/paper-back book/softback book/soft-cover book
|
776 |
+
758: paperweight
|
777 |
+
759: parachute
|
778 |
+
760: parakeet/parrakeet/parroket/paraquet/paroquet/parroquet
|
779 |
+
761: parasail/parasail sports
|
780 |
+
762: parasol/sunshade
|
781 |
+
763: parchment
|
782 |
+
764: parka/anorak
|
783 |
+
765: parking meter
|
784 |
+
766: parrot
|
785 |
+
767: passenger car/passenger car part of a train/coach/coach part of a train
|
786 |
+
768: passenger ship
|
787 |
+
769: passport
|
788 |
+
770: pastry
|
789 |
+
771: patty/patty food
|
790 |
+
772: pea/pea food
|
791 |
+
773: peach
|
792 |
+
774: peanut butter
|
793 |
+
775: pear
|
794 |
+
776: peeler/peeler tool for fruit and vegetables
|
795 |
+
777: wooden leg/pegleg
|
796 |
+
778: pegboard
|
797 |
+
779: pelican
|
798 |
+
780: pen
|
799 |
+
781: pencil
|
800 |
+
782: pencil box/pencil case
|
801 |
+
783: pencil sharpener
|
802 |
+
784: pendulum
|
803 |
+
785: penguin
|
804 |
+
786: pennant
|
805 |
+
787: penny/penny coin
|
806 |
+
788: pepper/peppercorn
|
807 |
+
789: pepper mill/pepper grinder
|
808 |
+
790: perfume
|
809 |
+
791: persimmon
|
810 |
+
792: person/baby/child/boy/girl/man/woman/human
|
811 |
+
793: pet
|
812 |
+
794: pew/pew church bench/church bench
|
813 |
+
795: phonebook/telephone book/telephone directory
|
814 |
+
796: phonograph record/phonograph recording/record/record phonograph recording
|
815 |
+
797: piano
|
816 |
+
798: pickle
|
817 |
+
799: pickup truck
|
818 |
+
800: pie
|
819 |
+
801: pigeon
|
820 |
+
802: piggy bank/penny bank
|
821 |
+
803: pillow
|
822 |
+
804: pin/pin non jewelry
|
823 |
+
805: pineapple
|
824 |
+
806: pinecone
|
825 |
+
807: ping-pong ball
|
826 |
+
808: pinwheel
|
827 |
+
809: tobacco pipe
|
828 |
+
810: pipe/piping
|
829 |
+
811: pistol/handgun
|
830 |
+
812: pita/pita bread/pocket bread
|
831 |
+
813: pitcher/pitcher vessel for liquid/ewer
|
832 |
+
814: pitchfork
|
833 |
+
815: pizza
|
834 |
+
816: place mat
|
835 |
+
817: plate
|
836 |
+
818: platter
|
837 |
+
819: playpen
|
838 |
+
820: pliers/plyers
|
839 |
+
821: plow/plow farm equipment/plough/plough farm equipment
|
840 |
+
822: plume
|
841 |
+
823: pocket watch
|
842 |
+
824: pocketknife
|
843 |
+
825: poker/poker fire stirring tool/stove poker/fire hook
|
844 |
+
826: pole/post
|
845 |
+
827: polo shirt/sport shirt
|
846 |
+
828: poncho
|
847 |
+
829: pony
|
848 |
+
830: pool table/billiard table/snooker table
|
849 |
+
831: pop/pop soda/soda/soda pop/tonic/soft drink
|
850 |
+
832: postbox/postbox public/mailbox/mailbox public
|
851 |
+
833: postcard/postal card/mailing-card
|
852 |
+
834: poster/placard
|
853 |
+
835: pot
|
854 |
+
836: flowerpot
|
855 |
+
837: potato
|
856 |
+
838: potholder
|
857 |
+
839: pottery/clayware
|
858 |
+
840: pouch
|
859 |
+
841: power shovel/excavator/digger
|
860 |
+
842: prawn/shrimp
|
861 |
+
843: pretzel
|
862 |
+
844: printer/printing machine
|
863 |
+
845: projectile/projectile weapon/missile
|
864 |
+
846: projector
|
865 |
+
847: propeller/propellor
|
866 |
+
848: prune
|
867 |
+
849: pudding
|
868 |
+
850: puffer/puffer fish/pufferfish/blowfish/globefish
|
869 |
+
851: puffin
|
870 |
+
852: pug-dog
|
871 |
+
853: pumpkin
|
872 |
+
854: puncher
|
873 |
+
855: puppet/marionette
|
874 |
+
856: puppy
|
875 |
+
857: quesadilla
|
876 |
+
858: quiche
|
877 |
+
859: quilt/comforter
|
878 |
+
860: rabbit
|
879 |
+
861: race car/racing car
|
880 |
+
862: racket/racquet
|
881 |
+
863: radar
|
882 |
+
864: radiator
|
883 |
+
865: radio receiver/radio set/radio/tuner/tuner radio
|
884 |
+
866: radish/daikon
|
885 |
+
867: raft
|
886 |
+
868: rag doll
|
887 |
+
869: raincoat/waterproof jacket
|
888 |
+
870: ram/ram animal
|
889 |
+
871: raspberry
|
890 |
+
872: rat
|
891 |
+
873: razorblade
|
892 |
+
874: reamer/reamer juicer/juicer/juice reamer
|
893 |
+
875: rearview mirror
|
894 |
+
876: receipt
|
895 |
+
877: recliner/reclining chair/lounger/lounger chair
|
896 |
+
878: record player/phonograph/phonograph record player/turntable
|
897 |
+
879: reflector
|
898 |
+
880: remote control
|
899 |
+
881: rhinoceros
|
900 |
+
882: rib/rib food
|
901 |
+
883: rifle
|
902 |
+
884: ring
|
903 |
+
885: river boat
|
904 |
+
886: road map
|
905 |
+
887: robe
|
906 |
+
888: rocking chair
|
907 |
+
889: rodent
|
908 |
+
890: roller skate
|
909 |
+
891: Rollerblade
|
910 |
+
892: rolling pin
|
911 |
+
893: root beer
|
912 |
+
894: router/router computer equipment
|
913 |
+
895: rubber band/elastic band
|
914 |
+
896: runner/runner carpet
|
915 |
+
897: plastic bag/paper bag
|
916 |
+
898: saddle/saddle on an animal
|
917 |
+
899: saddle blanket/saddlecloth/horse blanket
|
918 |
+
900: saddlebag
|
919 |
+
901: safety pin
|
920 |
+
902: sail
|
921 |
+
903: salad
|
922 |
+
904: salad plate/salad bowl
|
923 |
+
905: salami
|
924 |
+
906: salmon/salmon fish
|
925 |
+
907: salmon/salmon food
|
926 |
+
908: salsa
|
927 |
+
909: saltshaker
|
928 |
+
910: sandal/sandal type of shoe
|
929 |
+
911: sandwich
|
930 |
+
912: satchel
|
931 |
+
913: saucepan
|
932 |
+
914: saucer
|
933 |
+
915: sausage
|
934 |
+
916: sawhorse/sawbuck
|
935 |
+
917: saxophone
|
936 |
+
918: scale/scale measuring instrument
|
937 |
+
919: scarecrow/strawman
|
938 |
+
920: scarf
|
939 |
+
921: school bus
|
940 |
+
922: scissors
|
941 |
+
923: scoreboard
|
942 |
+
924: scraper
|
943 |
+
925: screwdriver
|
944 |
+
926: scrubbing brush
|
945 |
+
927: sculpture
|
946 |
+
928: seabird/seafowl
|
947 |
+
929: seahorse
|
948 |
+
930: seaplane/hydroplane
|
949 |
+
931: seashell
|
950 |
+
932: sewing machine
|
951 |
+
933: shaker
|
952 |
+
934: shampoo
|
953 |
+
935: shark
|
954 |
+
936: sharpener
|
955 |
+
937: Sharpie
|
956 |
+
938: shaver/shaver electric/electric shaver/electric razor
|
957 |
+
939: shaving cream/shaving soap
|
958 |
+
940: shawl
|
959 |
+
941: shears
|
960 |
+
942: sheep
|
961 |
+
943: shepherd dog/sheepdog
|
962 |
+
944: sherbert/sherbet
|
963 |
+
945: shield
|
964 |
+
946: shirt
|
965 |
+
947: shoe/sneaker/sneaker type of shoe/tennis shoe
|
966 |
+
948: shopping bag
|
967 |
+
949: shopping cart
|
968 |
+
950: short pants/shorts/shorts clothing/trunks/trunks clothing
|
969 |
+
951: shot glass
|
970 |
+
952: shoulder bag
|
971 |
+
953: shovel
|
972 |
+
954: shower head
|
973 |
+
955: shower cap
|
974 |
+
956: shower curtain
|
975 |
+
957: shredder/shredder for paper
|
976 |
+
958: signboard
|
977 |
+
959: silo
|
978 |
+
960: sink
|
979 |
+
961: skateboard
|
980 |
+
962: skewer
|
981 |
+
963: ski
|
982 |
+
964: ski boot
|
983 |
+
965: ski parka/ski jacket
|
984 |
+
966: ski pole
|
985 |
+
967: skirt
|
986 |
+
968: skullcap
|
987 |
+
969: sled/sledge/sleigh
|
988 |
+
970: sleeping bag
|
989 |
+
971: sling/sling bandage/triangular bandage
|
990 |
+
972: slipper/slipper footwear/carpet slipper/carpet slipper footwear
|
991 |
+
973: smoothie
|
992 |
+
974: snake/serpent
|
993 |
+
975: snowboard
|
994 |
+
976: snowman
|
995 |
+
977: snowmobile
|
996 |
+
978: soap
|
997 |
+
979: soccer ball
|
998 |
+
980: sock
|
999 |
+
981: sofa/couch/lounge
|
1000 |
+
982: softball
|
1001 |
+
983: solar array/solar battery/solar panel
|
1002 |
+
984: sombrero
|
1003 |
+
985: soup
|
1004 |
+
986: soup bowl
|
1005 |
+
987: soupspoon
|
1006 |
+
988: sour cream/soured cream
|
1007 |
+
989: soya milk/soybean milk/soymilk
|
1008 |
+
990: space shuttle
|
1009 |
+
991: sparkler/sparkler fireworks
|
1010 |
+
992: spatula
|
1011 |
+
993: spear/lance
|
1012 |
+
994: spectacles/specs/eyeglasses/glasses
|
1013 |
+
995: spice rack
|
1014 |
+
996: spider
|
1015 |
+
997: crawfish/crayfish
|
1016 |
+
998: sponge
|
1017 |
+
999: spoon
|
1018 |
+
1000: sportswear/athletic wear/activewear
|
1019 |
+
1001: spotlight
|
1020 |
+
1002: squid/squid food/calamari/calamary
|
1021 |
+
1003: squirrel
|
1022 |
+
1004: stagecoach
|
1023 |
+
1005: stapler/stapler stapling machine
|
1024 |
+
1006: starfish/sea star
|
1025 |
+
1007: statue/statue sculpture
|
1026 |
+
1008: steak/steak food
|
1027 |
+
1009: steak knife
|
1028 |
+
1010: steering wheel
|
1029 |
+
1011: stepladder
|
1030 |
+
1012: step stool
|
1031 |
+
1013: stereo/stereo sound system
|
1032 |
+
1014: stew
|
1033 |
+
1015: stirrer
|
1034 |
+
1016: stirrup
|
1035 |
+
1017: stool
|
1036 |
+
1018: stop sign
|
1037 |
+
1019: brake light
|
1038 |
+
1020: stove/kitchen stove/range/range kitchen appliance/kitchen range/cooking stove
|
1039 |
+
1021: strainer
|
1040 |
+
1022: strap
|
1041 |
+
1023: straw/straw for drinking/drinking straw
|
1042 |
+
1024: strawberry
|
1043 |
+
1025: street sign
|
1044 |
+
1026: streetlight/street lamp
|
1045 |
+
1027: string cheese
|
1046 |
+
1028: stylus
|
1047 |
+
1029: subwoofer
|
1048 |
+
1030: sugar bowl
|
1049 |
+
1031: sugarcane/sugarcane plant
|
1050 |
+
1032: suit/suit clothing
|
1051 |
+
1033: sunflower
|
1052 |
+
1034: sunglasses
|
1053 |
+
1035: sunhat
|
1054 |
+
1036: surfboard
|
1055 |
+
1037: sushi
|
1056 |
+
1038: mop
|
1057 |
+
1039: sweat pants
|
1058 |
+
1040: sweatband
|
1059 |
+
1041: sweater
|
1060 |
+
1042: sweatshirt
|
1061 |
+
1043: sweet potato
|
1062 |
+
1044: swimsuit/swimwear/bathing suit/swimming costume/bathing costume/swimming trunks/bathing trunks
|
1063 |
+
1045: sword
|
1064 |
+
1046: syringe
|
1065 |
+
1047: Tabasco sauce
|
1066 |
+
1048: table-tennis table/ping-pong table
|
1067 |
+
1049: table
|
1068 |
+
1050: table lamp
|
1069 |
+
1051: tablecloth
|
1070 |
+
1052: tachometer
|
1071 |
+
1053: taco
|
1072 |
+
1054: tag
|
1073 |
+
1055: taillight/rear light
|
1074 |
+
1056: tambourine
|
1075 |
+
1057: army tank/armored combat vehicle/armoured combat vehicle
|
1076 |
+
1058: tank/tank storage vessel/storage tank
|
1077 |
+
1059: tank top/tank top clothing
|
1078 |
+
1060: tape/tape sticky cloth or paper
|
1079 |
+
1061: tape measure/measuring tape
|
1080 |
+
1062: tapestry
|
1081 |
+
1063: tarp
|
1082 |
+
1064: tartan/plaid
|
1083 |
+
1065: tassel
|
1084 |
+
1066: tea bag
|
1085 |
+
1067: teacup
|
1086 |
+
1068: teakettle
|
1087 |
+
1069: teapot
|
1088 |
+
1070: teddy bear
|
1089 |
+
1071: telephone/phone/telephone set
|
1090 |
+
1072: telephone booth/phone booth/call box/telephone box/telephone kiosk
|
1091 |
+
1073: telephone pole/telegraph pole/telegraph post
|
1092 |
+
1074: telephoto lens/zoom lens
|
1093 |
+
1075: television camera/tv camera
|
1094 |
+
1076: television set/tv/tv set
|
1095 |
+
1077: tennis ball
|
1096 |
+
1078: tennis racket
|
1097 |
+
1079: tequila
|
1098 |
+
1080: thermometer
|
1099 |
+
1081: thermos bottle
|
1100 |
+
1082: thermostat
|
1101 |
+
1083: thimble
|
1102 |
+
1084: thread/yarn
|
1103 |
+
1085: thumbtack/drawing pin/pushpin
|
1104 |
+
1086: tiara
|
1105 |
+
1087: tiger
|
1106 |
+
1088: tights/tights clothing/leotards
|
1107 |
+
1089: timer/stopwatch
|
1108 |
+
1090: tinfoil
|
1109 |
+
1091: tinsel
|
1110 |
+
1092: tissue paper
|
1111 |
+
1093: toast/toast food
|
1112 |
+
1094: toaster
|
1113 |
+
1095: toaster oven
|
1114 |
+
1096: toilet
|
1115 |
+
1097: toilet tissue/toilet paper/bathroom tissue
|
1116 |
+
1098: tomato
|
1117 |
+
1099: tongs
|
1118 |
+
1100: toolbox
|
1119 |
+
1101: toothbrush
|
1120 |
+
1102: toothpaste
|
1121 |
+
1103: toothpick
|
1122 |
+
1104: cover
|
1123 |
+
1105: tortilla
|
1124 |
+
1106: tow truck
|
1125 |
+
1107: towel
|
1126 |
+
1108: towel rack/towel rail/towel bar
|
1127 |
+
1109: toy
|
1128 |
+
1110: tractor/tractor farm equipment
|
1129 |
+
1111: traffic light
|
1130 |
+
1112: dirt bike
|
1131 |
+
1113: trailer truck/tractor trailer/trucking rig/articulated lorry/semi truck
|
1132 |
+
1114: train/train railroad vehicle/railroad train
|
1133 |
+
1115: trampoline
|
1134 |
+
1116: tray
|
1135 |
+
1117: trench coat
|
1136 |
+
1118: triangle/triangle musical instrument
|
1137 |
+
1119: tricycle
|
1138 |
+
1120: tripod
|
1139 |
+
1121: trousers/pants/pants clothing
|
1140 |
+
1122: truck
|
1141 |
+
1123: truffle/truffle chocolate/chocolate truffle
|
1142 |
+
1124: trunk
|
1143 |
+
1125: vat
|
1144 |
+
1126: turban
|
1145 |
+
1127: turkey/turkey food
|
1146 |
+
1128: turnip
|
1147 |
+
1129: turtle
|
1148 |
+
1130: turtleneck/turtleneck clothing/polo-neck
|
1149 |
+
1131: typewriter
|
1150 |
+
1132: umbrella
|
1151 |
+
1133: underwear/underclothes/underclothing/underpants
|
1152 |
+
1134: unicycle
|
1153 |
+
1135: urinal
|
1154 |
+
1136: urn
|
1155 |
+
1137: vacuum cleaner
|
1156 |
+
1138: vase
|
1157 |
+
1139: vending machine
|
1158 |
+
1140: vent/blowhole/air vent
|
1159 |
+
1141: vest/waistcoat
|
1160 |
+
1142: videotape
|
1161 |
+
1143: vinegar
|
1162 |
+
1144: violin/fiddle
|
1163 |
+
1145: vodka
|
1164 |
+
1146: volleyball
|
1165 |
+
1147: vulture
|
1166 |
+
1148: waffle
|
1167 |
+
1149: waffle iron
|
1168 |
+
1150: wagon
|
1169 |
+
1151: wagon wheel
|
1170 |
+
1152: walking stick
|
1171 |
+
1153: wall clock
|
1172 |
+
1154: wall socket/wall plug/electric outlet/electrical outlet/outlet/electric receptacle
|
1173 |
+
1155: wallet/billfold
|
1174 |
+
1156: walrus
|
1175 |
+
1157: wardrobe
|
1176 |
+
1158: washbasin/basin/basin for washing/washbowl/washstand/handbasin
|
1177 |
+
1159: automatic washer/washing machine
|
1178 |
+
1160: watch/wristwatch
|
1179 |
+
1161: water bottle
|
1180 |
+
1162: water cooler
|
1181 |
+
1163: water faucet/water tap/tap/tap water faucet
|
1182 |
+
1164: water heater/hot-water heater
|
1183 |
+
1165: water jug
|
1184 |
+
1166: water gun/squirt gun
|
1185 |
+
1167: water scooter/sea scooter/jet ski
|
1186 |
+
1168: water ski
|
1187 |
+
1169: water tower
|
1188 |
+
1170: watering can
|
1189 |
+
1171: watermelon
|
1190 |
+
1172: weathervane/vane/vane weathervane/wind vane
|
1191 |
+
1173: webcam
|
1192 |
+
1174: wedding cake/bridecake
|
1193 |
+
1175: wedding ring/wedding band
|
1194 |
+
1176: wet suit
|
1195 |
+
1177: wheel
|
1196 |
+
1178: wheelchair
|
1197 |
+
1179: whipped cream
|
1198 |
+
1180: whistle
|
1199 |
+
1181: wig
|
1200 |
+
1182: wind chime
|
1201 |
+
1183: windmill
|
1202 |
+
1184: window box/window box for plants
|
1203 |
+
1185: windshield wiper/windscreen wiper/wiper/wiper for windshield or screen
|
1204 |
+
1186: windsock/air sock/air-sleeve/wind sleeve/wind cone
|
1205 |
+
1187: wine bottle
|
1206 |
+
1188: wine bucket/wine cooler
|
1207 |
+
1189: wineglass
|
1208 |
+
1190: blinder/blinder for horses
|
1209 |
+
1191: wok
|
1210 |
+
1192: wolf
|
1211 |
+
1193: wooden spoon
|
1212 |
+
1194: wreath
|
1213 |
+
1195: wrench/spanner
|
1214 |
+
1196: wristband
|
1215 |
+
1197: wristlet/wrist band
|
1216 |
+
1198: yacht
|
1217 |
+
1199: yogurt/yoghurt/yoghourt
|
1218 |
+
1200: yoke/yoke animal equipment
|
1219 |
+
1201: zebra
|
1220 |
+
1202: zucchini/courgette
|
1221 |
+
|
1222 |
+
# Download script/URL (optional)
|
1223 |
+
download: |
|
1224 |
+
from pathlib import Path
|
1225 |
+
|
1226 |
+
from ultralytics.utils.downloads import download
|
1227 |
+
|
1228 |
+
# Download labels
|
1229 |
+
dir = Path(yaml["path"]) # dataset root dir
|
1230 |
+
url = "https://github.com/ultralytics/assets/releases/download/v0.0.0/"
|
1231 |
+
urls = [f"{url}lvis-labels-segments.zip"]
|
1232 |
+
download(urls, dir=dir.parent)
|
1233 |
+
|
1234 |
+
# Download data
|
1235 |
+
urls = [
|
1236 |
+
"http://images.cocodataset.org/zips/train2017.zip", # 19G, 118k images
|
1237 |
+
"http://images.cocodataset.org/zips/val2017.zip", # 1G, 5k images
|
1238 |
+
"http://images.cocodataset.org/zips/test2017.zip", # 7G, 41k images (optional)
|
1239 |
+
]
|
1240 |
+
download(urls, dir=dir / "images", threads=3)
|
ultralytics/cfg/datasets/medical-pills.yaml
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# Medical-pills dataset by Ultralytics
|
4 |
+
# Documentation: https://docs.ultralytics.com/datasets/detect/medical-pills/
|
5 |
+
# Example usage: yolo train data=medical-pills.yaml
|
6 |
+
# parent
|
7 |
+
# ├── ultralytics
|
8 |
+
# └── datasets
|
9 |
+
# └── medical-pills ← downloads here (8.19 MB)
|
10 |
+
|
11 |
+
# 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, ..]
|
12 |
+
path: ../datasets/medical-pills # dataset root dir
|
13 |
+
train: train/images # train images (relative to 'path') 92 images
|
14 |
+
val: valid/images # val images (relative to 'path') 23 images
|
15 |
+
test: # test images (relative to 'path')
|
16 |
+
|
17 |
+
# Classes
|
18 |
+
names:
|
19 |
+
0: pill
|
20 |
+
|
21 |
+
# Download script/URL (optional)
|
22 |
+
download: https://github.com/ultralytics/assets/releases/download/v0.0.0/medical-pills.zip
|
ultralytics/cfg/datasets/open-images-v7.yaml
ADDED
@@ -0,0 +1,666 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# Open Images v7 dataset https://storage.googleapis.com/openimages/web/index.html by Google
|
4 |
+
# Documentation: https://docs.ultralytics.com/datasets/detect/open-images-v7/
|
5 |
+
# Example usage: yolo train data=open-images-v7.yaml
|
6 |
+
# parent
|
7 |
+
# ├── ultralytics
|
8 |
+
# └── datasets
|
9 |
+
# └── open-images-v7 ← downloads here (561 GB)
|
10 |
+
|
11 |
+
# 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, ..]
|
12 |
+
path: ../datasets/open-images-v7 # dataset root dir
|
13 |
+
train: images/train # train images (relative to 'path') 1743042 images
|
14 |
+
val: images/val # val images (relative to 'path') 41620 images
|
15 |
+
test: # test images (optional)
|
16 |
+
|
17 |
+
# Classes
|
18 |
+
names:
|
19 |
+
0: Accordion
|
20 |
+
1: Adhesive tape
|
21 |
+
2: Aircraft
|
22 |
+
3: Airplane
|
23 |
+
4: Alarm clock
|
24 |
+
5: Alpaca
|
25 |
+
6: Ambulance
|
26 |
+
7: Animal
|
27 |
+
8: Ant
|
28 |
+
9: Antelope
|
29 |
+
10: Apple
|
30 |
+
11: Armadillo
|
31 |
+
12: Artichoke
|
32 |
+
13: Auto part
|
33 |
+
14: Axe
|
34 |
+
15: Backpack
|
35 |
+
16: Bagel
|
36 |
+
17: Baked goods
|
37 |
+
18: Balance beam
|
38 |
+
19: Ball
|
39 |
+
20: Balloon
|
40 |
+
21: Banana
|
41 |
+
22: Band-aid
|
42 |
+
23: Banjo
|
43 |
+
24: Barge
|
44 |
+
25: Barrel
|
45 |
+
26: Baseball bat
|
46 |
+
27: Baseball glove
|
47 |
+
28: Bat (Animal)
|
48 |
+
29: Bathroom accessory
|
49 |
+
30: Bathroom cabinet
|
50 |
+
31: Bathtub
|
51 |
+
32: Beaker
|
52 |
+
33: Bear
|
53 |
+
34: Bed
|
54 |
+
35: Bee
|
55 |
+
36: Beehive
|
56 |
+
37: Beer
|
57 |
+
38: Beetle
|
58 |
+
39: Bell pepper
|
59 |
+
40: Belt
|
60 |
+
41: Bench
|
61 |
+
42: Bicycle
|
62 |
+
43: Bicycle helmet
|
63 |
+
44: Bicycle wheel
|
64 |
+
45: Bidet
|
65 |
+
46: Billboard
|
66 |
+
47: Billiard table
|
67 |
+
48: Binoculars
|
68 |
+
49: Bird
|
69 |
+
50: Blender
|
70 |
+
51: Blue jay
|
71 |
+
52: Boat
|
72 |
+
53: Bomb
|
73 |
+
54: Book
|
74 |
+
55: Bookcase
|
75 |
+
56: Boot
|
76 |
+
57: Bottle
|
77 |
+
58: Bottle opener
|
78 |
+
59: Bow and arrow
|
79 |
+
60: Bowl
|
80 |
+
61: Bowling equipment
|
81 |
+
62: Box
|
82 |
+
63: Boy
|
83 |
+
64: Brassiere
|
84 |
+
65: Bread
|
85 |
+
66: Briefcase
|
86 |
+
67: Broccoli
|
87 |
+
68: Bronze sculpture
|
88 |
+
69: Brown bear
|
89 |
+
70: Building
|
90 |
+
71: Bull
|
91 |
+
72: Burrito
|
92 |
+
73: Bus
|
93 |
+
74: Bust
|
94 |
+
75: Butterfly
|
95 |
+
76: Cabbage
|
96 |
+
77: Cabinetry
|
97 |
+
78: Cake
|
98 |
+
79: Cake stand
|
99 |
+
80: Calculator
|
100 |
+
81: Camel
|
101 |
+
82: Camera
|
102 |
+
83: Can opener
|
103 |
+
84: Canary
|
104 |
+
85: Candle
|
105 |
+
86: Candy
|
106 |
+
87: Cannon
|
107 |
+
88: Canoe
|
108 |
+
89: Cantaloupe
|
109 |
+
90: Car
|
110 |
+
91: Carnivore
|
111 |
+
92: Carrot
|
112 |
+
93: Cart
|
113 |
+
94: Cassette deck
|
114 |
+
95: Castle
|
115 |
+
96: Cat
|
116 |
+
97: Cat furniture
|
117 |
+
98: Caterpillar
|
118 |
+
99: Cattle
|
119 |
+
100: Ceiling fan
|
120 |
+
101: Cello
|
121 |
+
102: Centipede
|
122 |
+
103: Chainsaw
|
123 |
+
104: Chair
|
124 |
+
105: Cheese
|
125 |
+
106: Cheetah
|
126 |
+
107: Chest of drawers
|
127 |
+
108: Chicken
|
128 |
+
109: Chime
|
129 |
+
110: Chisel
|
130 |
+
111: Chopsticks
|
131 |
+
112: Christmas tree
|
132 |
+
113: Clock
|
133 |
+
114: Closet
|
134 |
+
115: Clothing
|
135 |
+
116: Coat
|
136 |
+
117: Cocktail
|
137 |
+
118: Cocktail shaker
|
138 |
+
119: Coconut
|
139 |
+
120: Coffee
|
140 |
+
121: Coffee cup
|
141 |
+
122: Coffee table
|
142 |
+
123: Coffeemaker
|
143 |
+
124: Coin
|
144 |
+
125: Common fig
|
145 |
+
126: Common sunflower
|
146 |
+
127: Computer keyboard
|
147 |
+
128: Computer monitor
|
148 |
+
129: Computer mouse
|
149 |
+
130: Container
|
150 |
+
131: Convenience store
|
151 |
+
132: Cookie
|
152 |
+
133: Cooking spray
|
153 |
+
134: Corded phone
|
154 |
+
135: Cosmetics
|
155 |
+
136: Couch
|
156 |
+
137: Countertop
|
157 |
+
138: Cowboy hat
|
158 |
+
139: Crab
|
159 |
+
140: Cream
|
160 |
+
141: Cricket ball
|
161 |
+
142: Crocodile
|
162 |
+
143: Croissant
|
163 |
+
144: Crown
|
164 |
+
145: Crutch
|
165 |
+
146: Cucumber
|
166 |
+
147: Cupboard
|
167 |
+
148: Curtain
|
168 |
+
149: Cutting board
|
169 |
+
150: Dagger
|
170 |
+
151: Dairy Product
|
171 |
+
152: Deer
|
172 |
+
153: Desk
|
173 |
+
154: Dessert
|
174 |
+
155: Diaper
|
175 |
+
156: Dice
|
176 |
+
157: Digital clock
|
177 |
+
158: Dinosaur
|
178 |
+
159: Dishwasher
|
179 |
+
160: Dog
|
180 |
+
161: Dog bed
|
181 |
+
162: Doll
|
182 |
+
163: Dolphin
|
183 |
+
164: Door
|
184 |
+
165: Door handle
|
185 |
+
166: Doughnut
|
186 |
+
167: Dragonfly
|
187 |
+
168: Drawer
|
188 |
+
169: Dress
|
189 |
+
170: Drill (Tool)
|
190 |
+
171: Drink
|
191 |
+
172: Drinking straw
|
192 |
+
173: Drum
|
193 |
+
174: Duck
|
194 |
+
175: Dumbbell
|
195 |
+
176: Eagle
|
196 |
+
177: Earrings
|
197 |
+
178: Egg (Food)
|
198 |
+
179: Elephant
|
199 |
+
180: Envelope
|
200 |
+
181: Eraser
|
201 |
+
182: Face powder
|
202 |
+
183: Facial tissue holder
|
203 |
+
184: Falcon
|
204 |
+
185: Fashion accessory
|
205 |
+
186: Fast food
|
206 |
+
187: Fax
|
207 |
+
188: Fedora
|
208 |
+
189: Filing cabinet
|
209 |
+
190: Fire hydrant
|
210 |
+
191: Fireplace
|
211 |
+
192: Fish
|
212 |
+
193: Flag
|
213 |
+
194: Flashlight
|
214 |
+
195: Flower
|
215 |
+
196: Flowerpot
|
216 |
+
197: Flute
|
217 |
+
198: Flying disc
|
218 |
+
199: Food
|
219 |
+
200: Food processor
|
220 |
+
201: Football
|
221 |
+
202: Football helmet
|
222 |
+
203: Footwear
|
223 |
+
204: Fork
|
224 |
+
205: Fountain
|
225 |
+
206: Fox
|
226 |
+
207: French fries
|
227 |
+
208: French horn
|
228 |
+
209: Frog
|
229 |
+
210: Fruit
|
230 |
+
211: Frying pan
|
231 |
+
212: Furniture
|
232 |
+
213: Garden Asparagus
|
233 |
+
214: Gas stove
|
234 |
+
215: Giraffe
|
235 |
+
216: Girl
|
236 |
+
217: Glasses
|
237 |
+
218: Glove
|
238 |
+
219: Goat
|
239 |
+
220: Goggles
|
240 |
+
221: Goldfish
|
241 |
+
222: Golf ball
|
242 |
+
223: Golf cart
|
243 |
+
224: Gondola
|
244 |
+
225: Goose
|
245 |
+
226: Grape
|
246 |
+
227: Grapefruit
|
247 |
+
228: Grinder
|
248 |
+
229: Guacamole
|
249 |
+
230: Guitar
|
250 |
+
231: Hair dryer
|
251 |
+
232: Hair spray
|
252 |
+
233: Hamburger
|
253 |
+
234: Hammer
|
254 |
+
235: Hamster
|
255 |
+
236: Hand dryer
|
256 |
+
237: Handbag
|
257 |
+
238: Handgun
|
258 |
+
239: Harbor seal
|
259 |
+
240: Harmonica
|
260 |
+
241: Harp
|
261 |
+
242: Harpsichord
|
262 |
+
243: Hat
|
263 |
+
244: Headphones
|
264 |
+
245: Heater
|
265 |
+
246: Hedgehog
|
266 |
+
247: Helicopter
|
267 |
+
248: Helmet
|
268 |
+
249: High heels
|
269 |
+
250: Hiking equipment
|
270 |
+
251: Hippopotamus
|
271 |
+
252: Home appliance
|
272 |
+
253: Honeycomb
|
273 |
+
254: Horizontal bar
|
274 |
+
255: Horse
|
275 |
+
256: Hot dog
|
276 |
+
257: House
|
277 |
+
258: Houseplant
|
278 |
+
259: Human arm
|
279 |
+
260: Human beard
|
280 |
+
261: Human body
|
281 |
+
262: Human ear
|
282 |
+
263: Human eye
|
283 |
+
264: Human face
|
284 |
+
265: Human foot
|
285 |
+
266: Human hair
|
286 |
+
267: Human hand
|
287 |
+
268: Human head
|
288 |
+
269: Human leg
|
289 |
+
270: Human mouth
|
290 |
+
271: Human nose
|
291 |
+
272: Humidifier
|
292 |
+
273: Ice cream
|
293 |
+
274: Indoor rower
|
294 |
+
275: Infant bed
|
295 |
+
276: Insect
|
296 |
+
277: Invertebrate
|
297 |
+
278: Ipod
|
298 |
+
279: Isopod
|
299 |
+
280: Jacket
|
300 |
+
281: Jacuzzi
|
301 |
+
282: Jaguar (Animal)
|
302 |
+
283: Jeans
|
303 |
+
284: Jellyfish
|
304 |
+
285: Jet ski
|
305 |
+
286: Jug
|
306 |
+
287: Juice
|
307 |
+
288: Kangaroo
|
308 |
+
289: Kettle
|
309 |
+
290: Kitchen & dining room table
|
310 |
+
291: Kitchen appliance
|
311 |
+
292: Kitchen knife
|
312 |
+
293: Kitchen utensil
|
313 |
+
294: Kitchenware
|
314 |
+
295: Kite
|
315 |
+
296: Knife
|
316 |
+
297: Koala
|
317 |
+
298: Ladder
|
318 |
+
299: Ladle
|
319 |
+
300: Ladybug
|
320 |
+
301: Lamp
|
321 |
+
302: Land vehicle
|
322 |
+
303: Lantern
|
323 |
+
304: Laptop
|
324 |
+
305: Lavender (Plant)
|
325 |
+
306: Lemon
|
326 |
+
307: Leopard
|
327 |
+
308: Light bulb
|
328 |
+
309: Light switch
|
329 |
+
310: Lighthouse
|
330 |
+
311: Lily
|
331 |
+
312: Limousine
|
332 |
+
313: Lion
|
333 |
+
314: Lipstick
|
334 |
+
315: Lizard
|
335 |
+
316: Lobster
|
336 |
+
317: Loveseat
|
337 |
+
318: Luggage and bags
|
338 |
+
319: Lynx
|
339 |
+
320: Magpie
|
340 |
+
321: Mammal
|
341 |
+
322: Man
|
342 |
+
323: Mango
|
343 |
+
324: Maple
|
344 |
+
325: Maracas
|
345 |
+
326: Marine invertebrates
|
346 |
+
327: Marine mammal
|
347 |
+
328: Measuring cup
|
348 |
+
329: Mechanical fan
|
349 |
+
330: Medical equipment
|
350 |
+
331: Microphone
|
351 |
+
332: Microwave oven
|
352 |
+
333: Milk
|
353 |
+
334: Miniskirt
|
354 |
+
335: Mirror
|
355 |
+
336: Missile
|
356 |
+
337: Mixer
|
357 |
+
338: Mixing bowl
|
358 |
+
339: Mobile phone
|
359 |
+
340: Monkey
|
360 |
+
341: Moths and butterflies
|
361 |
+
342: Motorcycle
|
362 |
+
343: Mouse
|
363 |
+
344: Muffin
|
364 |
+
345: Mug
|
365 |
+
346: Mule
|
366 |
+
347: Mushroom
|
367 |
+
348: Musical instrument
|
368 |
+
349: Musical keyboard
|
369 |
+
350: Nail (Construction)
|
370 |
+
351: Necklace
|
371 |
+
352: Nightstand
|
372 |
+
353: Oboe
|
373 |
+
354: Office building
|
374 |
+
355: Office supplies
|
375 |
+
356: Orange
|
376 |
+
357: Organ (Musical Instrument)
|
377 |
+
358: Ostrich
|
378 |
+
359: Otter
|
379 |
+
360: Oven
|
380 |
+
361: Owl
|
381 |
+
362: Oyster
|
382 |
+
363: Paddle
|
383 |
+
364: Palm tree
|
384 |
+
365: Pancake
|
385 |
+
366: Panda
|
386 |
+
367: Paper cutter
|
387 |
+
368: Paper towel
|
388 |
+
369: Parachute
|
389 |
+
370: Parking meter
|
390 |
+
371: Parrot
|
391 |
+
372: Pasta
|
392 |
+
373: Pastry
|
393 |
+
374: Peach
|
394 |
+
375: Pear
|
395 |
+
376: Pen
|
396 |
+
377: Pencil case
|
397 |
+
378: Pencil sharpener
|
398 |
+
379: Penguin
|
399 |
+
380: Perfume
|
400 |
+
381: Person
|
401 |
+
382: Personal care
|
402 |
+
383: Personal flotation device
|
403 |
+
384: Piano
|
404 |
+
385: Picnic basket
|
405 |
+
386: Picture frame
|
406 |
+
387: Pig
|
407 |
+
388: Pillow
|
408 |
+
389: Pineapple
|
409 |
+
390: Pitcher (Container)
|
410 |
+
391: Pizza
|
411 |
+
392: Pizza cutter
|
412 |
+
393: Plant
|
413 |
+
394: Plastic bag
|
414 |
+
395: Plate
|
415 |
+
396: Platter
|
416 |
+
397: Plumbing fixture
|
417 |
+
398: Polar bear
|
418 |
+
399: Pomegranate
|
419 |
+
400: Popcorn
|
420 |
+
401: Porch
|
421 |
+
402: Porcupine
|
422 |
+
403: Poster
|
423 |
+
404: Potato
|
424 |
+
405: Power plugs and sockets
|
425 |
+
406: Pressure cooker
|
426 |
+
407: Pretzel
|
427 |
+
408: Printer
|
428 |
+
409: Pumpkin
|
429 |
+
410: Punching bag
|
430 |
+
411: Rabbit
|
431 |
+
412: Raccoon
|
432 |
+
413: Racket
|
433 |
+
414: Radish
|
434 |
+
415: Ratchet (Device)
|
435 |
+
416: Raven
|
436 |
+
417: Rays and skates
|
437 |
+
418: Red panda
|
438 |
+
419: Refrigerator
|
439 |
+
420: Remote control
|
440 |
+
421: Reptile
|
441 |
+
422: Rhinoceros
|
442 |
+
423: Rifle
|
443 |
+
424: Ring binder
|
444 |
+
425: Rocket
|
445 |
+
426: Roller skates
|
446 |
+
427: Rose
|
447 |
+
428: Rugby ball
|
448 |
+
429: Ruler
|
449 |
+
430: Salad
|
450 |
+
431: Salt and pepper shakers
|
451 |
+
432: Sandal
|
452 |
+
433: Sandwich
|
453 |
+
434: Saucer
|
454 |
+
435: Saxophone
|
455 |
+
436: Scale
|
456 |
+
437: Scarf
|
457 |
+
438: Scissors
|
458 |
+
439: Scoreboard
|
459 |
+
440: Scorpion
|
460 |
+
441: Screwdriver
|
461 |
+
442: Sculpture
|
462 |
+
443: Sea lion
|
463 |
+
444: Sea turtle
|
464 |
+
445: Seafood
|
465 |
+
446: Seahorse
|
466 |
+
447: Seat belt
|
467 |
+
448: Segway
|
468 |
+
449: Serving tray
|
469 |
+
450: Sewing machine
|
470 |
+
451: Shark
|
471 |
+
452: Sheep
|
472 |
+
453: Shelf
|
473 |
+
454: Shellfish
|
474 |
+
455: Shirt
|
475 |
+
456: Shorts
|
476 |
+
457: Shotgun
|
477 |
+
458: Shower
|
478 |
+
459: Shrimp
|
479 |
+
460: Sink
|
480 |
+
461: Skateboard
|
481 |
+
462: Ski
|
482 |
+
463: Skirt
|
483 |
+
464: Skull
|
484 |
+
465: Skunk
|
485 |
+
466: Skyscraper
|
486 |
+
467: Slow cooker
|
487 |
+
468: Snack
|
488 |
+
469: Snail
|
489 |
+
470: Snake
|
490 |
+
471: Snowboard
|
491 |
+
472: Snowman
|
492 |
+
473: Snowmobile
|
493 |
+
474: Snowplow
|
494 |
+
475: Soap dispenser
|
495 |
+
476: Sock
|
496 |
+
477: Sofa bed
|
497 |
+
478: Sombrero
|
498 |
+
479: Sparrow
|
499 |
+
480: Spatula
|
500 |
+
481: Spice rack
|
501 |
+
482: Spider
|
502 |
+
483: Spoon
|
503 |
+
484: Sports equipment
|
504 |
+
485: Sports uniform
|
505 |
+
486: Squash (Plant)
|
506 |
+
487: Squid
|
507 |
+
488: Squirrel
|
508 |
+
489: Stairs
|
509 |
+
490: Stapler
|
510 |
+
491: Starfish
|
511 |
+
492: Stationary bicycle
|
512 |
+
493: Stethoscope
|
513 |
+
494: Stool
|
514 |
+
495: Stop sign
|
515 |
+
496: Strawberry
|
516 |
+
497: Street light
|
517 |
+
498: Stretcher
|
518 |
+
499: Studio couch
|
519 |
+
500: Submarine
|
520 |
+
501: Submarine sandwich
|
521 |
+
502: Suit
|
522 |
+
503: Suitcase
|
523 |
+
504: Sun hat
|
524 |
+
505: Sunglasses
|
525 |
+
506: Surfboard
|
526 |
+
507: Sushi
|
527 |
+
508: Swan
|
528 |
+
509: Swim cap
|
529 |
+
510: Swimming pool
|
530 |
+
511: Swimwear
|
531 |
+
512: Sword
|
532 |
+
513: Syringe
|
533 |
+
514: Table
|
534 |
+
515: Table tennis racket
|
535 |
+
516: Tablet computer
|
536 |
+
517: Tableware
|
537 |
+
518: Taco
|
538 |
+
519: Tank
|
539 |
+
520: Tap
|
540 |
+
521: Tart
|
541 |
+
522: Taxi
|
542 |
+
523: Tea
|
543 |
+
524: Teapot
|
544 |
+
525: Teddy bear
|
545 |
+
526: Telephone
|
546 |
+
527: Television
|
547 |
+
528: Tennis ball
|
548 |
+
529: Tennis racket
|
549 |
+
530: Tent
|
550 |
+
531: Tiara
|
551 |
+
532: Tick
|
552 |
+
533: Tie
|
553 |
+
534: Tiger
|
554 |
+
535: Tin can
|
555 |
+
536: Tire
|
556 |
+
537: Toaster
|
557 |
+
538: Toilet
|
558 |
+
539: Toilet paper
|
559 |
+
540: Tomato
|
560 |
+
541: Tool
|
561 |
+
542: Toothbrush
|
562 |
+
543: Torch
|
563 |
+
544: Tortoise
|
564 |
+
545: Towel
|
565 |
+
546: Tower
|
566 |
+
547: Toy
|
567 |
+
548: Traffic light
|
568 |
+
549: Traffic sign
|
569 |
+
550: Train
|
570 |
+
551: Training bench
|
571 |
+
552: Treadmill
|
572 |
+
553: Tree
|
573 |
+
554: Tree house
|
574 |
+
555: Tripod
|
575 |
+
556: Trombone
|
576 |
+
557: Trousers
|
577 |
+
558: Truck
|
578 |
+
559: Trumpet
|
579 |
+
560: Turkey
|
580 |
+
561: Turtle
|
581 |
+
562: Umbrella
|
582 |
+
563: Unicycle
|
583 |
+
564: Van
|
584 |
+
565: Vase
|
585 |
+
566: Vegetable
|
586 |
+
567: Vehicle
|
587 |
+
568: Vehicle registration plate
|
588 |
+
569: Violin
|
589 |
+
570: Volleyball (Ball)
|
590 |
+
571: Waffle
|
591 |
+
572: Waffle iron
|
592 |
+
573: Wall clock
|
593 |
+
574: Wardrobe
|
594 |
+
575: Washing machine
|
595 |
+
576: Waste container
|
596 |
+
577: Watch
|
597 |
+
578: Watercraft
|
598 |
+
579: Watermelon
|
599 |
+
580: Weapon
|
600 |
+
581: Whale
|
601 |
+
582: Wheel
|
602 |
+
583: Wheelchair
|
603 |
+
584: Whisk
|
604 |
+
585: Whiteboard
|
605 |
+
586: Willow
|
606 |
+
587: Window
|
607 |
+
588: Window blind
|
608 |
+
589: Wine
|
609 |
+
590: Wine glass
|
610 |
+
591: Wine rack
|
611 |
+
592: Winter melon
|
612 |
+
593: Wok
|
613 |
+
594: Woman
|
614 |
+
595: Wood-burning stove
|
615 |
+
596: Woodpecker
|
616 |
+
597: Worm
|
617 |
+
598: Wrench
|
618 |
+
599: Zebra
|
619 |
+
600: Zucchini
|
620 |
+
|
621 |
+
# Download script/URL (optional) ---------------------------------------------------------------------------------------
|
622 |
+
download: |
|
623 |
+
import warnings
|
624 |
+
|
625 |
+
from ultralytics.utils import LOGGER, SETTINGS, Path, get_ubuntu_version, is_ubuntu
|
626 |
+
from ultralytics.utils.checks import check_requirements, check_version
|
627 |
+
|
628 |
+
check_requirements("fiftyone")
|
629 |
+
if is_ubuntu() and check_version(get_ubuntu_version(), ">=22.04"):
|
630 |
+
# Ubuntu>=22.04 patch https://github.com/voxel51/fiftyone/issues/2961#issuecomment-1666519347
|
631 |
+
check_requirements("fiftyone-db-ubuntu2204")
|
632 |
+
|
633 |
+
import fiftyone as fo
|
634 |
+
import fiftyone.zoo as foz
|
635 |
+
|
636 |
+
name = "open-images-v7"
|
637 |
+
fo.config.dataset_zoo_dir = Path(SETTINGS["datasets_dir"]) / "fiftyone" / name
|
638 |
+
fraction = 1.0 # fraction of full dataset to use
|
639 |
+
LOGGER.warning("WARNING ⚠️ Open Images V7 dataset requires at least **561 GB of free space. Starting download...")
|
640 |
+
for split in "train", "validation": # 1743042 train, 41620 val images
|
641 |
+
train = split == "train"
|
642 |
+
|
643 |
+
# Load Open Images dataset
|
644 |
+
dataset = foz.load_zoo_dataset(
|
645 |
+
name,
|
646 |
+
split=split,
|
647 |
+
label_types=["detections"],
|
648 |
+
max_samples=round((1743042 if train else 41620) * fraction),
|
649 |
+
)
|
650 |
+
|
651 |
+
# Define classes
|
652 |
+
if train:
|
653 |
+
classes = dataset.default_classes # all classes
|
654 |
+
# classes = dataset.distinct('ground_truth.detections.label') # only observed classes
|
655 |
+
|
656 |
+
# Export to YOLO format
|
657 |
+
with warnings.catch_warnings():
|
658 |
+
warnings.filterwarnings("ignore", category=UserWarning, module="fiftyone.utils.yolo")
|
659 |
+
dataset.export(
|
660 |
+
export_dir=str(Path(SETTINGS["datasets_dir"]) / name),
|
661 |
+
dataset_type=fo.types.YOLOv5Dataset,
|
662 |
+
label_field="ground_truth",
|
663 |
+
split="val" if split == "validation" else split,
|
664 |
+
classes=classes,
|
665 |
+
overwrite=train,
|
666 |
+
)
|
ultralytics/cfg/datasets/package-seg.yaml
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# Package-seg dataset by Ultralytics
|
4 |
+
# Documentation: https://docs.ultralytics.com/datasets/segment/package-seg/
|
5 |
+
# Example usage: yolo train data=package-seg.yaml
|
6 |
+
# parent
|
7 |
+
# ├── ultralytics
|
8 |
+
# └── datasets
|
9 |
+
# └── package-seg ← downloads here (102 MB)
|
10 |
+
|
11 |
+
# 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, ..]
|
12 |
+
path: ../datasets/package-seg # dataset root dir
|
13 |
+
train: train/images # train images (relative to 'path') 1920 images
|
14 |
+
val: valid/images # val images (relative to 'path') 89 images
|
15 |
+
test: test/images # test images (relative to 'path') 188 images
|
16 |
+
|
17 |
+
# Classes
|
18 |
+
names:
|
19 |
+
0: package
|
20 |
+
|
21 |
+
# Download script/URL (optional)
|
22 |
+
download: https://github.com/ultralytics/assets/releases/download/v0.0.0/package-seg.zip
|
ultralytics/cfg/datasets/signature.yaml
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# Signature dataset by Ultralytics
|
4 |
+
# Documentation: https://docs.ultralytics.com/datasets/detect/signature/
|
5 |
+
# Example usage: yolo train data=signature.yaml
|
6 |
+
# parent
|
7 |
+
# ├── ultralytics
|
8 |
+
# └── datasets
|
9 |
+
# └── signature ← downloads here (11.2 MB)
|
10 |
+
|
11 |
+
# 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, ..]
|
12 |
+
path: ../datasets/signature # dataset root dir
|
13 |
+
train: train/images # train images (relative to 'path') 143 images
|
14 |
+
val: valid/images # val images (relative to 'path') 35 images
|
15 |
+
|
16 |
+
# Classes
|
17 |
+
names:
|
18 |
+
0: signature
|
19 |
+
|
20 |
+
# Download script/URL (optional)
|
21 |
+
download: https://github.com/ultralytics/assets/releases/download/v0.0.0/signature.zip
|
ultralytics/cfg/datasets/tiger-pose.yaml
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# Tiger Pose dataset by Ultralytics
|
4 |
+
# Documentation: https://docs.ultralytics.com/datasets/pose/tiger-pose/
|
5 |
+
# Example usage: yolo train data=tiger-pose.yaml
|
6 |
+
# parent
|
7 |
+
# ├── ultralytics
|
8 |
+
# └── datasets
|
9 |
+
# └── tiger-pose ← downloads here (75.3 MB)
|
10 |
+
|
11 |
+
# 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, ..]
|
12 |
+
path: ../datasets/tiger-pose # dataset root dir
|
13 |
+
train: train # train images (relative to 'path') 210 images
|
14 |
+
val: val # val images (relative to 'path') 53 images
|
15 |
+
|
16 |
+
# Keypoints
|
17 |
+
kpt_shape: [12, 2] # number of keypoints, number of dims (2 for x,y or 3 for x,y,visible)
|
18 |
+
flip_idx: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
|
19 |
+
|
20 |
+
# Classes
|
21 |
+
names:
|
22 |
+
0: tiger
|
23 |
+
|
24 |
+
# Download script/URL (optional)
|
25 |
+
download: https://github.com/ultralytics/assets/releases/download/v0.0.0/tiger-pose.zip
|
ultralytics/cfg/datasets/xView.yaml
ADDED
@@ -0,0 +1,155 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# DIUx xView 2018 Challenge https://challenge.xviewdataset.org by U.S. National Geospatial-Intelligence Agency (NGA)
|
4 |
+
# -------- DOWNLOAD DATA MANUALLY and jar xf val_images.zip to 'datasets/xView' before running train command! --------
|
5 |
+
# Documentation: https://docs.ultralytics.com/datasets/detect/xview/
|
6 |
+
# Example usage: yolo train data=xView.yaml
|
7 |
+
# parent
|
8 |
+
# ├── ultralytics
|
9 |
+
# └── datasets
|
10 |
+
# └── xView ← downloads here (20.7 GB)
|
11 |
+
|
12 |
+
# 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, ..]
|
13 |
+
path: ../datasets/xView # dataset root dir
|
14 |
+
train: images/autosplit_train.txt # train images (relative to 'path') 90% of 847 train images
|
15 |
+
val: images/autosplit_val.txt # train images (relative to 'path') 10% of 847 train images
|
16 |
+
|
17 |
+
# Classes
|
18 |
+
names:
|
19 |
+
0: Fixed-wing Aircraft
|
20 |
+
1: Small Aircraft
|
21 |
+
2: Cargo Plane
|
22 |
+
3: Helicopter
|
23 |
+
4: Passenger Vehicle
|
24 |
+
5: Small Car
|
25 |
+
6: Bus
|
26 |
+
7: Pickup Truck
|
27 |
+
8: Utility Truck
|
28 |
+
9: Truck
|
29 |
+
10: Cargo Truck
|
30 |
+
11: Truck w/Box
|
31 |
+
12: Truck Tractor
|
32 |
+
13: Trailer
|
33 |
+
14: Truck w/Flatbed
|
34 |
+
15: Truck w/Liquid
|
35 |
+
16: Crane Truck
|
36 |
+
17: Railway Vehicle
|
37 |
+
18: Passenger Car
|
38 |
+
19: Cargo Car
|
39 |
+
20: Flat Car
|
40 |
+
21: Tank car
|
41 |
+
22: Locomotive
|
42 |
+
23: Maritime Vessel
|
43 |
+
24: Motorboat
|
44 |
+
25: Sailboat
|
45 |
+
26: Tugboat
|
46 |
+
27: Barge
|
47 |
+
28: Fishing Vessel
|
48 |
+
29: Ferry
|
49 |
+
30: Yacht
|
50 |
+
31: Container Ship
|
51 |
+
32: Oil Tanker
|
52 |
+
33: Engineering Vehicle
|
53 |
+
34: Tower crane
|
54 |
+
35: Container Crane
|
55 |
+
36: Reach Stacker
|
56 |
+
37: Straddle Carrier
|
57 |
+
38: Mobile Crane
|
58 |
+
39: Dump Truck
|
59 |
+
40: Haul Truck
|
60 |
+
41: Scraper/Tractor
|
61 |
+
42: Front loader/Bulldozer
|
62 |
+
43: Excavator
|
63 |
+
44: Cement Mixer
|
64 |
+
45: Ground Grader
|
65 |
+
46: Hut/Tent
|
66 |
+
47: Shed
|
67 |
+
48: Building
|
68 |
+
49: Aircraft Hangar
|
69 |
+
50: Damaged Building
|
70 |
+
51: Facility
|
71 |
+
52: Construction Site
|
72 |
+
53: Vehicle Lot
|
73 |
+
54: Helipad
|
74 |
+
55: Storage Tank
|
75 |
+
56: Shipping container lot
|
76 |
+
57: Shipping Container
|
77 |
+
58: Pylon
|
78 |
+
59: Tower
|
79 |
+
|
80 |
+
# Download script/URL (optional) ---------------------------------------------------------------------------------------
|
81 |
+
download: |
|
82 |
+
import json
|
83 |
+
import os
|
84 |
+
from pathlib import Path
|
85 |
+
|
86 |
+
import numpy as np
|
87 |
+
from PIL import Image
|
88 |
+
from tqdm import tqdm
|
89 |
+
|
90 |
+
from ultralytics.data.utils import autosplit
|
91 |
+
from ultralytics.utils.ops import xyxy2xywhn
|
92 |
+
|
93 |
+
|
94 |
+
def convert_labels(fname=Path("xView/xView_train.geojson")):
|
95 |
+
"""Converts xView geoJSON labels to YOLO format, mapping classes to indices 0-59 and saving as text files."""
|
96 |
+
path = fname.parent
|
97 |
+
with open(fname, encoding="utf-8") as f:
|
98 |
+
print(f"Loading {fname}...")
|
99 |
+
data = json.load(f)
|
100 |
+
|
101 |
+
# Make dirs
|
102 |
+
labels = Path(path / "labels" / "train")
|
103 |
+
os.system(f"rm -rf {labels}")
|
104 |
+
labels.mkdir(parents=True, exist_ok=True)
|
105 |
+
|
106 |
+
# xView classes 11-94 to 0-59
|
107 |
+
xview_class2index = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, -1, 3, -1, 4, 5, 6, 7, 8, -1, 9, 10, 11,
|
108 |
+
12, 13, 14, 15, -1, -1, 16, 17, 18, 19, 20, 21, 22, -1, 23, 24, 25, -1, 26, 27, -1, 28, -1,
|
109 |
+
29, 30, 31, 32, 33, 34, 35, 36, 37, -1, 38, 39, 40, 41, 42, 43, 44, 45, -1, -1, -1, -1, 46,
|
110 |
+
47, 48, 49, -1, 50, 51, -1, 52, -1, -1, -1, 53, 54, -1, 55, -1, -1, 56, -1, 57, -1, 58, 59]
|
111 |
+
|
112 |
+
shapes = {}
|
113 |
+
for feature in tqdm(data["features"], desc=f"Converting {fname}"):
|
114 |
+
p = feature["properties"]
|
115 |
+
if p["bounds_imcoords"]:
|
116 |
+
id = p["image_id"]
|
117 |
+
file = path / "train_images" / id
|
118 |
+
if file.exists(): # 1395.tif missing
|
119 |
+
try:
|
120 |
+
box = np.array([int(num) for num in p["bounds_imcoords"].split(",")])
|
121 |
+
assert box.shape[0] == 4, f"incorrect box shape {box.shape[0]}"
|
122 |
+
cls = p["type_id"]
|
123 |
+
cls = xview_class2index[int(cls)] # xView class to 0-60
|
124 |
+
assert 59 >= cls >= 0, f"incorrect class index {cls}"
|
125 |
+
|
126 |
+
# Write YOLO label
|
127 |
+
if id not in shapes:
|
128 |
+
shapes[id] = Image.open(file).size
|
129 |
+
box = xyxy2xywhn(box[None].astype(np.float), w=shapes[id][0], h=shapes[id][1], clip=True)
|
130 |
+
with open((labels / id).with_suffix(".txt"), "a", encoding="utf-8") as f:
|
131 |
+
f.write(f"{cls} {' '.join(f'{x:.6f}' for x in box[0])}\n") # write label.txt
|
132 |
+
except Exception as e:
|
133 |
+
print(f"WARNING: skipping one label for {file}: {e}")
|
134 |
+
|
135 |
+
|
136 |
+
# Download manually from https://challenge.xviewdataset.org
|
137 |
+
dir = Path(yaml["path"]) # dataset root dir
|
138 |
+
# urls = [
|
139 |
+
# "https://d307kc0mrhucc3.cloudfront.net/train_labels.zip", # train labels
|
140 |
+
# "https://d307kc0mrhucc3.cloudfront.net/train_images.zip", # 15G, 847 train images
|
141 |
+
# "https://d307kc0mrhucc3.cloudfront.net/val_images.zip", # 5G, 282 val images (no labels)
|
142 |
+
# ]
|
143 |
+
# download(urls, dir=dir)
|
144 |
+
|
145 |
+
# Convert labels
|
146 |
+
convert_labels(dir / "xView_train.geojson")
|
147 |
+
|
148 |
+
# Move images
|
149 |
+
images = Path(dir / "images")
|
150 |
+
images.mkdir(parents=True, exist_ok=True)
|
151 |
+
Path(dir / "train_images").rename(dir / "images" / "train")
|
152 |
+
Path(dir / "val_images").rename(dir / "images" / "val")
|
153 |
+
|
154 |
+
# Split
|
155 |
+
autosplit(dir / "images" / "train")
|
ultralytics/cfg/default.yaml
ADDED
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 许可证 - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# YOLO全局配置文件,包含训练、验证、预测和导出的设置和超参数
|
4 |
+
# 文档参考 https://docs.ultralytics.com/usage/cfg/
|
5 |
+
|
6 |
+
task: detect # (str) YOLO任务类型,可选: detect(检测), segment(分割), classify(分类), pose(姿态), obb(定向边界框)
|
7 |
+
mode: train # (str) YOLO模式,可选: train(训练), val(验证), predict(预测), export(导出), track(跟踪), benchmark(基准测试)
|
8 |
+
|
9 |
+
# 训练设置 -------------------------------------------------------------------------------------------------------
|
10 |
+
model: # (str, 可选) 模型文件路径,
|
11 |
+
data: # (str, 可选) 数据文件路径,
|
12 |
+
epochs: 100 # (int) 训练的总epoch数
|
13 |
+
time: # (float, 可选) 训练小时数,如果设置会覆盖epochs
|
14 |
+
patience: 8 # (int) 早停等待的epoch数(当指标无改善时)
|
15 |
+
batch: 64 # (int) 每批图像数量
|
16 |
+
imgsz: 128 # (int | list) 输入图像尺寸,训练/验证时为int,预测/导出时为[h,w]列表
|
17 |
+
save: True # (bool) 是否保存训练检查点和预测结果
|
18 |
+
save_period: 20 # (int) 每x个epoch保存检查点(<1时禁用)
|
19 |
+
cache: True # (bool) 数据加载缓存方式: True/ram(内存), disk(磁盘)或False(禁用)
|
20 |
+
device: 0 # (int | str | list, 可选) 运行设备,如 cuda 设置device=0 或 多GPU device=0,1,2,3 或 device=cpu
|
21 |
+
workers: 32 # (int) 数据加载的工作线程数(使用DDP时为每个RANK的线程数)
|
22 |
+
project: # (str, 可选) 项目名称
|
23 |
+
name: # (str, 可选) 实验名称,结果保存到'project/name'目录
|
24 |
+
exist_ok: False # (bool) 是否覆盖已有实验
|
25 |
+
pretrained: True # (bool | str) 是否使用预训练模型(bool)或指定权重路径(str)
|
26 |
+
optimizer: AdamW # (str) 优化器类型,可选: [SGD, Adam, Adamax, AdamW, NAdam, RAdam, RMSProp, auto]
|
27 |
+
verbose: True # (bool) 是否打印详细输出
|
28 |
+
seed: 0 # (int) 随机种子(确保可复现性)
|
29 |
+
deterministic: True # (bool) 是否启用确定性模式
|
30 |
+
single_cls: False # (bool) 将多类数据作为单类训练
|
31 |
+
rect: False # (bool) 矩形训练(模式='train')或矩形验证(模式='val')
|
32 |
+
cos_lr: False # (bool) 使用余弦学习率调度器
|
33 |
+
close_mosaic: 24 # (int) 最后x个epoch禁用马赛克增强(0表示不禁用)
|
34 |
+
resume: false # (bool) 从上次检查点恢复训练
|
35 |
+
amp: True # (bool) 自动混合精度(AMP)训练,True会运行AMP检查
|
36 |
+
fraction: 1.0 # (float) 训练使用的数据集比例(1.0表示全部)
|
37 |
+
profile: False # (bool) 在训练期间分析ONNX和TensorRT速度(用于日志记录)
|
38 |
+
freeze: None # (int | list, 可选) 冻结前n层或指定层索引列表
|
39 |
+
multi_scale: False # (bool) 是否在训练期间使用多尺度
|
40 |
+
# 分割任务设置
|
41 |
+
overlap_mask: True # (bool) 训练时将对象掩码合并为单个图像掩码(仅分割训练)
|
42 |
+
mask_ratio: 4 # (int) 掩码下采样比例(仅分割训练)
|
43 |
+
# 分类任务设置
|
44 |
+
dropout: 0.5 # (float) 使用dropout正则化(仅分类训练)
|
45 |
+
|
46 |
+
# 验证/测试设置 ----------------------------------------------------------------------------------------------------
|
47 |
+
val: True # (bool) 训练期间是否进行验证/测试
|
48 |
+
split: val # (str) 用于验证的数据集划分,可选: 'val', 'test' 或 'train'
|
49 |
+
save_json: True # (bool) 是否将结果保存为JSON文件
|
50 |
+
save_hybrid: False # (bool) 是否保存混合版本的标签(原始标签+额外预测)
|
51 |
+
conf: # (float, 可选) 检测的置信度阈值(预测默认为0.25,验证默认为0.001)
|
52 |
+
iou: 0.7 # (float) NMS的IoU阈值
|
53 |
+
max_det: 300 # (int) 每张图像的最大检测数
|
54 |
+
half: true # (bool) 是否使用半精度(FP16)
|
55 |
+
dnn: False # (bool) 是否使用OpenCV DNN进行ONNX推理
|
56 |
+
plots: True # (bool) 训练/验证期间是否保存图表和图像
|
57 |
+
|
58 |
+
# 预测设置 -----------------------------------------------------------------------------------------------------
|
59 |
+
source: # (str, 可选) 图像或视频的源目录
|
60 |
+
vid_stride: 1 # (int) 视频帧率步长
|
61 |
+
stream_buffer: False # (bool) 缓冲所有流帧(True)或只返回最新帧(False)
|
62 |
+
visualize: False # (bool) 是否可视化模型特征
|
63 |
+
augment: False # (bool) 是否对预测源应用图像增强
|
64 |
+
agnostic_nms: False # (bool) 是否使用类别无关的NMS
|
65 |
+
classes: # (int | list[int], 可选) 按类别过滤结果,如 classes=0 或 classes=[0,2,3]
|
66 |
+
retina_masks: False # (bool) 是否使用高分辨率分割掩码
|
67 |
+
embed: # (list[int], 可选) 从指定层返回特征向量/嵌入
|
68 |
+
|
69 |
+
# 可视化设置 ---------------------------------------------------------------------------------------------------
|
70 |
+
show: False # (bool) 如果环境允许,是否显示预测的图像和视频
|
71 |
+
save_frames: False # (bool) 是否保存预测的单个视频帧
|
72 |
+
save_txt: True # (bool) 是否将结果保存为.txt文件
|
73 |
+
save_conf: True # (bool) 是否保存带置信度的结果
|
74 |
+
save_crop: False # (bool) 是否保存带结果的裁剪图像
|
75 |
+
show_labels: false # (bool) 是否显示预测标签,如'person'
|
76 |
+
show_conf: True # (bool) 是否显示预测置信度,如'0.99'
|
77 |
+
show_boxes: True # (bool) 是否显示预测框
|
78 |
+
line_width: # (int, 可选) 边界框线宽。如果为None则根据图像尺寸缩放。
|
79 |
+
|
80 |
+
# 导出设置 ------------------------------------------------------------------------------------------------------
|
81 |
+
format: torchscript # (str) 导出格式,选项见 https://docs.ultralytics.com/modes/export/#export-formats
|
82 |
+
keras: False # (bool) 是否使用Keras
|
83 |
+
optimize: False # (bool) TorchScript: 是否为移动端优化
|
84 |
+
int8: False # (bool) CoreML/TF: INT8量化
|
85 |
+
dynamic: False # (bool) ONNX/TF/TensorRT: 动态轴
|
86 |
+
simplify: True # (bool) ONNX: 使用`onnxslim`简化模型
|
87 |
+
opset: # (int, 可选) ONNX: opset版本
|
88 |
+
workspace: 1 # (float, 可选) TensorRT: 工作空间大小(GiB),`None`表示让TensorRT自动分配
|
89 |
+
nms: False # (bool) CoreML: 是否添加NMS
|
90 |
+
|
91 |
+
# 超参数设置 ------------------------------------------------------------------------------------------------------
|
92 |
+
lr0: 0.001 # (float) 初始学习率(如SGD=1E-2, Adam=1E-3)
|
93 |
+
lrf: 0.01 # (float) 最终学习率(lr0 * lrf)
|
94 |
+
momentum: 0.937 # (float) SGD动量/Adam beta1
|
95 |
+
weight_decay: 0.00075 # (float) 优化器权重衰减
|
96 |
+
warmup_epochs: 5.0 # (float) 预热epoch数(可为小数)
|
97 |
+
warmup_momentum: 0.8 # (float) 预热初始动量
|
98 |
+
warmup_bias_lr: 0.1 # (float) 预热初始偏置学习率
|
99 |
+
box: 7.5 # (float) 边界框损失权重
|
100 |
+
cls: 0.5 # (float) 分类损失权重(与像素缩放)
|
101 |
+
dfl: 1.5 # (float) DFL损失权重
|
102 |
+
pose: 12.0 # (float) 姿态损失权重
|
103 |
+
kobj: 1.0 # (float) 关键点对象损失权重
|
104 |
+
nbs: 64 # (int) 标称批大小
|
105 |
+
hsv_h: 0.015 # (float) 图像HSV色调增强(比例)
|
106 |
+
hsv_s: 0.7 # (float) 图像HSV饱和度增强(比例)
|
107 |
+
hsv_v: 0.4 # (float) 图像HSV明度增强(比例)
|
108 |
+
degrees: 5.0 # (float) 图像旋转的角度
|
109 |
+
translate: 0.1 # (float) 图像平移范围(+/- 比例)
|
110 |
+
scale: 0.25 # (float) 图像缩放比例(+/- 增益)
|
111 |
+
shear: 0 # (float) 图像剪切角度(+/- 度)
|
112 |
+
perspective: 0 # (float) 图像透视变换比例(+/- 比例), 范围0-0.001
|
113 |
+
flipud: 0.0 # (float) 图像上下翻转概率
|
114 |
+
fliplr: 0.0 # (float) 图像左右翻转概率
|
115 |
+
bgr: 0.0 # (float) 图像BGR通道转换概率
|
116 |
+
mosaic: 0.24 # (float) 图像马赛克增强概率
|
117 |
+
mixup: 0.0 # (float) 图像混合增强概率
|
118 |
+
copy_paste: 0.0 # (float) 分割复制粘贴增强概率
|
119 |
+
copy_paste_mode: "flip" # (str) 执行copy_paste增强的方法(flip, mixup)
|
120 |
+
auto_augment: randaugment # (str) 分类任务的自动增强策略(randaugment, autoaugment, augmix)
|
121 |
+
erasing: 0.4 # (float) 分类训练中随机擦除的概率(0-0.9), 0表示不擦除, 必须小于1.0
|
122 |
+
crop_fraction: 1.0 # (float) 分类任务的图像裁剪比例(0.1-1), 1.0表示不裁剪, 必须大于0
|
123 |
+
|
124 |
+
# Custom config.yaml ---------------------------------------------------------------------------------------------------
|
125 |
+
cfg: # (str, 可选) 用于覆盖defaults.yaml的配置文件路径
|
126 |
+
|
127 |
+
# Tracker settings ------------------------------------------------------------------------------------------------------
|
128 |
+
tracker: botsort.yaml # (str) 跟踪器类型, 可选=[botsort.yaml, bytetrack.yaml]
|
ultralytics/cfg/models/11/yolo11-cls-resnet18.yaml
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# Ultralytics YOLO11-cls image classification model with ResNet18 backbone
|
4 |
+
# Model docs: https://docs.ultralytics.com/models/yolo11
|
5 |
+
# Task docs: https://docs.ultralytics.com/tasks/classify
|
6 |
+
|
7 |
+
# Parameters
|
8 |
+
nc: 1000 # number of classes
|
9 |
+
|
10 |
+
# ResNet18 backbone
|
11 |
+
backbone:
|
12 |
+
# [from, repeats, module, args]
|
13 |
+
- [-1, 1, TorchVision, [512, resnet18, DEFAULT, True, 2]] # truncate two layers from the end
|
14 |
+
|
15 |
+
# YOLO11n head
|
16 |
+
head:
|
17 |
+
- [-1, 1, Classify, [nc]] # Classify
|
ultralytics/cfg/models/11/yolo11-cls.yaml
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# Ultralytics YOLO11-cls image classification model
|
4 |
+
# Model docs: https://docs.ultralytics.com/models/yolo11
|
5 |
+
# Task docs: https://docs.ultralytics.com/tasks/classify
|
6 |
+
|
7 |
+
# Parameters
|
8 |
+
nc: 1000 # number of classes
|
9 |
+
scales: # model compound scaling constants, i.e. 'model=yolo11n-cls.yaml' will call yolo11-cls.yaml with scale 'n'
|
10 |
+
# [depth, width, max_channels]
|
11 |
+
n: [0.50, 0.25, 1024] # summary: 86 layers, 1633584 parameters, 1633584 gradients, 0.5 GFLOPs
|
12 |
+
s: [0.50, 0.50, 1024] # summary: 86 layers, 5545488 parameters, 5545488 gradients, 1.6 GFLOPs
|
13 |
+
m: [0.50, 1.00, 512] # summary: 106 layers, 10455696 parameters, 10455696 gradients, 5.0 GFLOPs
|
14 |
+
l: [1.00, 1.00, 512] # summary: 176 layers, 12937104 parameters, 12937104 gradients, 6.2 GFLOPs
|
15 |
+
x: [1.00, 1.50, 512] # summary: 176 layers, 28458544 parameters, 28458544 gradients, 13.7 GFLOPs
|
16 |
+
|
17 |
+
# YOLO11n backbone
|
18 |
+
backbone:
|
19 |
+
# [from, repeats, module, args]
|
20 |
+
- [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
|
21 |
+
- [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
|
22 |
+
- [-1, 2, C3k2, [256, False, 0.25]]
|
23 |
+
- [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
|
24 |
+
- [-1, 2, C3k2, [512, False, 0.25]]
|
25 |
+
- [-1, 1, Conv, [512, 3, 2]] # 5-P4/16
|
26 |
+
- [-1, 2, C3k2, [512, True]]
|
27 |
+
- [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32
|
28 |
+
- [-1, 2, C3k2, [1024, True]]
|
29 |
+
- [-1, 2, C2PSA, [1024]] # 9
|
30 |
+
|
31 |
+
# YOLO11n head
|
32 |
+
head:
|
33 |
+
- [-1, 1, Classify, [nc]] # Classify
|
ultralytics/cfg/models/11/yolo11-obb.yaml
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# Ultralytics YOLO11-obb Oriented Bounding Boxes (OBB) model with P3/8 - P5/32 outputs
|
4 |
+
# Model docs: https://docs.ultralytics.com/models/yolo11
|
5 |
+
# Task docs: https://docs.ultralytics.com/tasks/obb
|
6 |
+
|
7 |
+
# Parameters
|
8 |
+
nc: 80 # number of classes
|
9 |
+
scales: # model compound scaling constants, i.e. 'model=yolo11n-obb.yaml' will call yolo11-obb.yaml with scale 'n'
|
10 |
+
# [depth, width, max_channels]
|
11 |
+
n: [0.50, 0.25, 1024] # summary: 196 layers, 2695747 parameters, 2695731 gradients, 6.9 GFLOPs
|
12 |
+
s: [0.50, 0.50, 1024] # summary: 196 layers, 9744931 parameters, 9744915 gradients, 22.7 GFLOPs
|
13 |
+
m: [0.50, 1.00, 512] # summary: 246 layers, 20963523 parameters, 20963507 gradients, 72.2 GFLOPs
|
14 |
+
l: [1.00, 1.00, 512] # summary: 372 layers, 26220995 parameters, 26220979 gradients, 91.3 GFLOPs
|
15 |
+
x: [1.00, 1.50, 512] # summary: 372 layers, 58875331 parameters, 58875315 gradients, 204.3 GFLOPs
|
16 |
+
|
17 |
+
# YOLO11n backbone
|
18 |
+
backbone:
|
19 |
+
# [from, repeats, module, args]
|
20 |
+
- [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
|
21 |
+
- [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
|
22 |
+
- [-1, 2, C3k2, [256, False, 0.25]]
|
23 |
+
- [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
|
24 |
+
- [-1, 2, C3k2, [512, False, 0.25]]
|
25 |
+
- [-1, 1, Conv, [512, 3, 2]] # 5-P4/16
|
26 |
+
- [-1, 2, C3k2, [512, True]]
|
27 |
+
- [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32
|
28 |
+
- [-1, 2, C3k2, [1024, True]]
|
29 |
+
- [-1, 1, SPPF, [1024, 5]] # 9
|
30 |
+
- [-1, 2, C2PSA, [1024]] # 10
|
31 |
+
|
32 |
+
# YOLO11n head
|
33 |
+
head:
|
34 |
+
- [-1, 1, nn.Upsample, [None, 2, "nearest"]]
|
35 |
+
- [[-1, 6], 1, Concat, [1]] # cat backbone P4
|
36 |
+
- [-1, 2, C3k2, [512, False]] # 13
|
37 |
+
|
38 |
+
- [-1, 1, nn.Upsample, [None, 2, "nearest"]]
|
39 |
+
- [[-1, 4], 1, Concat, [1]] # cat backbone P3
|
40 |
+
- [-1, 2, C3k2, [256, False]] # 16 (P3/8-small)
|
41 |
+
|
42 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
43 |
+
- [[-1, 13], 1, Concat, [1]] # cat head P4
|
44 |
+
- [-1, 2, C3k2, [512, False]] # 19 (P4/16-medium)
|
45 |
+
|
46 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
47 |
+
- [[-1, 10], 1, Concat, [1]] # cat head P5
|
48 |
+
- [-1, 2, C3k2, [1024, True]] # 22 (P5/32-large)
|
49 |
+
|
50 |
+
- [[16, 19, 22], 1, OBB, [nc, 1]] # Detect(P3, P4, P5)
|
ultralytics/cfg/models/11/yolo11-pose.yaml
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# Ultralytics YOLO11-pose keypoints/pose estimation model with P3/8 - P5/32 outputs
|
4 |
+
# Model docs: https://docs.ultralytics.com/models/yolo11
|
5 |
+
# Task docs: https://docs.ultralytics.com/tasks/pose
|
6 |
+
|
7 |
+
# Parameters
|
8 |
+
nc: 80 # number of classes
|
9 |
+
kpt_shape: [17, 3] # number of keypoints, number of dims (2 for x,y or 3 for x,y,visible)
|
10 |
+
scales: # model compound scaling constants, i.e. 'model=yolo11n-pose.yaml' will call yolo11.yaml with scale 'n'
|
11 |
+
# [depth, width, max_channels]
|
12 |
+
n: [0.50, 0.25, 1024] # summary: 196 layers, 2908507 parameters, 2908491 gradients, 7.7 GFLOPs
|
13 |
+
s: [0.50, 0.50, 1024] # summary: 196 layers, 9948811 parameters, 9948795 gradients, 23.5 GFLOPs
|
14 |
+
m: [0.50, 1.00, 512] # summary: 246 layers, 20973273 parameters, 20973257 gradients, 72.3 GFLOPs
|
15 |
+
l: [1.00, 1.00, 512] # summary: 372 layers, 26230745 parameters, 26230729 gradients, 91.4 GFLOPs
|
16 |
+
x: [1.00, 1.50, 512] # summary: 372 layers, 58889881 parameters, 58889865 gradients, 204.3 GFLOPs
|
17 |
+
|
18 |
+
# YOLO11n backbone
|
19 |
+
backbone:
|
20 |
+
# [from, repeats, module, args]
|
21 |
+
- [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
|
22 |
+
- [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
|
23 |
+
- [-1, 2, C3k2, [256, False, 0.25]]
|
24 |
+
- [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
|
25 |
+
- [-1, 2, C3k2, [512, False, 0.25]]
|
26 |
+
- [-1, 1, Conv, [512, 3, 2]] # 5-P4/16
|
27 |
+
- [-1, 2, C3k2, [512, True]]
|
28 |
+
- [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32
|
29 |
+
- [-1, 2, C3k2, [1024, True]]
|
30 |
+
- [-1, 1, SPPF, [1024, 5]] # 9
|
31 |
+
- [-1, 2, C2PSA, [1024]] # 10
|
32 |
+
|
33 |
+
# YOLO11n head
|
34 |
+
head:
|
35 |
+
- [-1, 1, nn.Upsample, [None, 2, "nearest"]]
|
36 |
+
- [[-1, 6], 1, Concat, [1]] # cat backbone P4
|
37 |
+
- [-1, 2, C3k2, [512, False]] # 13
|
38 |
+
|
39 |
+
- [-1, 1, nn.Upsample, [None, 2, "nearest"]]
|
40 |
+
- [[-1, 4], 1, Concat, [1]] # cat backbone P3
|
41 |
+
- [-1, 2, C3k2, [256, False]] # 16 (P3/8-small)
|
42 |
+
|
43 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
44 |
+
- [[-1, 13], 1, Concat, [1]] # cat head P4
|
45 |
+
- [-1, 2, C3k2, [512, False]] # 19 (P4/16-medium)
|
46 |
+
|
47 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
48 |
+
- [[-1, 10], 1, Concat, [1]] # cat head P5
|
49 |
+
- [-1, 2, C3k2, [1024, True]] # 22 (P5/32-large)
|
50 |
+
|
51 |
+
- [[16, 19, 22], 1, Pose, [nc, kpt_shape]] # Detect(P3, P4, P5)
|
ultralytics/cfg/models/11/yolo11-seg.yaml
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# Ultralytics YOLO11-seg instance segmentation model with P3/8 - P5/32 outputs
|
4 |
+
# Model docs: https://docs.ultralytics.com/models/yolo11
|
5 |
+
# Task docs: https://docs.ultralytics.com/tasks/segment
|
6 |
+
|
7 |
+
# Parameters
|
8 |
+
nc: 80 # number of classes
|
9 |
+
scales: # model compound scaling constants, i.e. 'model=yolo11n-seg.yaml' will call yolo11-seg.yaml with scale 'n'
|
10 |
+
# [depth, width, max_channels]
|
11 |
+
n: [0.50, 0.25, 1024] # summary: 203 layers, 2876848 parameters, 2876832 gradients, 10.5 GFLOPs
|
12 |
+
s: [0.50, 0.50, 1024] # summary: 203 layers, 10113248 parameters, 10113232 gradients, 35.8 GFLOPs
|
13 |
+
m: [0.50, 1.00, 512] # summary: 253 layers, 22420896 parameters, 22420880 gradients, 123.9 GFLOPs
|
14 |
+
l: [1.00, 1.00, 512] # summary: 379 layers, 27678368 parameters, 27678352 gradients, 143.0 GFLOPs
|
15 |
+
x: [1.00, 1.50, 512] # summary: 379 layers, 62142656 parameters, 62142640 gradients, 320.2 GFLOPs
|
16 |
+
|
17 |
+
# YOLO11n backbone
|
18 |
+
backbone:
|
19 |
+
# [from, repeats, module, args]
|
20 |
+
- [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
|
21 |
+
- [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
|
22 |
+
- [-1, 2, C3k2, [256, False, 0.25]]
|
23 |
+
- [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
|
24 |
+
- [-1, 2, C3k2, [512, False, 0.25]]
|
25 |
+
- [-1, 1, Conv, [512, 3, 2]] # 5-P4/16
|
26 |
+
- [-1, 2, C3k2, [512, True]]
|
27 |
+
- [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32
|
28 |
+
- [-1, 2, C3k2, [1024, True]]
|
29 |
+
- [-1, 1, SPPF, [1024, 5]] # 9
|
30 |
+
- [-1, 2, C2PSA, [1024]] # 10
|
31 |
+
|
32 |
+
# YOLO11n head
|
33 |
+
head:
|
34 |
+
- [-1, 1, nn.Upsample, [None, 2, "nearest"]]
|
35 |
+
- [[-1, 6], 1, Concat, [1]] # cat backbone P4
|
36 |
+
- [-1, 2, C3k2, [512, False]] # 13
|
37 |
+
|
38 |
+
- [-1, 1, nn.Upsample, [None, 2, "nearest"]]
|
39 |
+
- [[-1, 4], 1, Concat, [1]] # cat backbone P3
|
40 |
+
- [-1, 2, C3k2, [256, False]] # 16 (P3/8-small)
|
41 |
+
|
42 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
43 |
+
- [[-1, 13], 1, Concat, [1]] # cat head P4
|
44 |
+
- [-1, 2, C3k2, [512, False]] # 19 (P4/16-medium)
|
45 |
+
|
46 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
47 |
+
- [[-1, 10], 1, Concat, [1]] # cat head P5
|
48 |
+
- [-1, 2, C3k2, [1024, True]] # 22 (P5/32-large)
|
49 |
+
|
50 |
+
- [[16, 19, 22], 1, Segment, [nc, 32, 256]] # Detect(P3, P4, P5)
|
ultralytics/cfg/models/11/yolo11.yaml
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# Ultralytics YOLO11 object detection model with P3/8 - P5/32 outputs
|
4 |
+
# Model docs: https://docs.ultralytics.com/models/yolo11
|
5 |
+
# Task docs: https://docs.ultralytics.com/tasks/detect
|
6 |
+
|
7 |
+
# Parameters
|
8 |
+
nc: 80 # number of classes
|
9 |
+
scales: # model compound scaling constants, i.e. 'model=yolo11n.yaml' will call yolo11.yaml with scale 'n'
|
10 |
+
# [depth, width, max_channels]
|
11 |
+
n: [0.50, 0.25, 1024] # summary: 181 layers, 2624080 parameters, 2624064 gradients, 6.6 GFLOPs
|
12 |
+
s: [0.50, 0.50, 1024] # summary: 181 layers, 9458752 parameters, 9458736 gradients, 21.7 GFLOPs
|
13 |
+
m: [0.50, 1.00, 512] # summary: 231 layers, 20114688 parameters, 20114672 gradients, 68.5 GFLOPs
|
14 |
+
l: [1.00, 1.00, 512] # summary: 357 layers, 25372160 parameters, 25372144 gradients, 87.6 GFLOPs
|
15 |
+
x: [1.00, 1.50, 512] # summary: 357 layers, 56966176 parameters, 56966160 gradients, 196.0 GFLOPs
|
16 |
+
|
17 |
+
# YOLO11n backbone
|
18 |
+
backbone:
|
19 |
+
# [from, repeats, module, args]
|
20 |
+
- [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
|
21 |
+
- [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
|
22 |
+
- [-1, 2, C3k2, [256, False, 0.25]]
|
23 |
+
- [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
|
24 |
+
- [-1, 2, C3k2, [512, False, 0.25]]
|
25 |
+
- [-1, 1, Conv, [512, 3, 2]] # 5-P4/16
|
26 |
+
- [-1, 2, C3k2, [512, True]]
|
27 |
+
- [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32
|
28 |
+
- [-1, 2, C3k2, [1024, True]]
|
29 |
+
- [-1, 1, SPPF, [1024, 5]] # 9
|
30 |
+
- [-1, 2, C2PSA, [1024]] # 10
|
31 |
+
|
32 |
+
# YOLO11n head
|
33 |
+
head:
|
34 |
+
- [-1, 1, nn.Upsample, [None, 2, "nearest"]]
|
35 |
+
- [[-1, 6], 1, Concat, [1]] # cat backbone P4
|
36 |
+
- [-1, 2, C3k2, [512, False]] # 13
|
37 |
+
|
38 |
+
- [-1, 1, nn.Upsample, [None, 2, "nearest"]]
|
39 |
+
- [[-1, 4], 1, Concat, [1]] # cat backbone P3
|
40 |
+
- [-1, 2, C3k2, [256, False]] # 16 (P3/8-small)
|
41 |
+
|
42 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
43 |
+
- [[-1, 13], 1, Concat, [1]] # cat head P4
|
44 |
+
- [-1, 2, C3k2, [512, False]] # 19 (P4/16-medium)
|
45 |
+
|
46 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
47 |
+
- [[-1, 10], 1, Concat, [1]] # cat head P5
|
48 |
+
- [-1, 2, C3k2, [1024, True]] # 22 (P5/32-large)
|
49 |
+
|
50 |
+
- [[16, 19, 22], 1, Detect, [nc]] # Detect(P3, P4, P5)
|
ultralytics/cfg/models/11/yoloe-11-seg.yaml
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# YOLO11-seg instance segmentation model. For Usage examples see https://docs.ultralytics.com/tasks/segment
|
4 |
+
|
5 |
+
# Parameters
|
6 |
+
nc: 80 # number of classes
|
7 |
+
scales: # model compound scaling constants, i.e. 'model=yolo11n-seg.yaml' will call yolo11-seg.yaml with scale 'n'
|
8 |
+
# [depth, width, max_channels]
|
9 |
+
n: [0.50, 0.25, 1024] # summary: 355 layers, 2876848 parameters, 2876832 gradients, 10.5 GFLOPs
|
10 |
+
s: [0.50, 0.50, 1024] # summary: 355 layers, 10113248 parameters, 10113232 gradients, 35.8 GFLOPs
|
11 |
+
m: [0.50, 1.00, 512] # summary: 445 layers, 22420896 parameters, 22420880 gradients, 123.9 GFLOPs
|
12 |
+
l: [1.00, 1.00, 512] # summary: 667 layers, 27678368 parameters, 27678352 gradients, 143.0 GFLOPs
|
13 |
+
x: [1.00, 1.50, 512] # summary: 667 layers, 62142656 parameters, 62142640 gradients, 320.2 GFLOPs
|
14 |
+
|
15 |
+
# YOLO11n backbone
|
16 |
+
backbone:
|
17 |
+
# [from, repeats, module, args]
|
18 |
+
- [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
|
19 |
+
- [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
|
20 |
+
- [-1, 2, C3k2, [256, False, 0.25]]
|
21 |
+
- [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
|
22 |
+
- [-1, 2, C3k2, [512, False, 0.25]]
|
23 |
+
- [-1, 1, Conv, [512, 3, 2]] # 5-P4/16
|
24 |
+
- [-1, 2, C3k2, [512, True]]
|
25 |
+
- [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32
|
26 |
+
- [-1, 2, C3k2, [1024, True]]
|
27 |
+
- [-1, 1, SPPF, [1024, 5]] # 9
|
28 |
+
- [-1, 2, C2PSA, [1024]] # 10
|
29 |
+
|
30 |
+
# YOLO11n head
|
31 |
+
head:
|
32 |
+
- [-1, 1, nn.Upsample, [None, 2, "nearest"]]
|
33 |
+
- [[-1, 6], 1, Concat, [1]] # cat backbone P4
|
34 |
+
- [-1, 2, C3k2, [512, False]] # 13
|
35 |
+
|
36 |
+
- [-1, 1, nn.Upsample, [None, 2, "nearest"]]
|
37 |
+
- [[-1, 4], 1, Concat, [1]] # cat backbone P3
|
38 |
+
- [-1, 2, C3k2, [256, False]] # 16 (P3/8-small)
|
39 |
+
|
40 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
41 |
+
- [[-1, 13], 1, Concat, [1]] # cat head P4
|
42 |
+
- [-1, 2, C3k2, [512, False]] # 19 (P4/16-medium)
|
43 |
+
|
44 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
45 |
+
- [[-1, 10], 1, Concat, [1]] # cat head P5
|
46 |
+
- [-1, 2, C3k2, [1024, True]] # 22 (P5/32-large)
|
47 |
+
|
48 |
+
- [[16, 19, 22], 1, YOLOESegment, [nc, 32, 256, 512, True]] # Detect(P3, P4, P5)
|
ultralytics/cfg/models/11/yoloe-11.yaml
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# YOLO11 object detection model with P3-P5 outputs. For Usage examples see https://docs.ultralytics.com/tasks/detect
|
4 |
+
|
5 |
+
# Parameters
|
6 |
+
nc: 80 # number of classes
|
7 |
+
scales: # model compound scaling constants, i.e. 'model=yolo11n.yaml' will call yolo11.yaml with scale 'n'
|
8 |
+
# [depth, width, max_channels]
|
9 |
+
n: [0.50, 0.25, 1024] # summary: 319 layers, 2624080 parameters, 2624064 gradients, 6.6 GFLOPs
|
10 |
+
s: [0.50, 0.50, 1024] # summary: 319 layers, 9458752 parameters, 9458736 gradients, 21.7 GFLOPs
|
11 |
+
m: [0.50, 1.00, 512] # summary: 409 layers, 20114688 parameters, 20114672 gradients, 68.5 GFLOPs
|
12 |
+
l: [1.00, 1.00, 512] # summary: 631 layers, 25372160 parameters, 25372144 gradients, 87.6 GFLOPs
|
13 |
+
x: [1.00, 1.50, 512] # summary: 631 layers, 56966176 parameters, 56966160 gradients, 196.0 GFLOPs
|
14 |
+
|
15 |
+
# YOLO11n backbone
|
16 |
+
backbone:
|
17 |
+
# [from, repeats, module, args]
|
18 |
+
- [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
|
19 |
+
- [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
|
20 |
+
- [-1, 2, C3k2, [256, False, 0.25]]
|
21 |
+
- [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
|
22 |
+
- [-1, 2, C3k2, [512, False, 0.25]]
|
23 |
+
- [-1, 1, Conv, [512, 3, 2]] # 5-P4/16
|
24 |
+
- [-1, 2, C3k2, [512, True]]
|
25 |
+
- [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32
|
26 |
+
- [-1, 2, C3k2, [1024, True]]
|
27 |
+
- [-1, 1, SPPF, [1024, 5]] # 9
|
28 |
+
- [-1, 2, C2PSA, [1024]] # 10
|
29 |
+
|
30 |
+
# YOLO11n head
|
31 |
+
head:
|
32 |
+
- [-1, 1, nn.Upsample, [None, 2, "nearest"]]
|
33 |
+
- [[-1, 6], 1, Concat, [1]] # cat backbone P4
|
34 |
+
- [-1, 2, C3k2, [512, False]] # 13
|
35 |
+
|
36 |
+
- [-1, 1, nn.Upsample, [None, 2, "nearest"]]
|
37 |
+
- [[-1, 4], 1, Concat, [1]] # cat backbone P3
|
38 |
+
- [-1, 2, C3k2, [256, False]] # 16 (P3/8-small)
|
39 |
+
|
40 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
41 |
+
- [[-1, 13], 1, Concat, [1]] # cat head P4
|
42 |
+
- [-1, 2, C3k2, [512, False]] # 19 (P4/16-medium)
|
43 |
+
|
44 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
45 |
+
- [[-1, 10], 1, Concat, [1]] # cat head P5
|
46 |
+
- [-1, 2, C3k2, [1024, True]] # 22 (P5/32-large)
|
47 |
+
|
48 |
+
- [[16, 19, 22], 1, YOLOEDetect, [nc, 512, True]] # Detect(P3, P4, P5)
|
ultralytics/cfg/models/12/yolo12-cls.yaml
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2 |
+
|
3 |
+
# YOLO12-cls image classification model
|
4 |
+
# Model docs: https://docs.ultralytics.com/models/yolo12
|
5 |
+
# Task docs: https://docs.ultralytics.com/tasks/classify
|
6 |
+
|
7 |
+
# Parameters
|
8 |
+
nc: 80 # number of classes
|
9 |
+
scales: # model compound scaling constants, i.e. 'model=yolo12n-cls.yaml' will call yolo12-cls.yaml with scale 'n'
|
10 |
+
# [depth, width, max_channels]
|
11 |
+
n: [0.50, 0.25, 1024] # summary: 152 layers, 1,820,976 parameters, 1,820,976 gradients, 3.7 GFLOPs
|
12 |
+
s: [0.50, 0.50, 1024] # summary: 152 layers, 6,206,992 parameters, 6,206,992 gradients, 13.6 GFLOPs
|
13 |
+
m: [0.50, 1.00, 512] # summary: 172 layers, 12,083,088 parameters, 12,083,088 gradients, 44.2 GFLOPs
|
14 |
+
l: [1.00, 1.00, 512] # summary: 312 layers, 15,558,640 parameters, 15,558,640 gradients, 56.9 GFLOPs
|
15 |
+
x: [1.00, 1.50, 512] # summary: 312 layers, 34,172,592 parameters, 34,172,592 gradients, 126.5 GFLOPs
|
16 |
+
|
17 |
+
# YOLO12n backbone
|
18 |
+
backbone:
|
19 |
+
# [from, repeats, module, args]
|
20 |
+
- [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
|
21 |
+
- [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
|
22 |
+
- [-1, 2, C3k2, [256, False, 0.25]]
|
23 |
+
- [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
|
24 |
+
- [-1, 2, C3k2, [512, False, 0.25]]
|
25 |
+
- [-1, 1, Conv, [512, 3, 2]] # 5-P4/16
|
26 |
+
- [-1, 4, A2C2f, [512, True, 4]]
|
27 |
+
- [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32
|
28 |
+
- [-1, 4, A2C2f, [1024, True, 1]] # 8
|
29 |
+
|
30 |
+
# YOLO12n head
|
31 |
+
head:
|
32 |
+
- [-1, 1, Classify, [nc]] # Classify
|