Skip to main content

Camera-trap ML inference engine — Python API only (sparrow-engine CPU pipeline). The CLI binary (spe / spe-gpu) and HTTP server are NOT shipped via pip; install them via brew, the system installer (sparrow-engine-install.sh / .ps1), or the GitHub Release tarball. See https://github.com/microsoft/Pytorch-Wildlife/blob/sparrow-engine-dev/docs/user-manual.md

Project description

sparrow-engine (Python)

Camera-trap ML inference engine — Python API. sparrow-engine loads ONNX models and runs detection, classification, and audio inference.

This package ships the Python API only (import sparrow_engine). The command-line binaries (spe / spe-gpu) and the HTTP server are distributed separately (Homebrew, the system installer, or the GitHub Release tarball) — pip install does not place them on your PATH.

Install

pip install sparrow-engine        # CPU build (depends on onnxruntime)
pip install sparrow-engine-gpu    # GPU/CUDA build (depends on onnxruntime-gpu)

Both distributions import as sparrow_engine and are drop-in replacements for each other. Install exactly one per environment; pip refuses to install both into the same environment. Neither wheel bundles ONNX Runtime or CUDA — those come from the runtime dependency (onnxruntime / onnxruntime-gpu).

Usage

import sparrow_engine

# Models are read from ~/.sparrow-engine/models (override with
# SPARROW_ENGINE_MODEL_DIR). Device defaults to "auto".
print(sparrow_engine.list_models())

# Object detection — returns list[DetectResult], one per input image.
results = sparrow_engine.detect("photo.jpg", model="MDV6-yolov10-c")
for det in results[0].detections:
    # bbox coordinates are normalized to [0, 1].
    print(det.label, det.confidence, det.bbox.x_min, det.bbox.y_min)

# Classification — result.top1 is the highest-confidence class (or None).
clf = sparrow_engine.classify("crop.jpg", model="Deepfaune-Europe")
print(clf[0].top1)

# Detect-then-classify pipeline (ad-hoc; no TOML required).
pipe = sparrow_engine.pipeline("photo.jpg", detector="MDV6-yolov10-c",
                               classifier="Deepfaune-Europe")

# Audio detection (WAV input).
audio = sparrow_engine.detect_audio("recording.wav", model="md-audiobirds-v1")

init(device=..., model_dir=...) is optional — the engine auto-initializes on the first inference call. detect / classify / detect_audio / pipeline each accept a file path, a directory, or a list of paths, and take an optional progress_callback(index, total, filename).

Documentation

See the user manual (docs/user-manual.md) in the sparrow-engine repository for the full model catalog, device selection, and the CLI / server surfaces.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

sparrow_engine-0.1.18-cp311-abi3-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.11+Windows x86-64

sparrow_engine-0.1.18-cp311-abi3-manylinux_2_28_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ x86-64

sparrow_engine-0.1.18-cp311-abi3-macosx_11_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

File details

Details for the file sparrow_engine-0.1.18-cp311-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for sparrow_engine-0.1.18-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3d09749e632d12e4af9edd7f5ba004be331cf39aa2f158fbb87217977a6e058b
MD5 bb3a91164cb2c988e0d61e9b03f2fde9
BLAKE2b-256 768566f95546d0db96399a3234aec535d31e55a11474dc8394aaba63ad7595f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for sparrow_engine-0.1.18-cp311-abi3-win_amd64.whl:

Publisher: release.yml on microsoft/SPARROW-Engine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sparrow_engine-0.1.18-cp311-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for sparrow_engine-0.1.18-cp311-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1664105718d5d98d2d65de6cc006c58c6f2394e61118c0c074da182eacf11a9f
MD5 f4edebe153618d4d3454431390df8464
BLAKE2b-256 c9ddcb7f14dc6158ddb7ad02cc6f3acc7400a825cd0a85b898dc63ea34483d4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for sparrow_engine-0.1.18-cp311-abi3-manylinux_2_28_x86_64.whl:

Publisher: release.yml on microsoft/SPARROW-Engine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sparrow_engine-0.1.18-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sparrow_engine-0.1.18-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 67a2f972129232aa30f9e8621d84e4255e2ceee42fdac1e7a134bcb1714a6e4e
MD5 971fb8e52bdd44cd24d22a9acf4c938e
BLAKE2b-256 c081f53c51f15a7df0c5a932a2a4759b68c1842d7f25c8cad45b1ef1eaf36564

See more details on using hashes here.

Provenance

The following attestation bundles were made for sparrow_engine-0.1.18-cp311-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on microsoft/SPARROW-Engine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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