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.0-cp313-cp313-win_amd64.whl (18.3 MB view details)

Uploaded CPython 3.13Windows x86-64

modlib-1.3.0-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.0-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.0-cp312-cp312-win_amd64.whl (18.3 MB view details)

Uploaded CPython 3.12Windows x86-64

modlib-1.3.0-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.0-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.0-cp311-cp311-win_amd64.whl (18.3 MB view details)

Uploaded CPython 3.11Windows x86-64

modlib-1.3.0-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.0-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.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: modlib-1.3.0-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.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5fddbd8d2d7ae9bed2b91aa94fb537d9b832440047f938cf17118d23e393593b
MD5 c3b260e29419b2e0682eb3384a0a73c6
BLAKE2b-256 c02607216e7090fb465a30eb9a970d0be3cf8bae5dc467ad51ea517ea6ddb8e2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: modlib-1.3.0-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.0-cp313-cp313-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 9fce4ca9f1ab5cc3c0e0ab2ee5ab4407597beec5a0c6596525cbd0ca153d34c5
MD5 2e5691dcfc069581714c52dedbb2ec90
BLAKE2b-256 7e5d6ba0c6c3eac52ec677bcbbfd7ec5b4981274b6c97a1a557b1b71839a855f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: modlib-1.3.0-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.0-cp313-cp313-manylinux_2_34_aarch64.manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 1758f85b03ffdde7a297dee8a45ca1f1621f00fd4fa92ba3468607b7cbccad88
MD5 311bfafdf2060928e1f2e88c30300a6c
BLAKE2b-256 797b4e70c01f1bcd191befe237f9c2d27b8fc596d06ef932236515b708627a98

See more details on using hashes here.

File details

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

File metadata

  • Download URL: modlib-1.3.0-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.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 b29b17c602c2d4f35b77dcea11cda36bc70f691540e729c6aba21c34461131c0
MD5 6c2efadaaea9638683ee947abf2fb296
BLAKE2b-256 a7778bc50f5b1e0994e316aaf4e65ac0b307f43128e8b32b9529754c97d75079

See more details on using hashes here.

File details

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

File metadata

  • Download URL: modlib-1.3.0-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.0-cp312-cp312-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 2e64e7513996031be7dc88af3a00383310ffefd5b04398dcf077c801f2bdb175
MD5 a8692af6f1fb1b7dffa29f96331ff5d2
BLAKE2b-256 e0316aa741a48c1da73c02b7238370bfee942a0d862945b510063a5f85382da2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: modlib-1.3.0-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.0-cp312-cp312-manylinux_2_34_aarch64.manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 d92230b232943c1fceb9007fb7d7d5e8132145b39a5cf5e5ba6d9a4f3112d6fc
MD5 c46225390839d8106a852f268b228f44
BLAKE2b-256 73992dab6bc35f81e585ba630c02f1dd06855778648381377db33a53b210c921

See more details on using hashes here.

File details

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

File metadata

  • Download URL: modlib-1.3.0-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.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4fc1f5b78cbe22566a03df3fabb901db6431bf11393506de5153c1e3da6dcb7c
MD5 f309f7ef58e75822a2ceb2c655da1b26
BLAKE2b-256 25dd858795b40b9896102281a905b0ecc7d18788e3c8503e74f9e2b055a2f8a6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: modlib-1.3.0-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.0-cp311-cp311-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 179a5e4238f45bf93b55ba5389867502b01fb235eb10286aa3307c14c7df9724
MD5 9264b523857223a3cae52f2faba2fa11
BLAKE2b-256 717f94c8aa2aadef633f105bfecfe3e2ebd2bb642ba2f93777946627cf504279

See more details on using hashes here.

File details

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

File metadata

  • Download URL: modlib-1.3.0-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.0-cp311-cp311-manylinux_2_34_aarch64.manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 92bcb445a372314a70c2668753cde852d80863de967d3c33bbaf88c1d0cbc57f
MD5 25a218a150866b86d0d2e0eaba40cc5f
BLAKE2b-256 8d8a5c6cb0851d6b808e3c40473b42d7a4b9420c718d69216d39fb88538085b9

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