Skip to main content

modelmaite - MAITE-compliant model wrappers

modelmaite is a Python package providing model utilities built on the maite protocols.

THIS PACKAGE IS CURRENTLY UNDER CONSTRUCTION

Model wrappers

modelmaite.image_classification.TorchvisionICModel wraps torchvision image-classification models as MAITE-compatible image-classification models.

modelmaite.image_classification.OnnxICModel wraps JATIC_ONNX v1 image-classification models as MAITE-compatible image-classification models.

modelmaite.object_detection.TorchvisionODModel wraps torchvision object-detection models as MAITE-compatible object-detection models.

modelmaite.object_detection.VisdroneODModel wraps Kitware CenterNet VisDrone models as MAITE-compatible object-detection models.

modelmaite.object_detection.OnnxODModel wraps JATIC_ONNX v1 object-detection models as MAITE-compatible object-detection models.

modelmaite.multiobject_tracking.ByteTrackMOTModel combines any MAITE-compatible object-detection model with ByteTrack to produce MAITE-compatible multi-object tracks.

Installation

The core install contains no model runtime; each wrapper needs an optional extra:

Extra Wrappers
torchvision TorchvisionICModel, TorchvisionODModel
visdrone VisdroneODModel
onnx OnnxICModel, OnnxODModel on CPU ONNX Runtime
onnx-cuda the same ONNX wrappers on onnxruntime-gpu
mot ByteTrackMOTModel
uv add "modelmaite[torchvision]"

Prefer one of onnx or onnx-cuda; they install competing ONNX Runtime builds. The mot and visdrone extras must be installed in separate environments: on Python 3.10–3.12 they resolve incompatible NumPy versions, and the combination is untested on 3.13+.

The detector is supplied separately, so the MOT wrapper works with any MAITE-compatible object-detection model.

Multi-object tracking with datamaite datasets

datamaite reads MOTChallenge, TAO, and VisDrone-video annotations and presents each video as a MAITE multi-object-tracking dataset, so ByteTrackMOTModel consumes them with no reader of its own.

Install the three packages plus the detector's own extra. datamaite 0.5.0 is the first release whose MAITE view streams image-folder sequences; on 0.4.1 and earlier these datasets load as zero items:

uv add "modelmaite[mot,torchvision]" "datamaite>=0.5.0" maite

The first run of the example below downloads torchvision's SSDLite weights.

from datamaite import load_mot
from maite.tasks import predict

from modelmaite import ByteTrackMOTModel, TorchvisionODModel

dataset = load_mot("/data/MOT17", dataset_format="motchallenge")
detector = TorchvisionODModel(model_name="ssdlite320_mobilenet_v3_large")
predictions, _ = predict(model=ByteTrackMOTModel(detector=detector), dataset=dataset)

Use dataset_format="tao" or dataset_format="visdrone_video" for the other two readers. "visdrone" is the still-image object-detection reader and will not load as a tracking dataset.

All three formats store a video as a folder of images rather than a single video file, so they need datamaite>=0.5.0, which added the image-sequence MAITE stream. Decoding frame folders needs only OpenCV, which modelmaite[mot] already installs; PyAV is required for video-file datasets, not these.

Options worth setting explicitly

Frame coverage. empty_frame_policy defaults to "annotated", which streams only the frames carrying annotations. ByteTrack then sees temporal gaps and track quality drops, so prefer "all" where the dataset has an exact frame count:

dataset = load_mot("/data/MOT17", dataset_format="motchallenge").with_mot_options(
    empty_frame_policy="all"
)

An exact count comes from seqinfo.ini's seqLength (or a frame-file count) for MOTChallenge, a frame-file count for VisDrone — taken even with the default probe_images=False — and a gap-free frame table for TAO. probe_images=True only fills in frame width and height; it is not what enables "all". Without an exact count, "all" logs a warning and falls back to annotated frames.

Frame timing. VisDrone annotations carry no frame rate, so the loader defaults to fps=0.0 and every frame reports time_s == 0.0. Pass fps= for real timestamps. ByteTrack associates detections by IoU, so tracking itself works either way.

Label spaces do not line up. A dataset's index2label comes from its own categories and is often sparse; a model's index2label is copied from the wrapped detector (the 91-entry COCO map for torchvision). Build the mapping explicitly before scoring predictions against ground truth — modelmaite does not remap labels for you.

Pair VisDrone data with the torchvision or ONNX detectors, not VisdroneODModel. The mot and visdrone extras are mutually exclusive (see above), so ByteTrack and the VisDrone detector cannot share an environment.

Authors and acknowledgment

This project was created for CDAO JATIC and is maintained by OpenTeams with collaborative community support.

CDAO Funding Acknowledgment

This material is based upon work supported by the Chief Digital and Artificial Intelligence Office under Contract No. W519TC-25-9-2041. The views and conclusions contained herein are those of the author(s) and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied, of the U.S. Government.

Metadata

Release files for modelmaite 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for modelmaite 0.2.0
File Size Uploaded
modelmaite-0.2.0.tar.gz 234.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for modelmaite 0.2.0
File Interpreter ABI Platform
modelmaite-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 264.6 kB

Release files / modelmaite-0.2.0.tar.gz

Download URL modelmaite-0.2.0.tar.gz
Size 234.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b41db861509e2b93c1b137c4cceb4a5941a136a125d2ed4ea103932c9905ad62
BLAKE2b-256 checksum
How to use checksums
428b7bab4542441a5c048d431343db96e77492c082f3c83242e5bafa40f61357
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / modelmaite-0.2.0-py3-none-any.whl

Download URL modelmaite-0.2.0-py3-none-any.whl
Size 30.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2e9e4f0df371463f10f9063b91051278fb87e956d5e79b273f8e17bab3175792
BLAKE2b-256 checksum
How to use checksums
dff57db7a6be17f8e442766ca456717a1b1dd0c321ced6d5b75e08a9f3d5cab6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page