Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CVPR 2021 Argoverse-HD autodownload fix #2418

Merged
merged 1 commit into from
Mar 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions data/scripts/get_argoverse_hd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ d='../argoverse/' # unzip directory
mkdir $d
url=https://argoverse-hd.s3.us-east-2.amazonaws.com/
f=Argoverse-HD-Full.zip
wget $url$f -O $f && unzip -q $f -d $d && rm $f & # download, unzip, remove in background
wait # finish background tasks
wget $url$f -O $f && unzip -q $f -d $d && rm $f &# download, unzip, remove in background
wait # finish background tasks

cd ../argoverse/Argoverse-1.1/
ln -s tracking images
Expand All @@ -23,6 +23,7 @@ cd ../Argoverse-HD/annotations/
python3 - "$@" <<END
import json
from pathlib import Path

annotation_files = ["train.json", "val.json"]
print("Converting annotations to YOLOv5 format...")

Expand All @@ -37,10 +38,10 @@ for val in annotation_files:

obj_class = annot['category_id']
x_center, y_center, width, height = annot['bbox']
x_center = x_center / 1920.0
width = width / 1920.0
y_center = y_center / 1200.0
height = height / 1200.0
x_center = (x_center + width / 2) / 1920. # offset and scale
y_center = (y_center + height / 2) / 1200. # offset and scale
width /= 1920. # scale
height /= 1200. # scale

img_dir = "./labels/" + a['seq_dirs'][a['images'][annot['image_id']]['sid']]

Expand All @@ -50,7 +51,7 @@ for val in annotation_files:
label_dict[img_dir + "/" + img_label_name] = []

label_dict[img_dir + "/" + img_label_name].append(f"{obj_class} {x_center} {y_center} {width} {height}\n")

for filename in label_dict:
with open(filename, "w") as file:
for string in label_dict[filename]:
Expand All @@ -59,7 +60,3 @@ for val in annotation_files:
END

mv ./labels ../../Argoverse-1.1/