Skip to main content

YOLOv8 INT8 TFLite webcam inference for i.MX8MP (NPU / CPU)

Project description

yolov8-tflite-imx

YOLOv8 INT8 TFLite webcam inference for i.MX8MP (phyBOARD-Pollux).
Supports CPU and NPU acceleration via the VeriSilicon VX delegate.


Included models

Command Model task Default model path
detect Object detection (COCO) yolov8n_saved_model/yolov8n_full_integer_quant.tflite
pose Pose estimation yolov8n-pose_saved_model/yolov8n-pose_full_integer_quant.tflite
obb Oriented bounding box yolov8n-obb_saved_model/yolov8n-obb_full_integer_quant.tflite
segment Instance segmentation yolov8n-seg_saved_model/yolov8n-seg_full_integer_quant.tflite

Installation

On the i.MX8MP board (recommended)

# 1. Install tflite_runtime wheel for your Python / board combination
#    (download the correct .whl from https://github.com/google-coral/pycoral/releases
#     or build from source for your kernel)
pip install tflite_runtime-*.whl

# 2. Install this package
pip install yolov8-tflite-imx

From source (development)

git clone https://github.com/yourname/yolov8-tflite-imx.git
cd yolov8-tflite-imx
pip install -e .

Usage

Object detection

# CPU
detect --cam 0 --model path/to/yolov8n_full_integer_quant.tflite

# NPU (VX delegate)
detect --cam 0 --npu --model path/to/yolov8n_full_integer_quant.tflite

# Custom delegate path
detect --cam 0 --delegate /usr/lib/libvx_delegate.so --model path/to/model.tflite

Pose estimation

pose --cam 0                          # CPU
pose --cam 0 --npu                    # NPU

Oriented bounding box (OBB)

obb --cam 0                           # CPU
obb --cam 0 --npu                     # NPU

Instance segmentation

segment --cam 0                       # CPU
segment --cam 0 --npu                 # NPU

All flags (same for every command)

Flag Default Description
--model PATH see table above Path to .tflite model
--cam INT 0 Camera device ID
--conf FLOAT 0.25 Confidence threshold
--iou FLOAT 0.45 NMS IoU threshold
--npu off Enable NPU via /usr/lib/libvx_delegate.so
--delegate PATH None Custom delegate .so (overrides --npu)
--no-gst off Disable GStreamer, use V4L2 directly

Keys while running

Key Action
q or ESC Quit
s Save current frame as capture_<task>.jpg

Requirements

  • Python ≥ 3.8
  • tflite_runtime (installed separately for your board/arch)
  • opencv-python ≥ 4.5
  • numpy ≥ 1.21
  • NPU: /usr/lib/libvx_delegate.so present on the board

License

MIT

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 Distribution

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

yolov8_tflite_imx-1.0.7-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file yolov8_tflite_imx-1.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for yolov8_tflite_imx-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 0a2746799d86bdaab6f7c7c201d8472ab8fe97b9547a9e37673b60204c73de9e
MD5 45033e1f425fe00a647025d55c8050d3
BLAKE2b-256 b2ae56af7138d17f28964bc67ba31bf857ce04cc1f28408c4b51a414028fe267

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