TDW includes a non-free model library: models_full.json
. This library has far more models than the free models_core.json
and far more categories. Like models_core.json
, they are photorealistic.
from tdw.librarian import ModelLibrarian
for librarian_filename in ["models_core.json", "models_full.json"]:
librarian = ModelLibrarian(librarian_filename)
categories = librarian.get_model_wnids_and_wcategories()
print(librarian_filename)
print(f"Number of models: {len(librarian.records)}")
print(f"Number of semantic categories: {len(categories)}")
print("")
Output:
models_core.json
Number of models: 513
Number of semantic categories: 106
models_full.json
Number of models: 2399
Number of semantic categories: 239
For the sake of convenience, models_full.json
includes all of the models in models_core.json
:
from tdw.librarian import ModelLibrarian
core = ModelLibrarian("models_core.json")
full = ModelLibrarian("models_full.json")
for core_record in core.records:
full_record = full.get_record(core_record.name)
assert full_record is not None
models_full.json
is non-free and can't be downloaded without special access privlieges.
- You must be affiliated with MIT, IBM, or Stanford. (This will change in the future.)
- Amazon S3 access keys
If you haven't done so already, email Jeremy Schwartz to request access keys for the full model library. You will receive an email with the title “Welcome to ThreeDWorld(TDW)”. This email will contain login instructions and your username for the TDW Amazon AWS console, where you will generate your access credentials. You will also receive a second email, containing the temporary password associated with that username. Note this email will be an encrypted email, and will require entering an access key to open which will be sent to you separately via Slack DM.
You must change your password immediately upon login, per the instructions below. Also, you will not have permissions to perform any actions in the Console; you will only be able to generate your access credentials as described below.
After clicking on the link, you will be taken to the Amazon AWS Console page for the TDW account. Click on the down arrow marked in red below:
This will display the drop-down menu for your login. Click on “My Security Credentials”:
You will go to the credentials management page, where you will first change the temporary password you logged in with by clicking in the “Change password” button:
Next, you will generate your access key, which is in the form of a public / private key pair; click on the “Create access key” button as shown below.
This is your only opportunity to save the information for both keys, so you must either download the CSV using the button highlighted below (recommended), or else show the secret access key and make a note of both keys.
- Create a new file here:
<home>/.aws/credentials
Where <home>
is your home directory. Note that credentials
doesn't have a file extension.
- Add this to the file:
[tdw]
aws_access_key_id=<access key id>
aws_secret_access_key=<secret acccess key>
Replace <access key id>
with your access key ID, and <secret access key>
with your secret access key.
You need a config file in addition to your credentials file:
<home>/.aws/config
You can create this config file in one of two ways.
[default]
region = us-east-1
output = json
With Python3:
from tdw.tdw_utils import TDWUtils
TDWUtils.validate_amazon_s3()
This will validate that everything is set up correctly and generate a config file for you.
You can run screenshotter.py --type models_full
to generate images of every model in the library. Be aware that it will take at least an hour to create every image.
This is the last document in the "3D model libraries" tutorial.
Python API: