This folder is a laptop-native Python rewrite of the original TI edgeai-tiovx-apps object-detection flow.
It keeps the high-level application behavior:
- read frames from a camera
- run an object detection model
- draw labels and bounding boxes
- display the annotated result
- optionally save the annotated video
It removes the TI board dependencies. See TI_DEPENDENCIES_REMOVED.md.
edgeai-app-python/
├── app.py
├── apps/
│ └── src/
│ ├── app_runtime.py
│ ├── deep_learning_block.py
│ ├── input_block.py
│ ├── misc.py
│ ├── output_block.py
│ └── resize_block.py
├── assets/
│ └── app-screenshot.png
├── configs/
│ └── linux/
│ └── object_detection.yaml
├── models/
├── modules/
│ ├── mosaic.py
│ └── video_sources.py
├── ORIGINAL_TO_PYTHON_MAPPING.md
├── outputs/
├── requirements.txt
├── scripts/
├── src/
├── utils/
└── TI_DEPENDENCIES_REMOVED.md
From this folder:
sudo apt update
sudo apt install -y python3-tk
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txtThe original TI edgeai-tiovx-apps CMake build compiles C/C++ sources and creates a runnable binary such as:
bin/Release/edgeai-tiovx-apps-main
This Python rewrite does not need compilation, but its CMake build stages a runnable launcher in the same style:
bin/Release/edgeai-app-python-main
Install packaging tools:
sudo apt update
sudo apt install -y cmake build-essentialConfigure and build:
cmake -S . -B build
cmake --build buildRun it like the original TI app:
./bin/Release/edgeai-app-python-main configs/linux/object_detection.yamlInstall it with CMake:
sudo cmake --install buildThis installs the application files to:
<install-prefix>/share/edgeai-app-python
and installs command-line launchers to:
<install-prefix>/bin/edgeai-app-python
<install-prefix>/bin/edgeai-app-python-main
Run after CMake install:
edgeai-app-python-main configs/linux/object_detection.yamlThe original TI edgeai-tiovx-apps CMake files install binaries and libraries, but this repo does not appear to include CPack or .deb package generation. This Python rewrite keeps the TI-style build above and also adds CMake/CPack support for creating a local Ubuntu .deb.
Build the package:
cmake -S . -B build
cmake --build build --target packageThe .deb will be created under build/, for example:
build/edgeai-app-python_1.0.0_all.deb
Install it:
sudo apt install ./build/edgeai-app-python_1.0.0_all.debThe package installs the app to:
/usr/share/edgeai-app-python
and installs this launcher:
/usr/bin/edgeai-app-python
/usr/bin/edgeai-app-python-main
Install the Python runtime dependencies after installing the package:
cd /usr/share/edgeai-app-python
sudo python3 -m venv .venv
sudo .venv/bin/pip install --upgrade pip
sudo .venv/bin/pip install -r requirements.txtRun the installed app:
edgeai-app-pythonOr pass an explicit config/model:
edgeai-app-python configs/linux/object_detection.yaml --model /path/to/weights.ptWhen running the installed .deb launcher, pass an absolute path for models that live outside the installed app directory:
edgeai-app-python configs/linux/object_detection.yaml --model /home/user/models/model.onnxUninstall:
sudo apt remove edgeai-app-pythonThe default model is configured in configs/linux/object_detection.yaml:
models:
model0:
model_path: yolov8n.ptBy default, it uses:
yolov8n.pt
Ultralytics downloads this model automatically on first run. The app automatically selects the inference engine by model extension:
.pt: Ultralytics/PyTorch.onnxor.onnc: ONNXRuntime
To use your own weights, pass the path manually:
python app.py configs/linux/object_detection.yaml --model /path/to/weights.pt
python app.py configs/linux/object_detection.yaml --model /path/to/model.onnxOr make it the default by changing models.model0.model_path in configs/linux/object_detection.yaml:
models:
model0:
model_path: models/my_model.onnxFor ONNX models with custom classes, add labels to the model block in the YAML:
class_names: [person, bicycle, car]python app.py configs/linux/object_detection.yamlUseful options:
python app.py configs/linux/object_detection.yaml --camera 0
python app.py configs/linux/object_detection.yaml --model /path/to/weights.pt
python app.py configs/linux/object_detection.yaml --max-frames 300
./scripts/run_object_detection.sh --model /path/to/weights.ptPress q or Esc in the display window to stop.
The Python display now mirrors the original Linux object-detection output as closely as possible on a laptop:
- black 1920x1080 mosaic canvas
- red
EDGEAI TIOVX APPSheading at top-left - green flow title below it
- object-detection video placed at
[320, 150, 1280, 720] - bottom performance overlay
- desktop window transport instead of TI KMS/DRM
This app uses a Tkinter display window instead of cv2.imshow, so OpenCV's Qt backend is not used during normal display. If you still see old Qt warnings, make sure you are running the updated app.py and reinstall the updated requirements:
pip install -r requirements.txtIf you choose to add OpenCV Qt display code later, install the common Qt/X11 and font packages:
sudo apt install -y fonts-dejavu-core fontconfig libxcb-xinerama0 libxcb-cursor0- This is not linked against TI libraries and does not require a TI board.
- CPU inference will run, but a laptop GPU will usually be much faster.
- If the webcam cannot open, try
--camera 1or close other apps that may be using the camera.
