forked from Javacr/PyQt5-YOLOv5
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
100 changed files
with
4,941 additions
and
1,781 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"iou": 0.26, | ||
"conf": 0.33, | ||
"rate": 10, | ||
"rate": 20, | ||
"check": 0, | ||
"savecheck": 2 | ||
"savecheck": 0 | ||
} |
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,67 @@ | ||
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license | ||
# Argoverse-HD dataset (ring-front-center camera) http://www.cs.cmu.edu/~mengtial/proj/streaming/ by Argo AI | ||
# Example usage: python train.py --data Argoverse.yaml | ||
# parent | ||
# ├── yolov5 | ||
# └── datasets | ||
# └── Argoverse ← downloads here | ||
|
||
|
||
# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..] | ||
path: ../datasets/Argoverse # dataset root dir | ||
train: Argoverse-1.1/images/train/ # train images (relative to 'path') 39384 images | ||
val: Argoverse-1.1/images/val/ # val images (relative to 'path') 15062 images | ||
test: Argoverse-1.1/images/test/ # test images (optional) https://eval.ai/web/challenges/challenge-page/800/overview | ||
|
||
# Classes | ||
nc: 8 # number of classes | ||
names: ['person', 'bicycle', 'car', 'motorcycle', 'bus', 'truck', 'traffic_light', 'stop_sign'] # class names | ||
|
||
|
||
# Download script/URL (optional) --------------------------------------------------------------------------------------- | ||
download: | | ||
import json | ||
from tqdm import tqdm | ||
from utils.general import download, Path | ||
def argoverse2yolo(set): | ||
labels = {} | ||
a = json.load(open(set, "rb")) | ||
for annot in tqdm(a['annotations'], desc=f"Converting {set} to YOLOv5 format..."): | ||
img_id = annot['image_id'] | ||
img_name = a['images'][img_id]['name'] | ||
img_label_name = img_name[:-3] + "txt" | ||
cls = annot['category_id'] # instance class id | ||
x_center, y_center, width, height = annot['bbox'] | ||
x_center = (x_center + width / 2) / 1920.0 # offset and scale | ||
y_center = (y_center + height / 2) / 1200.0 # offset and scale | ||
width /= 1920.0 # scale | ||
height /= 1200.0 # scale | ||
img_dir = set.parents[2] / 'Argoverse-1.1' / 'labels' / a['seq_dirs'][a['images'][annot['image_id']]['sid']] | ||
if not img_dir.exists(): | ||
img_dir.mkdir(parents=True, exist_ok=True) | ||
k = str(img_dir / img_label_name) | ||
if k not in labels: | ||
labels[k] = [] | ||
labels[k].append(f"{cls} {x_center} {y_center} {width} {height}\n") | ||
for k in labels: | ||
with open(k, "w") as f: | ||
f.writelines(labels[k]) | ||
# Download | ||
dir = Path('../datasets/Argoverse') # dataset root dir | ||
urls = ['https://argoverse-hd.s3.us-east-2.amazonaws.com/Argoverse-HD-Full.zip'] | ||
download(urls, dir=dir, delete=False) | ||
# Convert | ||
annotations_dir = 'Argoverse-HD/annotations/' | ||
(dir / 'Argoverse-1.1' / 'tracking').rename(dir / 'Argoverse-1.1' / 'images') # rename 'tracking' to 'images' | ||
for d in "train.json", "val.json": | ||
argoverse2yolo(dir / annotations_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
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
Oops, something went wrong.