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.
The SyNAP Python API provides access to the following classes and functions:
NetworkTensorsTensor
PreprocessorInputData
DetectorClassifier- (Additional auxiliary helper classes)
DataTypeDim2dLandmarkLayoutMaskRectShape
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.
Ensure you have necessary build dependencies installed:
sudo apt update
sudo apt install python3.10 python3.10-venv python3.10-dev
sudo apt install -y build-essential cmake ninja-buildThe 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.debCreate and activate a virtual environment to manage dependencies:
python3.10 -m venv venv
source venv/bin/activateTo 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/