feat: datasetsの場所とダウンロード方法を変更

This commit is contained in:
KorRyu3 2024-08-04 16:59:28 +09:00
parent 6c20b529c2
commit e9586cd9b8
10 changed files with 22 additions and 161 deletions

3
.gitignore vendored
View File

@ -159,3 +159,6 @@ pnnx*
# Autogenerated files for tests
/ultralytics/assets/
# datasets
yolov10-datasets/

View File

@ -91,7 +91,23 @@ yolo settings datasets_dir=.
事前学習済みモデルとして`yolov10x.pt`を使用するので、[公式GitHubのリリース](https://github.com/THU-MIG/yolov10/releases/download/v1.1/yolov10x.pt)からダウンロードして`weights`ディレクトリに配置してください。
また、学習に使用するデータセットは[`datasets/README.md`](./datasets/README.md)に従い、`datasets`ディレクトリに配置してください。
学習に使用するデータセットはRoboflowというサービスを使用して作成しています。
学習や評価に使用するデータセットは、
- [サトウキビ](https://universe.roboflow.com/hoku/sugarcane-3vhxz/dataset/11)
- [パイナップル](https://universe.roboflow.com/hoku/pineapple-thsih/dataset/7)
にありますが、手動でダウンロードするのは面倒なので`huggingface`にdatasetsをまとめてあります。
下記コマンドを実行して、datasetsをダウンロードしてください。
```bash
# Make sure you have git-lfs installed (https://git-lfs.com)
git lfs install
git clone https://huggingface.co/datasets/TechC-SugarCane/yolov10-datasets
```
学習後の結果は`runs/detect/<name(番号)>`に保存されます。
@ -100,10 +116,10 @@ yolo settings datasets_dir=.
```bash
# sugarcane
yolo detect train cfg='cfg/sugarcane.yaml' data=datasets/sugarcane/data.yaml model=weights/yolov10x.pt name='yolov10x-sugarcane' epochs=300 batch=16 imgsz=640 device=0
yolo detect train cfg='cfg/sugarcane.yaml' data=yolov10-datasets/sugarcane/data.yaml model=weights/yolov10x.pt name='yolov10x-sugarcane' epochs=300 batch=16 imgsz=640 device=0
# pineapple
yolo detect train cfg='cfg/pineapple.yaml' data=datasets/pineapple/data.yaml model=weights/yolov10x.pt name='yolov10x-pineapple' epochs=300 batch=16 imgsz=640 device=0
yolo detect train cfg='cfg/pineapple.yaml' data=yolov10-datasets/pineapple/data.yaml model=weights/yolov10x.pt name='yolov10x-pineapple' epochs=300 batch=16 imgsz=640 device=0
```
※ 上記を実行すると`yolov8n.pt`がダウンロードされますが、AMPというものの確認用に追加されているだけらしいので気にしなくて大丈夫です。

8
datasets/.gitignore vendored
View File

@ -1,8 +0,0 @@
# 全てのファイルを除外
*/*
# 例外
!.gitignore
!README.md
!**/data.yaml
!**/README*.txt

View File

@ -1,56 +0,0 @@
# カスタムデータセット
Roboflowというサービスを使用してデーターセットを作成しています。
学習や評価に使用するデータセットは、
- [サトウキビ](https://universe.roboflow.com/hoku/sugarcane-3vhxz/dataset/11)
- [パイナップル](https://universe.roboflow.com/hoku/pineapple-thsih/dataset/7)
から`YOLO v8`形式でダウンロードし、下記を参考に`train`, `valid`, `test`を各ディレクトリに配置してください。
## ディレクトリ構造
```plaintext
datasets/
.gitignore
README.md
sugarcane/
data.yaml
README.dataset.txt
README.roboflow.txt
train/
images/
...
labels/
...
valid/
images/
...
labels/
...
test/
images/
...
labels/
...
pineapple/
data.yaml
README.dataset.txt
README.roboflow.txt
train/
images/
...
labels/
...
valid/
images/
...
labels/
...
test/
images/
...
labels/
...
```

View File

@ -1,6 +0,0 @@
# Pineapple > 2023-07-19 9:57am
https://universe.roboflow.com/hoku/pineapple-thsih
Provided by a Roboflow user
License: MIT

View File

@ -1,27 +0,0 @@
Pineapple - v7 2023-07-19 9:57am
==============================
This dataset was exported via roboflow.com on July 31, 2024 at 3:58 PM GMT
Roboflow is an end-to-end computer vision platform that helps you
* collaborate with your team on computer vision projects
* collect & organize images
* understand and search unstructured image data
* annotate, and create datasets
* export, train, and deploy computer vision models
* use active learning to improve your dataset over time
For state of the art Computer Vision training notebooks you can use with this dataset,
visit https://github.com/roboflow/notebooks
To find over 100k other datasets and pre-trained models, visit https://universe.roboflow.com
The dataset includes 619 images.
Pineapple are annotated in YOLOv8 format.
The following pre-processing was applied to each image:
No image augmentation techniques were applied.

View File

@ -1,14 +0,0 @@
path: datasets/sugarcane # dataset root dir
train: train/images
val: valid/images
test: test/images
nc: 2
names: ['pineapple', 'weed']
roboflow:
workspace: hoku
project: pineapple-thsih
version: 7
license: MIT
url: https://universe.roboflow.com/hoku/pineapple-thsih/dataset/7

View File

@ -1,6 +0,0 @@
# sugarcane > 2023-07-19 9:58am
https://universe.roboflow.com/hoku/sugarcane-3vhxz
Provided by a Roboflow user
License: CC BY 4.0

View File

@ -1,27 +0,0 @@
sugarcane - v11 2023-07-19 9:58am
==============================
This dataset was exported via roboflow.com on July 9, 2024 at 5:16 AM GMT
Roboflow is an end-to-end computer vision platform that helps you
* collaborate with your team on computer vision projects
* collect & organize images
* understand and search unstructured image data
* annotate, and create datasets
* export, train, and deploy computer vision models
* use active learning to improve your dataset over time
For state of the art Computer Vision training notebooks you can use with this dataset,
visit https://github.com/roboflow/notebooks
To find over 100k other datasets and pre-trained models, visit https://universe.roboflow.com
The dataset includes 811 images.
Sugarcane are annotated in YOLOv8 format.
The following pre-processing was applied to each image:
No image augmentation techniques were applied.

View File

@ -1,14 +0,0 @@
path: datasets/sugarcane # dataset root dir
train: train/images
val: valid/images
test: test/images
nc: 2
names: ['sugarcane', 'weed']
roboflow:
workspace: hoku
project: sugarcane-3vhxz
version: 11
license: CC BY 4.0
url: https://universe.roboflow.com/hoku/sugarcane-3vhxz/dataset/11