Skip to main content

No project description provided

Project description

Application Module Library

Application Module Library (modlib) is an SDK designed to simplify and streamline the process of creating end-to-end applications for the IMX500 vision sensor.

1. Quickstart

For the Raspberry Pi AI Camera, make sure that the python version of the virtual environment is the same as the system Python version. (Verify by running /usr/bin/python3 -V). This depends on your platform.

  • Raspberry Pi OS Bookworm: Python 3.11
  • Raspberry Pi OS Trixie: Python 3.13

We expect the Raspberry Pi computer to be installed correclty with the AiCamera connected and access to the board terminal. Ensure that your Raspberry Pi runs the latest software. A full setup guide can be found here.

One can use pip to install the library in your project Python environment.

pip install modlib

Create a new Python file named hello_world.py. and run the following code to see a camera preview.

from modlib.devices import AiCamera

device = AiCamera()

with device as stream:
    for frame in stream:
        frame.display()

2. Documentation

For a comprehensive guide on how to use the library, including detailed API documentation, tutorials, and examples, make sure to check out the documentation!

  1. Documentation site: Coming soon!
  2. Local Documentation: You can run a local documentation server using:
python -m http.server --directory ./docs

3. Development Environment Setup (Build from source)

Before getting started, ensure you have the following prerequisites installed on your system:

3.1 Prerequisites

3.1.1 UV

UV is the Python environment and package manager used for the project. Follow the installation instructions provided in the UV documentation to set it up. Verify your uv installation by running:

uv --version

3.1.2 Build environment dependencies

  • On Linux, install ninja using apt. And make sure to have a gcc compiler installed on your system: sudo apt install ninja-build
  • On Windows, install ninja using Chocolatey. And make sure to have an MSVC compiler installed on your system: choco install ninja

3.2 Hardware setup

3.2.1 Raspberry Pi AI Camera

We expect the Raspberry Pi computer to be installed correclty with the AiCamera connected and access to the board terminal. Ensure that your Raspberry Pi runs the latest software:

sudo apt update && sudo apt full-upgrade
sudo apt install imx500-all

Reboot if needed.

3.2.2 Triton® Smart (IMX501)

NOTE: It is possible to skip this step if you do not intend to use the Triton® Smart device. Be aware that any attempt to initialize the Triton® device will fail if you chose to skip the installation of the Arena SDK.

We recommend a PoE (IEEE 802.3af) setup where both the Triton® Smart camera and the host device are connected. [PC] --- [POE] --- [Triton® Camera] IPv4 should be set to Manual, Address: 169.254.0.1, Netmask: 255.255.0.0

System requirements (LUCID Arena compatible device as stated by the Arena SDK docs):

  • Linux: x64 - Ubuntu 22.04/24.04 (64-bit)
  • Linux: arm64 - Ubuntu 22.04/24.04 (64-bit)
  • Windows: amd64 - Windows 11 (64-bit) & Windows 10 (32/64-bit)

Install the Arena SDK (Linux x64 or ARM64 or Windows) Download from: https://thinklucid.com/downloads-hub/

  • Windows: Run the ArenaSDK installer for profile: Developer.
  • Linux: Unzip and make sure to make the libraries (.so) available. Example Linux x64 (but similar for aarch64):
tar -xvzf ArenaSDK_<sdk-version-number>_Linux_x64.tar.gz
cd /path/to/ArenaSDK_Linux
sudo sh Arena_SDK_Linux_x64.conf

3.3 Setup

uv sync

This will setup and build the project using the meson-python build system.

3.4 Running examples

As a basic example let's demonstrate the usage of the Raspberry Pi AiCamera device using a pre-trained SSDMobileNetV2FPNLite320x320 object detection model.

  1. Run any of the model examples from ./examples/aicam:
uv run examples/aicam/classifier.py
uv run examples/aicam/detector.py
uv run examples/aicam/segment.py
uv run examples/aicam/posenet.py

Note that the Application Module Library API allows you to create custom Models and combine any network.rpk with your own custom post_processing function. More information in Docs > getting_started > custom_models.md.

  1. Run any of the application examples ./examples/apps:
uv run examples/apps/tracker.py
uv run examples/apps/area.py
uv run examples/apps/heatmap.py

