noahadhikari / binvox-stl-dataloader

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

binvox-stl-dataloader

Description

The download script for the folders is download_all_models.py and for the ratings is get_all_ratings.py.

All of the folders to be downloaded are located in the Python dictionary ALL_FILE_FOLDERS. Add additional folders with their folderIds to download them. Please try to name the key appropriately if possible, and feel free to comment out the ones that have already been downloaded.

Assumes the binvox folder contains the string "Binvox" and the stl folder contains the string "rotated".

Setup

If on Windows, you will need to install Git Bash.

To begin, open Git Bash, cd into whatever folder you'd like to clone the repository and run git clone https://github.com/noahadhikari/binvox-stl-dataloader.git. Open this folder in VSCode or a similar editor.

You'll also need to create a .env file in your root directory and copy-paste from the .env-template file (ignoring the braces):

GOOGLE_API_KEY = {your api key here}

Acquiring Google credentials

Follow the steps in the quickstart here and see if you can get quickstart.py working: https://developers.google.com/drive/api/quickstart/python

This will set up the environment expected for download_all_models.py.

NOTE: You may need to do the following steps before quickstart.py will work.

Change the port on the line creds = flow.run_local_server(port=0) to be port=8080 instead of port=0. Then do the following:

Create an OAuth client ID for Web Application and add the following to its Authorized JavaScript origins (unsure of how many of these are necessary):

and the following to Authorized redirect URIs:

Modifying scopes

After successfully running quickstart.py, delete token.json and you should be able to run download_all_models.py. This will update the token to have download-access (the quickstart only allows read access).

Python dependencies

  • tqdm
  • google-api-client

The google package should be installed after running the quickstart. To install tqdm, run

pip install tqdm

from the command line.

About


Languages

Language:Python 100.0%