cc92yy3344 Claude Fable 5 commited on
Commit
4946be9
·
1 Parent(s): 3b7ebe8

🔧 chore: 恢复 images/train|val 目录结构

Browse files

实测 datasets 能自动识别嵌套的 images/train 与 images/val
(val 自动映射为 validation split),且各目录内的 metadata.jsonl
可正常关联,因此保留原始 YOLO 布局,无需把图片移到顶层。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

README.md CHANGED
@@ -111,9 +111,9 @@ configs:
111
  - config_name: coco8
112
  data_files:
113
  - split: train
114
- path: train/*
115
  - split: validation
116
- path: validation/*
117
  default: true
118
  ---
119
 
@@ -129,14 +129,15 @@ Ultralytics COCO8 是一个规模虽小但用途广泛的目标检测数据集
129
  ## 仓库结构
130
 
131
  ```text
132
- train/ # 4 张训练图片 + metadata.jsonl
133
- validation/ # 4 张验证图片 + metadata.jsonl
134
  labels/train|val/ # 原始 YOLO 格式 .txt 标注(归一化 cx cy w h)
135
  data.yaml # Ultralytics 数据配置
136
  ```
137
 
138
  每个 split 目录下的 `metadata.jsonl` 提供目标检测标注(像素坐标 `[x, y, width, height]`,
139
- 左上角原点),可直接被 Hugging Face Dataset Viewer 与 `datasets` 库识别
 
140
 
141
  ```jsonl
142
  {"file_name": "000000000009.jpg", "objects": {"bbox": [[1.08, 187.69, 611.59, 285.84], ...], "categories": [45, ...]}}
 
111
  - config_name: coco8
112
  data_files:
113
  - split: train
114
+ path: images/train/*
115
  - split: validation
116
+ path: images/val/*
117
  default: true
118
  ---
119
 
 
129
  ## 仓库结构
130
 
131
  ```text
132
+ images/train/ # 4 张训练图片 + metadata.jsonl
133
+ images/val/ # 4 张验证图片 + metadata.jsonl
134
  labels/train|val/ # 原始 YOLO 格式 .txt 标注(归一化 cx cy w h)
135
  data.yaml # Ultralytics 数据配置
136
  ```
137
 
138
  每个 split 目录下的 `metadata.jsonl` 提供目标检测标注(像素坐标 `[x, y, width, height]`,
139
+ 左上角原点),可直接被 Hugging Face Dataset Viewer 与 `datasets` 库识别
140
+ (目录名 `train`/`val` 会被自动映射为 train/validation 两个 split):
141
 
142
  ```jsonl
143
  {"file_name": "000000000009.jpg", "objects": {"bbox": [[1.08, 187.69, 611.59, 285.84], ...], "categories": [45, ...]}}
data.yaml CHANGED
@@ -10,12 +10,12 @@
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: coco8 # dataset root dir
13
- train: train # train images (relative to 'path') 4 images
14
- val: validation # val images (relative to 'path') 4 images
15
  test: # test images (optional)
16
 
17
- # 说明:为兼容 Hugging Face Dataset Viewer,图片已移至顶层 train/ validation/ 目录;
18
- # YOLO 格式保留在 labels/train labels/val 中,文件名与图片一一对应
19
 
20
  # Classes
21
  names:
 
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: 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
+ # 说明:images/train images/val 下的 metadata.jsonl Hugging Face Dataset Viewer
18
+ # 使用(像素 xywh 坐);YOLO 训练使用 labels/ 目录下的 .txt 标注
19
 
20
  # Classes
21
  names:
{train → images/train}/000000000009.jpg RENAMED
File without changes
{train → images/train}/000000000025.jpg RENAMED
File without changes
{train → images/train}/000000000030.jpg RENAMED
File without changes
{train → images/train}/000000000034.jpg RENAMED
File without changes
{train → images/train}/metadata.jsonl RENAMED
File without changes
{validation → images/val}/000000000036.jpg RENAMED
File without changes
{validation → images/val}/000000000042.jpg RENAMED
File without changes
{validation → images/val}/000000000049.jpg RENAMED
File without changes
{validation → images/val}/000000000061.jpg RENAMED
File without changes
{validation → images/val}/metadata.jsonl RENAMED
File without changes