tiler icon indicating copy to clipboard operation
tiler copied to clipboard

Parallelize and parameterize tile creation

Open alexdelorenzo opened this issue 4 years ago • 1 comments

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 avatar Sep 09 '19 01:09 alexdelorenzo

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

alexdelorenzo avatar Sep 09 '19 01:09 alexdelorenzo