...

Extra

  • Unit-tests are included in the corresponding /tests folder and can be exectued by running: make test
  • Linting corrections and checks using ruff by running: make lint
  • Building the Python wheel. One can create a wheel file of the Application Module Library by running: make build The generated wheel file located in the /dist folder can be used to install the library in you project environment.

Releases

Release tags must be of the format "\d+.\d+.\d+" example "1.0.4".

License

LICENSE

Trademarks

Trademarks | Sony Semiconductor Solutions Group

Notice

Sony Semiconductor Solutions Corporation assumes no responsibility for applications created using this library. Use of the library is entirely at the user's own risk.

Security

Please read the Site Policy of GitHub and understand the usage conditions.

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.

modlib-1.3.1-cp313-cp313-win_amd64.whl (18.3 MB view details)

Uploaded CPython 3.13Windows x86-64

modlib-1.3.1-cp313-cp313-manylinux_2_35_x86_64.whl (31.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.35+ x86-64

modlib-1.3.1-cp313-cp313-manylinux_2_34_aarch64.manylinux_2_35_aarch64.whl (7.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ ARM64manylinux: glibc 2.35+ ARM64

modlib-1.3.1-cp312-cp312-win_amd64.whl (18.3 MB view details)

Uploaded CPython 3.12Windows x86-64

modlib-1.3.1-cp312-cp312-manylinux_2_35_x86_64.whl (31.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.35+ x86-64

modlib-1.3.1-cp312-cp312-manylinux_2_34_aarch64.manylinux_2_35_aarch64.whl (7.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ ARM64manylinux: glibc 2.35+ ARM64

modlib-1.3.1-cp311-cp311-win_amd64.whl (18.3 MB view details)

Uploaded CPython 3.11Windows x86-64

modlib-1.3.1-cp311-cp311-manylinux_2_35_x86_64.whl (31.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.35+ x86-64

modlib-1.3.1-cp311-cp311-manylinux_2_34_aarch64.manylinux_2_35_aarch64.whl (7.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ ARM64manylinux: glibc 2.35+ ARM64

File details

Details for the file modlib-1.3.1-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: modlib-1.3.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 18.3 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for modlib-1.3.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 fb3daf6db03548f6ffef35e728a4cb84ca3d8c9ad830246ff3f6c600bcc7b8e1
MD5 f4733cb6785cf3216a9399e838f86a7a
BLAKE2b-256 614128b6909c342e7db1c5af189d2b881ae818f0140ab7ca0f28de12a829a459

See more details on using hashes here.

File details

Details for the file modlib-1.3.1-cp313-cp313-manylinux_2_35_x86_64.whl.

File metadata

  • Download URL: modlib-1.3.1-cp313-cp313-manylinux_2_35_x86_64.whl
  • Upload date:
  • Size: 31.6 MB
  • Tags: CPython 3.13, manylinux: glibc 2.35+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for modlib-1.3.1-cp313-cp313-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 b5011537c50c2d1ebb360db4ca0f0096452b52e10edd5d3924aaf51be515eedf
MD5 31bde9da24ee93098902274dd837219a
BLAKE2b-256 b58f0d78754809a9a8fb81e44bb0d6d593e756370d0fa74cac558aa5a3a8d757

See more details on using hashes here.

File details

Details for the file modlib-1.3.1-cp313-cp313-manylinux_2_34_aarch64.manylinux_2_35_aarch64.whl.

File metadata

  • Download URL: modlib-1.3.1-cp313-cp313-manylinux_2_34_aarch64.manylinux_2_35_aarch64.whl
  • Upload date:
  • Size: 7.9 MB
  • Tags: CPython 3.13, manylinux: glibc 2.34+ ARM64, manylinux: glibc 2.35+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for modlib-1.3.1-cp313-cp313-manylinux_2_34_aarch64.manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 d2f8db57455be3d9a0ff506a7decb23cc7a0ec7afba503246377eb94ff8dee24
MD5 6b8720e8d440c2fedfe4912ddc326b2b
BLAKE2b-256 81a2416bd13769f56bc5e73b61f454af2c2cc515340c43a62d247fe99bce6278

See more details on using hashes here.

File details

Details for the file modlib-1.3.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: modlib-1.3.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 18.3 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for modlib-1.3.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7966fbc436e83998250ed101f4b41b1a4202c58b7215e68aa27f7c112be2dd13
MD5 3047c831f304174cf716f31e782089e3
BLAKE2b-256 f71e0ff41c22c5ead6164eed5cf9c3ff3a6408638f21001fe856cbe9c4d8ee11

See more details on using hashes here.

File details

Details for the file modlib-1.3.1-cp312-cp312-manylinux_2_35_x86_64.whl.

File metadata

  • Download URL: modlib-1.3.1-cp312-cp312-manylinux_2_35_x86_64.whl
  • Upload date:
  • Size: 31.6 MB
  • Tags: CPython 3.12, manylinux: glibc 2.35+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for modlib-1.3.1-cp312-cp312-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 8dfa0bfa11e4f8f9436fe337229546ac7e32351ba85ed8b121ee0f88a17fcd9c
MD5 5cf81274943b1a43ad9b84f1d110d93d
BLAKE2b-256 dddcbfcad796554b345e36d6bf7c5fab79fa79b45449b1c41319904ad24133b6

See more details on using hashes here.

File details

Details for the file modlib-1.3.1-cp312-cp312-manylinux_2_34_aarch64.manylinux_2_35_aarch64.whl.

File metadata

  • Download URL: modlib-1.3.1-cp312-cp312-manylinux_2_34_aarch64.manylinux_2_35_aarch64.whl
  • Upload date:
  • Size: 7.9 MB
  • Tags: CPython 3.12, manylinux: glibc 2.34+ ARM64, manylinux: glibc 2.35+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for modlib-1.3.1-cp312-cp312-manylinux_2_34_aarch64.manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 3f1500dbe205c7ca4ede7af1819b2c62d0f314c68ef2a0cca28e921a94163e0f
MD5 6cf67c4a1d349fd57bdafc2acb4b6b24
BLAKE2b-256 53b649d8d32ec0764a886a9929964724ef276bd35bd6d184ad5aba5ce4e4ff3c

See more details on using hashes here.

File details

Details for the file modlib-1.3.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: modlib-1.3.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 18.3 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for modlib-1.3.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a734a7021d94eab1385c455dcd2c03fd5e57dc0c36c180cc7e4de3bf8c97ff14
MD5 3e5db50290ac48a5ba1d4f341c40884a
BLAKE2b-256 96514ba7a00049951e988b059a010330fa5890ff0e42aa62cf77690f315849c9

See more details on using hashes here.

File details

Details for the file modlib-1.3.1-cp311-cp311-manylinux_2_35_x86_64.whl.

File metadata

  • Download URL: modlib-1.3.1-cp311-cp311-manylinux_2_35_x86_64.whl
  • Upload date:
  • Size: 31.6 MB
  • Tags: CPython 3.11, manylinux: glibc 2.35+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for modlib-1.3.1-cp311-cp311-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 dec3d11cd882b176ec16983b529912c98f12e763340d66f0297a4b590882a66d
MD5 6355ea1a571001b3aab0ba1ed508a1cd
BLAKE2b-256 f57908a5d64cc1b7e014c6e06ebe543c1c91ec6962d811e567a93ef585b44738

See more details on using hashes here.

File details

Details for the file modlib-1.3.1-cp311-cp311-manylinux_2_34_aarch64.manylinux_2_35_aarch64.whl.

File metadata

  • Download URL: modlib-1.3.1-cp311-cp311-manylinux_2_34_aarch64.manylinux_2_35_aarch64.whl
  • Upload date:
  • Size: 7.9 MB
  • Tags: CPython 3.11, manylinux: glibc 2.34+ ARM64, manylinux: glibc 2.35+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for modlib-1.3.1-cp311-cp311-manylinux_2_34_aarch64.manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 5fa3a22a911dc5c4e760e1e8b997d0247fca24c9458cee5cb8dac614109bd525
MD5 46f7365ff01ae84f690d970bef20791b
BLAKE2b-256 4ecc1ae92076da32fb5f2c4edd410fcd2bea96503d9edb5635a8cbb2f059602c

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