Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallelize and parameterize tile creation #9

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

alexdelorenzo
Copy link

@alexdelorenzo alexdelorenzo commented Sep 9, 2019

I put gen_tiles.py behind a CLI interface using click, and parameterized the depth and rotation options such that you can supply them via the command line.

I parallelized tile creation with a thread pool, since numpy releases the GIL. Also did some refactoring.

Here's the CLI interface:

alex@node:~/tiler$ python3 gen_tiles.py --help
Usage: gen_tiles.py [OPTIONS] IMG

Options:
  -d, --depth INTEGER      Color depth.  [default: 4]
  -r, --rotations INTEGER  Rotations.  [default: 0]
  --help                   Show this message and exit.


alex@node:~/tiler$ python3 gen_tiles.py -r 0 -r 90 -r 180 ~/example.png
  2%|| 6/375 00:05<07:24, 1.20s/i]

@alexdelorenzo
Copy link
Author

Fixed the progress bar in 9bba73d to account for multiple rotations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants