CVPR 2021 Argoverse-HD autodownload fix (#2418)

This commit is contained in:
Glenn Jocher 2021-03-09 21:07:27 -08:00 committed by GitHub
parent c51dfec8ea
commit d5ca8ca34e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 11 deletions

View File

@ -23,6 +23,7 @@ cd ../Argoverse-HD/annotations/
python3 - "$@" <<END python3 - "$@" <<END
import json import json
from pathlib import Path from pathlib import Path
annotation_files = ["train.json", "val.json"] annotation_files = ["train.json", "val.json"]
print("Converting annotations to YOLOv5 format...") print("Converting annotations to YOLOv5 format...")
@ -37,10 +38,10 @@ for val in annotation_files:
obj_class = annot['category_id'] obj_class = annot['category_id']
x_center, y_center, width, height = annot['bbox'] x_center, y_center, width, height = annot['bbox']
x_center = x_center / 1920.0 x_center = (x_center + width / 2) / 1920. # offset and scale
width = width / 1920.0 y_center = (y_center + height / 2) / 1200. # offset and scale
y_center = y_center / 1200.0 width /= 1920. # scale
height = height / 1200.0 height /= 1200. # scale
img_dir = "./labels/" + a['seq_dirs'][a['images'][annot['image_id']]['sid']] img_dir = "./labels/" + a['seq_dirs'][a['images'][annot['image_id']]['sid']]
@ -59,7 +60,3 @@ for val in annotation_files:
END END
mv ./labels ../../Argoverse-1.1/ mv ./labels ../../Argoverse-1.1/