-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_data.py
35 lines (29 loc) · 961 Bytes
/
setup_data.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import os
import subprocess
import sys
from pathlib import Path
def setup_dataset():
"""Download and setup the IDD dataset."""
data_dir = Path('IDD_data')
data_dir.mkdir(exist_ok=True)
if not (data_dir / 'IDD').exists():
print("Downloading IDD dataset...")
subprocess.run([
"git", "clone",
"https://github.com/mohanrajmit/IDD.git",
str(data_dir / "IDD")
])
print("Dataset downloaded successfully!")
else:
print("Dataset already exists!")
required_paths = [
data_dir / 'IDD/idd20k_lite/leftImg8bit',
data_dir / 'IDD/idd20k_lite/gtFine'
]
for path in required_paths:
if not path.exists():
raise RuntimeError(f"Missing required path: {path}")
return str(data_dir / 'IDD/idd20k_lite')
if __name__ == "__main__":
dataset_path = setup_dataset()
print(f"Dataset ready at: {dataset_path}")