From 8a6c6620adc8670de8388b495a3d5e4ad73af491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cem=20G=C3=B6kmen?= Date: Fri, 16 Dec 2022 02:33:38 +1300 Subject: [PATCH] Some changes to download routines. --- docker/Dockerfile | 1 + docker/README.md | 8 ++++---- omnigibson/scripts/setup.py | 22 ++++++++++------------ omnigibson/utils/asset_utils.py | 3 +-- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 59f3a2e1d..eabc9948a 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -36,6 +36,7 @@ RUN micromamba install -c conda-forge opencv # Install OmniGibson RUN pip install -e . +RUN echo "python -m omnigibson.scripts.setup" >> /root/.bashrc ENTRYPOINT [] CMD ["/bin/bash"] diff --git a/docker/README.md b/docker/README.md index becce7909..ece230771 100644 --- a/docker/README.md +++ b/docker/README.md @@ -14,9 +14,9 @@ See [here](https://www.pugetsystems.com/labs/hpc/how-to-setup-nvidia-docker-and- 2. Build the container. **From the OmniGibson root**, run: `./docker/build_docker.sh` 3. Run the container -* To get a shell inside a container with GUI: `./docker/run_docker_gui.sh` -* To get a jupyter notebook: `./docker/run_docker_notebook.sh` -* To get access to a shell inside a headless container `./docker/run_docker.sh` +* To get a shell inside a container with GUI: `sudo ./docker/run_docker_gui.sh` +* To get a jupyter notebook: `sudo ./docker/run_docker_notebook.sh` +* To get access to a shell inside a headless container `sudo ./docker/run_docker.sh` # Development -To push a Docker container, run: `./docker/push_docker.sh` \ No newline at end of file +To push a Docker container, run: `sudo ./docker/push_docker.sh` \ No newline at end of file diff --git a/omnigibson/scripts/setup.py b/omnigibson/scripts/setup.py index 402ddfea8..871a74e85 100644 --- a/omnigibson/scripts/setup.py +++ b/omnigibson/scripts/setup.py @@ -14,19 +14,17 @@ def main(): print() # Only download if the dataset path doesn't exist - if os.path.exists(og.og_dataset_path): - return - - print("Downloading dataset...") - dataset_options = { - "Demo": "Download the demo OmniGibson dataset", - "Full": "Download the full OmniGibson dataset", - } - dataset = choose_from_options(options=dataset_options, name="dataset") - if dataset == "Demo": + if not os.path.exists(og.og_dataset_path): + print("Downloading dataset...") + # dataset_options = { + # "Demo": "Download the demo OmniGibson dataset", + # "Full": "Download the full OmniGibson dataset", + # } + # dataset = choose_from_options(options=dataset_options, name="dataset") + # if dataset == "Demo": download_demo_data() - else: - download_og_dataset() + # else: + # download_og_dataset() print("Downloading assets...") download_assets() diff --git a/omnigibson/utils/asset_utils.py b/omnigibson/utils/asset_utils.py index 1a4a5af93..afc437f32 100644 --- a/omnigibson/utils/asset_utils.py +++ b/omnigibson/utils/asset_utils.py @@ -283,8 +283,7 @@ def download_assets(): Download OmniGibson assets """ if os.path.exists(og.assets_path): - print("Assets path already exists. Please either remove or change the asset path location from " - "omnigibson/global_config.yaml") + print("Assets already downloaded.") else: tmp_file = os.path.join(tempfile.gettempdir(), "og_assets.tar.gz") os.makedirs(os.path.dirname(og.assets_path), exist_ok=True)