Mash is a straightforward utility library for common tasks in computer vision and deep model training. The library was broken out of previous Moonshine projects like Moonshine and Zeroshot.
Mash broadly supports a few utilities, but the main ones are:
- Easy image conversion: simply call
to_pil
,to_numpy
, andto_tensor
to convert image formats. Accepts other images, URLs, or local files. - Image processing files: convenience functions like
crop_to_multiple_of_dimensions
for transformer based patch models like ViT. - Console UI: for long running jobs, a fullscreen console utility that has a progress bar at the bottom and text logging.
- Cloud functions: use
glob
orexists
on AWS or GCS links.
For a complete list of functions, see the documentation
To install via pip:
pip install mashlib
To use:
# Import base package
import mash
# Import image processing
import mash.images as mi
image = mi.to_numpy("/path/to/image.png")