There is a newer version of the record available.

Published September 13, 2023 | Version v0.9.1

ASEM000/pytreeclass: v0.9.1

Authors/Creators

  • 1. KAIST

Description

v0.9.1 Additions:
  • Add parallel mapping option in AtIndexer. This enables myriad of tasks, like reading a pytree of image file names.
import pytreeclass as tc
from skimage import io as skio
from matplotlib.pyplot import imread
paths = {"classification": {"image_path": "lenna.png"}}
indexer = tc.AtIndexer(paths)
images = indexer[...].apply(imread, parallel=dict(threads_count=3))
jax.tree_map(lambda x: x.shape, images)
# {'classification': {'image_path': (512, 512, 3)}}
# benchmarking serial vs sequential image read
# on mac m1 cpu with image of size 512x512x3
import pytreeclass as tc
from matplotlib.pyplot import imread
paths = ["lenna.png"] * 10
indexer = tc.AtIndexer(paths)
%timeit indexer[...].apply(imread,parallel=True)  # parallel
# # 37.6 ms ± 414 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
%timeit indexer[...].apply(imread)  # not parallel
# # 84.8 ms ± 453 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)

Files

ASEM000/pytreeclass-v0.9.1.zip

Files (378.5 kB)

Name Size Download all
md5:8bdfe274c8d3216b683ae18c69e67dc7
378.5 kB Preview Download

Additional details

Related works