diff --git a/DATASETS.md b/DATASETS.md index dc36657..c196c18 100644 --- a/DATASETS.md +++ b/DATASETS.md @@ -7,7 +7,7 @@ datasets and is not directly redistributed by us. This data will be downloaded a of the `download_data.py` script. You can use `python visualize_data.py [path_to_dataset]` to visualize the data including some ground-truth annotations. -First setup your environment by running `pip install -r requirements.txt`. +First setup your environment by running `pip install -r requirements.txt` using python 3.10. ## SynthBody @@ -21,6 +21,9 @@ The following command will download the dataset to `YOUR_DATA_DIRECTORY/synth_bo python download_data.py --dataset body --output-dir YOUR_DATA_DIRECTORY/ ``` +If you want just a small subset of the data you can add the `--sample` flag. +The total size of the dataset is approximately TODOGB. + ### Contents #### Image Data @@ -99,6 +102,9 @@ The following command will download the dataset to `YOUR_DATA_DIRECTORY/synth_fa python download_data.py --dataset face --output-dir /YOUR_DATA_DIRECTORY/ ``` +If you want just a small subset of the data you can add the `--sample` flag. +The total size of the dataset is approximately TODOGB. + ### Contents #### Image Data @@ -172,6 +178,9 @@ The following command will download the dataset to `YOUR_DATA_DIRECTORY/synth_ha python download_data.py --dataset hand --output-dir /YOUR_DATA_DIRECTORY/ ``` +If you want just a small subset of the data you can add the `--sample` flag. +The total size of the dataset is approximately TODOGB. + ### Contents #### Image Data diff --git a/download_data.py b/download_data.py index 2e373b4..ce0d1ce 100644 --- a/download_data.py +++ b/download_data.py @@ -72,8 +72,8 @@ def _download_mpii_file(username: str, password: str, domain: str, file: str, ou def get_mano(out_dir: Path) -> None: """Download MANO data.""" print("Downloading MANO...") - username = input("Username: ") - password = getpass("Password: ") + username = input("Username for https://mano.is.tue.mpg.de/: ") + password = getpass("Password for https://mano.is.tue.mpg.de/: ") _download_mpii_file( username, password, @@ -86,8 +86,8 @@ def get_mano(out_dir: Path) -> None: def get_amass(out_dir: Path) -> None: """Download AMASS data.""" print("Downloading AMASS...") - username = input("Username: ") - password = getpass("Password: ") + username = input("Username for https://amass.is.tue.mpg.de/: ") + password = getpass("Password for https://amass.is.tue.mpg.de/: ") _download_mpii_file( username, password, @@ -119,11 +119,12 @@ def extract(data_path: Path, out_path: Optional[Path] = None) -> None: raise ValueError(f"Unknown file type {data_path.suffix}") -def download_synthmocap_data(dataset: str, out_dir: Path) -> None: +def download_synthmocap_data(data_dir: Path, dataset: str, zip_dir: Path, sample: bool) -> None: """Download one of the SynthMoCap datasets.""" - out_dir.mkdir(exist_ok=True, parents=True) - for part in range(1, N_PARTS + 1): - out_path = out_dir / f"{dataset}_{part:02d}.zip" + data_dir.mkdir(exist_ok=True, parents=True) + zip_dir.mkdir(exist_ok=True, parents=True) + for part in range(1, 2 if sample else N_PARTS + 1): + out_path = zip_dir / f"{dataset}_{part:02d}.zip" print(f"Downloading {dataset} part {part}...") url = f"https://facesyntheticspubwedata.blob.core.windows.net/sga-2024-synthmocap/{dataset}_{part:02d}.zip" try: @@ -144,7 +145,8 @@ def download_synthmocap_data(dataset: str, out_dir: Path) -> None: if out_path.exists(): out_path.unlink() sys.exit(1) - + extract(out_path, data_dir / dataset) + out_path.unlink() def process_metadata(data_dir: Path, dataset_name: str) -> None: """Process the metadata to include the correct pose data.""" @@ -204,6 +206,7 @@ def main() -> None: choices=["face", "body", "hand"], required=True, ) + parser.add_argument("--sample", action="store_true", help="Only download a small sample of the data") args = parser.parse_args() dataset_name = f"synth_{args.dataset}" data_dir = Path(args.output_dir) @@ -218,11 +221,7 @@ def main() -> None: path.unlink() # download the SynthEgo dataset zip_dir = data_dir / f"{dataset_name}_zip" - download_synthmocap_data(dataset_name, zip_dir) - # extract the SynthEgo dataset - for path in list(zip_dir.glob("*.zip")): - extract(path, data_dir / dataset_name) - path.unlink() + download_synthmocap_data(data_dir, dataset_name, zip_dir, args.sample) zip_dir.rmdir() if args.dataset in ["body", "hand"]: # process the metadata diff --git a/requirements.txt b/requirements.txt index 54a5b65..d237674 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ -matplotlib -numpy -opencv-python -pyrender -tqdm -transformations -trimesh \ No newline at end of file +matplotlib==3.7.1 +numpy==1.26.4 +opencv-python==4.10.0.84 +pyrender==0.1.45 +tqdm==4.65.0 +transformations==2022.9.26 +trimesh==3.22.1 \ No newline at end of file diff --git a/visualize_data.py b/visualize_data.py index a19aef7..e7cf4b9 100644 --- a/visualize_data.py +++ b/visualize_data.py @@ -255,8 +255,8 @@ def draw_landmarks( def _download_smplh() -> None: print("Downloading SMPL-H...") - username = input("Username: ") - password = getpass("Password: ") + username = input("Username for https://mano.is.tue.mpg.de/: ") + password = getpass("Password for https://mano.is.tue.mpg.de/: ") out_path = Path(__file__).parent / "smplh" / "smplh.tar.xz" out_path.parent.mkdir(exist_ok=True, parents=True) url = "https://download.is.tue.mpg.de/download.php?domain=mano&resume=1&sfile=smplh.tar.xz"