Skip to main content

ObjaTHOR

Objaverse asset annotator and importer for use in THOR.

Installation

Install ai2thor:

pip install --extra-index-url https://ai2thor-pypi.allenai.org ai2thor==0+455cf72a1c8e0759a452422f2128fbc93a3cb06b

Install other dependencies:

pip install objathor[annotation]

Here the following extras are installed: annotation to use openai to generate annotations. Also for annotation functionality you must install nltk Install nltk. To generate renders and convert 'glb' models in the conversion pipeline you must Install Blender .

From source:

pip install -e ".[annotation]"

We recommend setting an environment variable with your OpenAI key:

export OPENAI_API_KEY=[Your key]

If you're planning to annotate objects for which we don't have pre-generated views in S3 (see an example under Annotation below), we also need to install blender either as an extra (as shown above) or as an application:

Blender install instructions

Installing the Blender as a module:

pip install bpy

Installing the Blender as a module, requires a python 3.10 environment.

Or installing blender as an application: Blender install instructions

If application is not in the cannonical directories you may need to pass blender_installation_path to scripts that use Blender.

NLTK dependencies

Install nltk on this commit by running:

pip install git+https://github.com/nltk/nltk@582e6e35f0e6c984b44ec49dcb8846d9c011d0a8

During the first run, NLTK dependencies are automatically installed, but we can also install them ahead:

python -c "import nltk; nltk.download('punkt'); nltk.download('wordnet2022'); nltk.download('brown'); nltk.download('averaged_perceptron_tagger')"

AI2-THOR binary pre-downloading

Assuming we're running on a remote Linux server, we can pre-download the THOR binaries with:

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)"

(platform='OSXIntel64' would be used for a MacOS environment).

Usage

Annotation

You must install the annotation extra requirement through pip, ad have blender installed, either standalone or as a module. The following command will generate annotation, via GPT-4, and also generate the conversion to a valid THOR asset.

OUTPUT_DIR=/path/to/output
python -m objathor.main \
--uid 0070ac4bf50b496387365843d4bf5432 \
--output "$OUTPUT_DIR"

GLB to THOR asset conversion

From the repository root run:

python 
-m objathor.asset_conversion.pipeline_to_thor 
--uids=000074a334c541878360457c672b6c2e 
--output_dir=<some_absolute_path>
--extension=.msgpack.gz
 --annotations=<annotations_file_path> 
--live 
--blender_as_module

Where uids is a string of comma separated list of Objaverse ids to process. output_dir is an absolute path indicating where to write the output of the conversion. annotations is optional, and is the path to an annotations file as generated by the process described above.

Run python -m objathor.asset_conversion.pipeline_to_thor --help for other options.

Metadata

Release files for objathor 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for objathor 0.0.8
File Size Uploaded Provenance Actions
objathor-0.0.8.tar.gz 87.8 kB Without provenance Details for objathor-0.0.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for objathor 0.0.8
File Interpreter ABI Platform Actions
objathor-0.0.8-py3-none-any.whl Python 3 none any Details for objathor-0.0.8-py3-none-any.whl

Total release size: 193.2 kB

Release files / objathor-0.0.8.tar.gz

Download URL objathor-0.0.8.tar.gz
Size 87.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f894c957655c6239551dc473bc32b2af462f412c7ebcd19211785e554172e15b
BLAKE2b-256 checksum
How to use checksums
e19a453dc21ff9aa9397231013c40e537de964d38735bed0c633818891e831ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.17

Release files / objathor-0.0.8-py3-none-any.whl

Download URL objathor-0.0.8-py3-none-any.whl
Size 105.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a9270088cc0e4352c2e210ec437117dfe15ee9ead165f064201e15c0b731a6b7
BLAKE2b-256 checksum
How to use checksums
40dab7075fe105d754e563b24b1a422dd65b08eed0239a5ea0bb229c5d01fe1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.17

Security for objathor 0.0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page