### Install ObjaTHOR from source Source: https://github.com/allenai/objathor/blob/main/README.md Installs ObjaTHOR from the source directory in editable mode with the annotation extra. Use this when developing or building from a local checkout. ```bash pip install -e ".[annotation]" ``` -------------------------------- ### Install NLTK from specific commit Source: https://github.com/allenai/objathor/blob/main/README.md Installs NLTK from a specific commit on GitHub. Required for annotation functionality. ```bash pip install git+https://github.com/nltk/nltk@582e6e35f0e6c984b44ec49dcb8846d9c011d0a8 ``` -------------------------------- ### Install ObjaTHOR with annotation extra Source: https://github.com/allenai/objathor/blob/main/README.md Installs ObjaTHOR with the annotation extra, which enables using OpenAI to generate annotations. Requires NLTK and Blender for full functionality. ```bash pip install objathor[annotation] ``` -------------------------------- ### Install ai2thor with pip Source: https://github.com/allenai/objathor/blob/main/README.md Installs the ai2thor package from the AI2-THOR PyPI index at a specific commit. Use this to get the required version of ai2thor for ObjaTHOR. ```bash pip install --extra-index-url https://ai2thor-pypi.allenai.org ai2thor==0+455cf72a1c8e0759a452422f2128fbc93a3cb06b ``` -------------------------------- ### Install Blender as a Python module Source: https://github.com/allenai/objathor/blob/main/README.md Installs Blender as a Python module using pip. Requires a Python 3.10 environment. Use this when you need Blender for rendering or GLB conversion. ```bash pip install bpy ``` -------------------------------- ### Download NLTK data dependencies Source: https://github.com/allenai/objathor/blob/main/README.md Downloads the NLTK data packages (punkt, wordnet2022, brown, averaged_perceptron_tagger) needed for annotation. These are normally installed automatically on first run, but can be pre-installed. ```bash python -c "import nltk; nltk.download('punkt'); nltk.download('wordnet2022'); nltk.download('brown'); nltk.download('averaged_perceptron_tagger')" ``` -------------------------------- ### Upload asset tarball to R2 Source: https://github.com/allenai/objathor/blob/main/objathor/dataset/README.md Uploads the asset tarball to CloudFlare R2 using rclone. Requires rclone to be installed and configured. ```bash rclone copy -P /PATH/TO/YOUR_DATASET_UID/assets.tar r2:your-bucket/YOUR_DATASET_UID/ ``` -------------------------------- ### Prepare annotations file Source: https://github.com/allenai/objathor/blob/main/objathor/dataset/README.md Prepares the annotations file for a dataset. The output is a JSON file containing annotations for all objects. ```bash python -m objathor.dataset.prepare_annotations \ --save-dir DIRECTORY_OF_OPTIMIZED_ASSETS \ --output-file /PATH/TO/YOUR_DATASET_UID/annotations.json.gz ``` -------------------------------- ### Download annotations and assets for a dataset version Source: https://github.com/allenai/objathor/blob/main/objathor/dataset/README.md Downloads annotations and assets for a specific dataset version. By default, saves to `~/.objathor-assets/2023_07_28/annotations.json.gz` and `~/.objathor-assets/2023_07_28/assets/` respectively. Use `--path` to change the directory. ```bash python -m objathor.dataset.download_annotations --version 2023_07_28 python -m objathor.dataset.download_assets --version 2023_07_28 ``` -------------------------------- ### Pre-download THOR binaries Source: https://github.com/allenai/objathor/blob/main/README.md Pre-downloads the THOR binaries for a remote Linux server. Uses the ai2thor Controller with download_only=True and platform='CloudRendering'. For MacOS, use platform='OSXIntel64'. ```bash python -c "from ai2thor.controller import Controller; from objathor.constants import THOR_COMMIT_ID; c=Controller(download_only=True, platform='CloudRendering', commit_id=THOR_COMMIT_ID)" ``` -------------------------------- ### Run annotation and conversion pipeline Source: https://github.com/allenai/objathor/blob/main/README.md Runs the ObjaTHOR main module to generate annotations via GPT-4 and convert the asset to a valid THOR asset. Requires the annotation extra, Blender, and an OpenAI API key. Set OUTPUT_DIR to the desired output directory. ```bash OUTPUT_DIR=/path/to/output python -m objathor.main \ --uid 0070ac4bf50b496387365843d4bf5432 \ --output "$OUTPUT_DIR" ``` -------------------------------- ### Create asset tarball with exclusions Source: https://github.com/allenai/objathor/blob/main/objathor/dataset/README.md Creates a tarball of optimized assets, excluding unnecessary files and directories (e.g., per-object annotations, metadata, macOS system files). The output is saved to `/PATH/TO/YOUR_DATASET_UID/assets.tar`. ```bash cd /path/to/your/optimized/assets tar \ --exclude='annotations.json.gz' \ --exclude='thor_metadata.json' \ --exclude='.DS_Store' \ --exclude='._*' \ --exclude='.Spotlight-V100' \ --exclude='.Trashes' \ --exclude='.fseventsd' \ --exclude='.VolumeIcon.icns' \ --exclude='.apdisk' \ --exclude='.TemporaryItems' \ --exclude='*.lock' \ -cvf /PATH/TO/YOUR_DATASET_UID/assets.tar DIRECTORY_OF_OPTIMIZED_ASSETS ``` -------------------------------- ### Convert GLB to THOR asset Source: https://github.com/allenai/objathor/blob/main/README.md Converts a GLB asset to a THOR-compatible format using the asset conversion pipeline. Requires Blender (as module or application) and optional annotations file. Run with --help for more options. ```bash python -m objathor.asset_conversion.pipeline_to_thor --uids=000074a334c541360457c672b6c2e --output_dir= --extension=.msgpack.gz --annotations= --live --blender_as_module ``` -------------------------------- ### Download Holodeck base data Source: https://github.com/allenai/objathor/blob/main/objathor/dataset/README.md Downloads additional metadata/annotations/features needed for generating Holodeck houses. Saves to `~/.objathor-assets/holodeck/2023_09_23/`. ```bash python -m objathor.dataset.download_holodeck_base_data --version 2023_09_23 ``` -------------------------------- ### Upload asset tarball to R2 with performance flags Source: https://github.com/allenai/objathor/blob/main/objathor/dataset/README.md Uploads the asset tarball to R2 with optimized flags for large files, potentially speeding up the transfer. Note the duplicate `--s3-chunk-size` flag. ```bash rclone copy -P \ --s3-chunk-size 50M \ --transfers 300 \ --s3-upload-concurrency 300 \ --s3-chunk-size 50M \ --ignore-checksum \ --s3-disable-checksum \ /PATH/TO/YOUR_DATASET_UID/assets.tar r2:your-bucket/YOUR_DATASET_UID/ ``` -------------------------------- ### Set OpenAI API key environment variable Source: https://github.com/allenai/objathor/blob/main/README.md Exports the OpenAI API key as an environment variable. Recommended before running annotation commands that use OpenAI. ```bash export OPENAI_API_KEY=[Your key] ``` -------------------------------- ### Download retrieval features for Holodeck Source: https://github.com/allenai/objathor/blob/main/objathor/dataset/README.md Downloads retrieval features (e.g., CLIP features) for assets, required for use with Holodeck. The version 2023_09_23 is used by Holodeck. ```bash python -m objathor.dataset.download_features --version 2023_09_23 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.