forked from ultralytics/yolov5
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'tf-only-export' into tf-android
- Loading branch information
Showing
54 changed files
with
3,182 additions
and
1,266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# These are supported funding model platforms | ||
|
||
github: glenn-jocher | ||
patreon: ultralytics | ||
open_collective: ultralytics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Global Wheat 2020 dataset http://www.global-wheat.com/ | ||
# Train command: python train.py --data GlobalWheat2020.yaml | ||
# Default dataset location is next to YOLOv5: | ||
# /parent_folder | ||
# /datasets/GlobalWheat2020 | ||
# /yolov5 | ||
|
||
|
||
# train and val data as 1) directory: path/images/, 2) file: path/images.txt, or 3) list: [path1/images/, path2/images/] | ||
train: # 3422 images | ||
- ../datasets/GlobalWheat2020/images/arvalis_1 | ||
- ../datasets/GlobalWheat2020/images/arvalis_2 | ||
- ../datasets/GlobalWheat2020/images/arvalis_3 | ||
- ../datasets/GlobalWheat2020/images/ethz_1 | ||
- ../datasets/GlobalWheat2020/images/rres_1 | ||
- ../datasets/GlobalWheat2020/images/inrae_1 | ||
- ../datasets/GlobalWheat2020/images/usask_1 | ||
|
||
val: # 748 images (WARNING: train set contains ethz_1) | ||
- ../datasets/GlobalWheat2020/images/ethz_1 | ||
|
||
test: # 1276 images | ||
- ../datasets/GlobalWheat2020/images/utokyo_1 | ||
- ../datasets/GlobalWheat2020/images/utokyo_2 | ||
- ../datasets/GlobalWheat2020/images/nau_1 | ||
- ../datasets/GlobalWheat2020/images/uq_1 | ||
|
||
# number of classes | ||
nc: 1 | ||
|
||
# class names | ||
names: [ 'wheat_head' ] | ||
|
||
|
||
# download command/URL (optional) -------------------------------------------------------------------------------------- | ||
download: | | ||
from utils.general import download, Path | ||
# Download | ||
dir = Path('../datasets/GlobalWheat2020') # dataset directory | ||
urls = ['https://zenodo.org/record/4298502/files/global-wheat-codalab-official.zip', | ||
'https://github.com/ultralytics/yolov5/releases/download/v1.0/GlobalWheat2020_labels.zip'] | ||
download(urls, dir=dir) | ||
# Make Directories | ||
for p in 'annotations', 'images', 'labels': | ||
(dir / p).mkdir(parents=True, exist_ok=True) | ||
# Move | ||
for p in 'arvalis_1', 'arvalis_2', 'arvalis_3', 'ethz_1', 'rres_1', 'inrae_1', 'usask_1', \ | ||
'utokyo_1', 'utokyo_2', 'nau_1', 'uq_1': | ||
(dir / p).rename(dir / 'images' / p) # move to /images | ||
f = (dir / p).with_suffix('.json') # json file | ||
if f.exists(): | ||
f.rename((dir / 'annotations' / p).with_suffix('.json')) # move to /annotations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# SKU-110K retail items dataset https://github.com/eg4000/SKU110K_CVPR19 | ||
# Train command: python train.py --data SKU-110K.yaml | ||
# Default dataset location is next to YOLOv5: | ||
# /parent_folder | ||
# /datasets/SKU-110K | ||
# /yolov5 | ||
|
||
|
||
# train and val data as 1) directory: path/images/, 2) file: path/images.txt, or 3) list: [path1/images/, path2/images/] | ||
train: ../datasets/SKU-110K/train.txt # 8219 images | ||
val: ../datasets/SKU-110K/val.txt # 588 images | ||
test: ../datasets/SKU-110K/test.txt # 2936 images | ||
|
||
# number of classes | ||
nc: 1 | ||
|
||
# class names | ||
names: [ 'object' ] | ||
|
||
|
||
# download command/URL (optional) -------------------------------------------------------------------------------------- | ||
download: | | ||
import shutil | ||
from tqdm import tqdm | ||
from utils.general import np, pd, Path, download, xyxy2xywh | ||
# Download | ||
datasets = Path('../datasets') # download directory | ||
urls = ['http://trax-geometry.s3.amazonaws.com/cvpr_challenge/SKU110K_fixed.tar.gz'] | ||
download(urls, dir=datasets, delete=False) | ||
# Rename directories | ||
dir = (datasets / 'SKU-110K') | ||
if dir.exists(): | ||
shutil.rmtree(dir) | ||
(datasets / 'SKU110K_fixed').rename(dir) # rename dir | ||
(dir / 'labels').mkdir(parents=True, exist_ok=True) # create labels dir | ||
# Convert labels | ||
names = 'image', 'x1', 'y1', 'x2', 'y2', 'class', 'image_width', 'image_height' # column names | ||
for d in 'annotations_train.csv', 'annotations_val.csv', 'annotations_test.csv': | ||
x = pd.read_csv(dir / 'annotations' / d, names=names).values # annotations | ||
images, unique_images = x[:, 0], np.unique(x[:, 0]) | ||
with open((dir / d).with_suffix('.txt').__str__().replace('annotations_', ''), 'w') as f: | ||
f.writelines(f'./images/{s}\n' for s in unique_images) | ||
for im in tqdm(unique_images, desc=f'Converting {dir / d}'): | ||
cls = 0 # single-class dataset | ||
with open((dir / 'labels' / im).with_suffix('.txt'), 'a') as f: | ||
for r in x[images == im]: | ||
w, h = r[6], r[7] # image width, height | ||
xywh = xyxy2xywh(np.array([[r[1] / w, r[2] / h, r[3] / w, r[4] / h]]))[0] # instance | ||
f.write(f"{cls} {xywh[0]:.5f} {xywh[1]:.5f} {xywh[2]:.5f} {xywh[3]:.5f}\n") # write label |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# VisDrone2019-DET dataset https://github.com/VisDrone/VisDrone-Dataset | ||
# Train command: python train.py --data VisDrone.yaml | ||
# Default dataset location is next to YOLOv5: | ||
# /parent_folder | ||
# /VisDrone | ||
# /yolov5 | ||
|
||
|
||
# train and val data as 1) directory: path/images/, 2) file: path/images.txt, or 3) list: [path1/images/, path2/images/] | ||
train: ../VisDrone/VisDrone2019-DET-train/images # 6471 images | ||
val: ../VisDrone/VisDrone2019-DET-val/images # 548 images | ||
test: ../VisDrone/VisDrone2019-DET-test-dev/images # 1610 images | ||
|
||
# number of classes | ||
nc: 10 | ||
|
||
# class names | ||
names: [ 'pedestrian', 'people', 'bicycle', 'car', 'van', 'truck', 'tricycle', 'awning-tricycle', 'bus', 'motor' ] | ||
|
||
|
||
# download command/URL (optional) -------------------------------------------------------------------------------------- | ||
download: | | ||
from utils.general import download, os, Path | ||
def visdrone2yolo(dir): | ||
from PIL import Image | ||
from tqdm import tqdm | ||
def convert_box(size, box): | ||
# Convert VisDrone box to YOLO xywh box | ||
dw = 1. / size[0] | ||
dh = 1. / size[1] | ||
return (box[0] + box[2] / 2) * dw, (box[1] + box[3] / 2) * dh, box[2] * dw, box[3] * dh | ||
(dir / 'labels').mkdir(parents=True, exist_ok=True) # make labels directory | ||
pbar = tqdm((dir / 'annotations').glob('*.txt'), desc=f'Converting {dir}') | ||
for f in pbar: | ||
img_size = Image.open((dir / 'images' / f.name).with_suffix('.jpg')).size | ||
lines = [] | ||
with open(f, 'r') as file: # read annotation.txt | ||
for row in [x.split(',') for x in file.read().strip().splitlines()]: | ||
if row[4] == '0': # VisDrone 'ignored regions' class 0 | ||
continue | ||
cls = int(row[5]) - 1 | ||
box = convert_box(img_size, tuple(map(int, row[:4]))) | ||
lines.append(f"{cls} {' '.join(f'{x:.6f}' for x in box)}\n") | ||
with open(str(f).replace(os.sep + 'annotations' + os.sep, os.sep + 'labels' + os.sep), 'w') as fl: | ||
fl.writelines(lines) # write label.txt | ||
# Download | ||
dir = Path('../VisDrone') # dataset directory | ||
urls = ['https://github.com/ultralytics/yolov5/releases/download/v1.0/VisDrone2019-DET-train.zip', | ||
'https://github.com/ultralytics/yolov5/releases/download/v1.0/VisDrone2019-DET-val.zip', | ||
'https://github.com/ultralytics/yolov5/releases/download/v1.0/VisDrone2019-DET-test-dev.zip', | ||
'https://github.com/ultralytics/yolov5/releases/download/v1.0/VisDrone2019-DET-test-challenge.zip'] | ||
download(urls, dir=dir) | ||
# Convert | ||
for d in 'VisDrone2019-DET-train', 'VisDrone2019-DET-val', 'VisDrone2019-DET-test-dev': | ||
visdrone2yolo(dir / d) # convert VisDrone annotations to YOLO labels |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Argoverse-HD dataset (ring-front-center camera) http://www.cs.cmu.edu/~mengtial/proj/streaming/ | ||
# Train command: python train.py --data argoverse_hd.yaml | ||
# Default dataset location is next to YOLOv5: | ||
# /parent_folder | ||
# /argoverse | ||
# /yolov5 | ||
|
||
|
||
# download command/URL (optional) | ||
download: bash data/scripts/get_argoverse_hd.sh | ||
|
||
# train and val data as 1) directory: path/images/, 2) file: path/images.txt, or 3) list: [path1/images/, path2/images/] | ||
train: ../argoverse/Argoverse-1.1/images/train/ # 39384 images | ||
val: ../argoverse/Argoverse-1.1/images/val/ # 15062 iamges | ||
test: ../argoverse/Argoverse-1.1/images/test/ # Submit to: https://eval.ai/web/challenges/challenge-page/800/overview | ||
|
||
# number of classes | ||
nc: 8 | ||
|
||
# class names | ||
names: [ 'person', 'bicycle', 'car', 'motorcycle', 'bus', 'truck', 'traffic_light', 'stop_sign' ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
lr0: 0.00258 | ||
lrf: 0.17 | ||
momentum: 0.779 | ||
weight_decay: 0.00058 | ||
warmup_epochs: 1.33 | ||
warmup_momentum: 0.86 | ||
warmup_bias_lr: 0.0711 | ||
box: 0.0539 | ||
cls: 0.299 | ||
cls_pw: 0.825 | ||
obj: 0.632 | ||
obj_pw: 1.0 | ||
iou_t: 0.2 | ||
anchor_t: 3.44 | ||
anchors: 3.2 | ||
fl_gamma: 0.0 | ||
hsv_h: 0.0188 | ||
hsv_s: 0.704 | ||
hsv_v: 0.36 | ||
degrees: 0.0 | ||
translate: 0.0902 | ||
scale: 0.491 | ||
shear: 0.0 | ||
perspective: 0.0 | ||
flipud: 0.0 | ||
fliplr: 0.5 | ||
mosaic: 1.0 | ||
mixup: 0.0 |
Oops, something went wrong.