Skip to main content

A collection of pre-quantized AI models for Mobilint NPUs.

Project description

Mobilint Model Zoo

mblt-model-zoo is a curated collection of AI models optimized by Mobilint’s Neural Processing Units (NPUs).

Designed to help developers accelerate deployment, Mobilint's Model Zoo offers access to public, pre-trained, and pre-quantized models for vision, language, and multimodal tasks. Along with performance results, we provide pre- and post-processing tools to help developers evaluate, fine-tune, and integrate the models with ease.

Installation

  • Install Mobilint ACCELerator(MACCEL) on your environment. In case you are not Mobilint customer, please contact us.
  • Install mblt-model-zoo using pip:
pip install mblt-model-zoo
  • If you want to install the latest version from the source, clone the repository and install it:
git clone https://github.com/mobilint/mblt-model-zoo.git
cd mblt-model-zoo
pip install -e .

Quick Start Guide

Initializing Quantized Model Class

mblt-model-zoo provides a quantized model with associated pre- and post-processing tools. The following code snippet shows how to use the pre-trained model for inference.

from mblt_model_zoo.vision import ResNet50

# Load the pre-trained model. 
# Automatically download the model if not found in the local cache.
resnet50 = ResNet50() 

# Load the model trained with different recipe
# Currently, default is "DEFAULT", or "IMAGENET1K_V1.
resnet50 = ResNet50(model_type = "IMAGENET1K_V2")

# Download the model to local directory and load it
resnet50 = ResNet50(local_path = "path/to/local/") # the file will be downloaded to "path/to/local/model.mxq"

# Load the model from a local path or download as filename and file path you want
resnet50 = ResNet50(local_path = "path/to/local/model.mxq")

# Set inference mode for better performance
# Aries supports "single", "multi" and "global" inferece mode. Default is "global"
resnet50 = ResNet50(infer_mode = "global")

# (Beta) If you are holding a model compiled for Regulus, enable inference on the Regulus device.
resnet50 = ResNet50(product = "regulus")

# In summary, the model can be loaded with the following arguments. 
# You may customize those arguments to work with Mobilint's NPU.
resnet50 = ResNet50(
    local_path = None,
    model_type = "DEFAULT",
    infer_mode = "global",
    product = "aries",
)

Working with Quantized Model

With the image given as path, PIL image, numpy array, or torch tensor, you can perform inference with the quantized model. The following code snippet shows how to use the quantized model for inference:

image_path = "path/to/image.jpg"

input_img = resnet50.preprocess(image_path) # Preprocess the input image
output = resnet50(input_img) # Perform inference with the quantized model
result = resnet50.postprocess(output) # Postprocess the output

result.plot(
    source_path=image_path,
    save_path="path/to/save/result.jpg",
)

Listing Available Models

mblt-model-zoo offers a function to list all available models. You can use the following code snippet to list the models for a specific task (e.g., image classification, object detection, etc.):

from mblt_model_zoo.vision import list_models
from pprint import pprint

available_models = list_models()
pprint(available_models)

Model List

We provide the models that are quantized with our advanced quantization techniques. List of available vision models are here.

Optional Extras

When working with tasks other than vision, extra dependencies may be required. Those options can be installed via pip install mblt-model-zoo[NAME] or pip install -e .[NAME].

Currently, this optional functions are only available on environment equipped with Mobilint's Aries.

Name Use Details
transformers For using HuggingFace transformers related models README.md

License

The Mobilint Model Zoo is released under BSD 3-Clause License. Please see the LICENSE file for more details.

Additionally, the license for each model provided in this package follows the terms specified in the source link provided with it.

Support & Issues

If you encounter any problems with this package, please feel free to contact us.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mblt_model_zoo-0.3.4.tar.gz (72.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mblt_model_zoo-0.3.4-py3-none-any.whl (115.1 kB view details)

Uploaded Python 3

File details

Details for the file mblt_model_zoo-0.3.4.tar.gz.

File metadata

  • Download URL: mblt_model_zoo-0.3.4.tar.gz
  • Upload date:
  • Size: 72.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for mblt_model_zoo-0.3.4.tar.gz
Algorithm Hash digest
SHA256 c88eb6e2167dc83171e6196e9bac85583a0680a4ae4b4510dad279454d6605a7
MD5 51c761534bab5b00b17d6df8d1da6253
BLAKE2b-256 ee2d58622db4ac1a741756e85457befcfeeebb2acfe6dd9cc30b4ef9e417a2ef

See more details on using hashes here.

File details

Details for the file mblt_model_zoo-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: mblt_model_zoo-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 115.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for mblt_model_zoo-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 71e9a3a59991b6c7b399da928c6c0f808cc30972164018e41e3b8466e600b709
MD5 8a3dc6a4043c4c411a4b6cb0ca53e06f
BLAKE2b-256 34f70b2258528887e1ed54085adf46a4b238eaba8d338dd281fb2b7a7675e017

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page