Skip to content

Comments

Parallelize and parameterize tile creation#9

Open
alexdelorenzo wants to merge 8 commits intonuno-faria:masterfrom
alexdelorenzo:master
Open

Parallelize and parameterize tile creation#9
alexdelorenzo wants to merge 8 commits intonuno-faria:masterfrom
alexdelorenzo:master

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