Skip to main content

Python bindings for SyNAP

Project description

SyNAP-Python-API

NPU accelerated inference with Python

Documentation python version license

Hardware   |   Models   |   Documentation


Overview

The SyNAP Python API provides Python bindings that closely mirror our SyNAP C++ API, enabling seamless integration for inference in Python. The Python bindings offer a straightforward yet flexible approach to deep learning workflows, allowing users to incorporate custom pre-processing and post-processing functionalities.

[!NOTE] SyNAP Python API serves as the primary interface for low-level access to SyNAP C++ Framework, enabling seamless integration for inference in Python.

[!TIP] For a rapid AI development experience, we recommend using SynapRT, which provides ready-to-use AI pipelines.

Available Modules and Classes

The SyNAP Python API provides access to the following classes and functions:

Core Module (synap)

  • Network
  • Tensors
  • Tensor

Preprocessing Module (synap.preprocess)

  • Preprocessor
  • InputData

Postprocessing Module (synap.postprocess)

  • Detector
  • Classifier
  • (Additional auxiliary helper classes)

Data Type Definitions (synap.types)

  • DataType
  • Dim2d
  • Landmark
  • Layout
  • Mask
  • Rect
  • Shape

Building the Python Wheel

Follow the steps below to set up your development environment and build the Python wheel. You can build this on a Linux machine, WSL2, or locally on the Astra board.

Prerequisites

Ensure you have necessary build dependencies installed:

Linux/WSL2

sudo apt update
sudo apt install python3.10 python3.10-venv python3.10-dev
sudo apt install -y build-essential cmake ninja-build

Astra

The python3-dev debian package for Astra is required. Install with:

wget https://synaptics-synap.github.io/examples-prebuilts/packages/python3-dev_3.10.13-r0_arm64.deb
dpkg -i python3-dev_3.10.13-r0_arm64.deb

Setup Virtual Environment

Create and activate a virtual environment to manage dependencies:

python3.10 -m venv venv
source venv/bin/activate

Build Package:

To build the Python wheel, just run:

./build.sh 

Use --verbose for detailed build steps and --clean for a clean build.

The build process generates a wheel file stored in the dist folder. The output should resemble the following:

Successfully built synap_python-0.9.0-cp310-cp310-manylinux_2_35_aarch64.whl
Building Python extensions ... Success!
Build completed successfully, wheel located at /home/../synap-python/dist/

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

synap_python-0.9.0.tar.gz (444.5 kB view details)

Uploaded Source

Built Distributions

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

synap_python-0.9.0-cp313-cp313-manylinux_2_35_aarch64.whl (423.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.35+ ARM64

synap_python-0.9.0-cp312-cp312-manylinux_2_35_aarch64.whl (424.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.35+ ARM64

synap_python-0.9.0-cp311-cp311-manylinux_2_35_aarch64.whl (423.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.35+ ARM64

synap_python-0.9.0-cp310-cp310-manylinux_2_35_aarch64.whl (422.9 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.35+ ARM64

File details

Details for the file synap_python-0.9.0.tar.gz.

File metadata

  • Download URL: synap_python-0.9.0.tar.gz
  • Upload date:
  • Size: 444.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for synap_python-0.9.0.tar.gz
Algorithm Hash digest
SHA256 793b73852628a7053c32202afb34c261a40434756406807ed9e0b28724777305
MD5 28daf2b05b6d248136b0fff817c57622
BLAKE2b-256 ad67968eb021710ae663c53834ec89711fb7136dec6cc4d937c0060058793332

See more details on using hashes here.

Provenance

The following attestation bundles were made for synap_python-0.9.0.tar.gz:

Publisher: pip-build-publish-pypi.yml on synaptics-synap/synap-python

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

File details

Details for the file synap_python-0.9.0-cp313-cp313-manylinux_2_35_aarch64.whl.

File metadata

File hashes

Hashes for synap_python-0.9.0-cp313-cp313-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 3da2357dcbd4404cee9af1106c18805689d5f4a4ee67ca7cd737728a8ac94f51
MD5 a2415b512310bfb710d1e2cb887875f5
BLAKE2b-256 0416b783c93afcde8a27508707eb1de0d6f80ff6a6999c780915a943618a306f

See more details on using hashes here.

Provenance

The following attestation bundles were made for synap_python-0.9.0-cp313-cp313-manylinux_2_35_aarch64.whl:

Publisher: pip-build-publish-pypi.yml on synaptics-synap/synap-python

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

File details

Details for the file synap_python-0.9.0-cp312-cp312-manylinux_2_35_aarch64.whl.

File metadata

File hashes

Hashes for synap_python-0.9.0-cp312-cp312-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 6f478fee9b32c14d75fa66ff5d13c3d3b17597c67ac78a186fa58344aad87627
MD5 64aaa1fc6c434399194df03ae081ad1e
BLAKE2b-256 f45e12dc0be20c4de6f5384ae51149a0ce0ed23690d3ca006d45749220a1cc59

See more details on using hashes here.

Provenance

The following attestation bundles were made for synap_python-0.9.0-cp312-cp312-manylinux_2_35_aarch64.whl:

Publisher: pip-build-publish-pypi.yml on synaptics-synap/synap-python

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

File details

Details for the file synap_python-0.9.0-cp311-cp311-manylinux_2_35_aarch64.whl.

File metadata

File hashes

Hashes for synap_python-0.9.0-cp311-cp311-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 042a79e1a05022b98cfa7e20a4220d2a349e5226b2bd7e5c040cb0fdb8ab8550
MD5 35154ebb3a250722213c0282423643a0
BLAKE2b-256 082dd6a0e8d11fb2205140cbfde71f5874e3c7dd8206ff553a2da29d27eb0893

See more details on using hashes here.

Provenance

The following attestation bundles were made for synap_python-0.9.0-cp311-cp311-manylinux_2_35_aarch64.whl:

Publisher: pip-build-publish-pypi.yml on synaptics-synap/synap-python

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

File details

Details for the file synap_python-0.9.0-cp310-cp310-manylinux_2_35_aarch64.whl.

File metadata

File hashes

Hashes for synap_python-0.9.0-cp310-cp310-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 d0035c910e9c5025d12da48921cbf8af2e176f432845867da05a6b9bb61d7888
MD5 6c975d03f1fe8be80a2148da9622b7ce
BLAKE2b-256 ef751a635faaf88c40bf2e97a27a0671b9a5fc4dd5fd262231249179ed90ae0f

See more details on using hashes here.

Provenance

The following attestation bundles were made for synap_python-0.9.0-cp310-cp310-manylinux_2_35_aarch64.whl:

Publisher: pip-build-publish-pypi.yml on synaptics-synap/synap-python

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