An edge-AI computer-vision prototype that recognizes correct and incorrect working posture.
TDA4VM Posture Enforcer explores a practical industrial computer-vision problem:
Can a camera continuously recognize whether a worker is using a machine with the expected posture and turn that recognition into a physical action?
The reference experiment focuses on repetitive leather-working operations involving hard pressing.
A USB camera observes the operator. An Edge Impulse FOMO object-detection model classifies the visible posture as:
ok
or:
notok
The model runs locally on a Texas Instruments SK-TDA4VM. A Python script parses the inference output and controls a relay through the board's GPIO header.
Worker
β
βΌ
USB webcam
β
βΌ
βββββββββββββββββββββββ
β Texas Instruments β
β SK-TDA4VM β
β β
β Edge Impulse Linux β
β FOMO model β
ββββββββββββ¬βββββββββββ
β
βββββββ΄ββββββ
βΌ βΌ
`ok` `notok`
β β
β βΌ
β posture1.py
β β
β βΌ
β GPIO 18
β β
β βΌ
β Relay
β
βΌ
Continue monitoring
The repository is a compact companion to the complete Edge Impulse Expert Network tutorial, where dataset creation, TDA4VM configuration, model training, deployment, GPIO setup, and relay integration are documented in detail.
- ποΈ Real-time camera-based posture recognition
- π§ Edge Impulse Machine Learning
- π― FOMO object detection
- β‘ Texas Instruments SK-TDA4VM
- π Hardware-accelerated edge inference
- π· Logitech USB webcam support
- π·οΈ Two posture labels:
okandnotok - π¦ Public Edge Impulse model
- π Python inference-output parser
- π GPIO-controlled relay
- π΄ Local inference without cloud video streaming
- π Bounding-box confidence output
Traditional programming works well when a condition can be expressed using clear rules.
For posture recognition, a rule such as:
if shoulder_x < 32
and head_y > 41
and arm_angle < 70:
posture = bad
would be brittle.
Real images vary because of:
- body proportions
- clothing
- lighting
- background
- camera position
- machine position
- movement
- partial occlusion
- different workers
Instead, the project trains a computer-vision model from examples.
Examples of correct posture
+
Examples of incorrect posture
β
βΌ
Edge Impulse
β
βΌ
FOMO model
β
βΌ
New camera image
β
ββββββ΄ββββββ
βΌ βΌ
`ok` `notok`
The original experiment was created around a leather-working process involving repeated manual pressing.
The task requires the operator to maintain a particular body position while repeatedly using a machine.
The project investigates whether computer vision can automate the observation step:
Supervisor demonstrates
expected posture
β
βΌ
Capture examples
β
βΌ
Train model
β
βΌ
Machine monitors
future operation
The project runs on the:
Texas Instruments SK-TDA4VM Starter Kit
The board is designed specifically for embedded computer vision and Edge AI.
Official information:
SK-TDA4VM β Texas Instruments
The underlying TDA4VM SoC includes:
- Dual 64-bit Arm Cortex-A72 up to 2 GHz
- C7x DSP
- Deep-learning matrix accelerator
- Up to 8 TOPS of 8-bit AI performance
- Vision-processing accelerators
- Depth and motion processing
- PowerVR GPU
- Multiple Arm Cortex-R5F cores
- Hardware video acceleration
Processor documentation:
The board provides considerably more vision-processing capability than a small microcontroller.
The project benefits from:
camera input
+
Linux
+
Python
+
Edge Impulse Linux Runner
+
TI deep-learning acceleration
+
GPIO
on the same platform.
The SK-TDA4VM also supports multiple camera interfaces, making multi-view posture analysis a possible extension.
The reference build uses:
| Qty | Component | Purpose |
|---|---|---|
| 1 | Texas Instruments SK-TDA4VM | Edge AI inference |
| 1 | Logitech C270, C920 or C922 USB webcam | Image acquisition |
| 1 | 1-channel relay module | Physical output |
| 1 | microSD card | TDA4VM Linux image |
| 1 | Ethernet cable | SSH / network access |
| 1 | 5 V / 3 A USB-C power supply | Board power |
The repository also includes:
TDA4VMGpioPinout.jpg
as a GPIO-header reference.
The documented setup supports conventional USB webcams such as:
Logitech C270
Logitech C920
Logitech C922
The camera should be positioned so that the relevant working posture remains visible during the complete task.
A fixed camera mount is strongly recommended.
Changes in:
camera angle
distance
height
field of view
can affect model behavior if those conditions were not represented in the training data.
The complete public Machine Learning project is available in Edge Impulse Studio:
Posture Detection β Public Edge Impulse Project
It can be cloned instead of rebuilding the model from scratch.
The reference dataset was intentionally small.
Approximately:
50 images β correct posture
50 images β incorrect posture
were collected.
Some images were discarded because they contained:
- only background
- non-representative machine states
- unsuitable frames
Each usable image was annotated with a bounding box.
Labels:
ok
notok
Although Edge Impulse can capture images directly from connected hardware, the reference dataset was collected using an Android phone.
The project used Open Camera because it supports:
repeated photos
+
configurable intervals
+
small image resolution
This allowed images to be collected at the actual workplace without moving the TDA4VM setup.
The Edge Impulse project uses:
Bounding Boxes
as the labeling method.
Each training image contains a box around the worker and one of two labels:
ok
or:
notok
Conceptually:
ββββββββββββββββββββββββββββββ
β β
β ββββββββββββ β
β β worker β β
β β β β
β ββββββββββββ β
β `ok` β
β β
ββββββββββββββββββββββββββββββ
or:
ββββββββββββββββββββββββββββββ
β β
β ββββββββββββββ β
β β worker β β
β β β β
β ββββββββββββββ β
β `notok` β
β β
ββββββββββββββββββββββββββββββ
The reference Edge Impulse impulse uses:
Image Data
β
βΌ
96 Γ 96 pixels
Resize: Fit shortest axis
β
βΌ
Image processing
β
βΌ
Object Detection
β
βΌ
FOMO
Training configuration:
Training cycles: 60
Learning rate: 0.001
Data augmentation: enabled
Model: FOMO
The project uses FOMO β Faster Objects, More Objects, Edge Impulse's lightweight object-detection architecture.
Instead of returning only:
image = bad posture
the model can return localized detections:
{
"height": 8,
"label": "notok",
"value": 0.71,
"width": 8,
"x": 64,
"y": 72
}The result includes:
| Field | Meaning |
|---|---|
label |
ok or notok |
value |
Detection confidence |
x |
Detection location |
y |
Detection location |
width |
Bounding-cell width |
height |
Bounding-cell height |
The original experiment reported:
F1 score: 71.4%
and:
Incorrect-posture detection rate: 100%
for the small reference dataset.
These values belong to that specific training run.
boundingBoxes 2ms. []
boundingBoxes 1ms. []
Example:
boundingBoxes 1ms.
[
{
"height": 8,
"label": "ok",
"value": 0.5057658553123474,
"width": 8,
"x": 48,
"y": 24
}
]
Example:
boundingBoxes 1ms.
[
{
"height": 8,
"label": "notok",
"value": 0.7100046873092651,
"width": 8,
"x": 64,
"y": 72
}
]
The runner continuously generates these detections from the USB camera stream.
A single-channel relay provides the physical-output portion of the experiment.
The documented GPIO is:
GPIO 18
The demonstration architecture is:
FOMO prediction
β
βΌ
posture1.py
β
βΌ
GPIO 18
β
βΌ
Relay
β
βΌ
External load / test machine
The relay converts the Machine Learning result into an observable physical action.
The SK-TDA4VM includes a:
40-pin
2 Γ 20
2.54 mm
expansion header.
It exposes interfaces including:
- GPIO
- IΒ²C
- SPI
- IΒ²S
- UART
- PWM
The interface signals use:
3.3 V logic
The repository includes:
as a practical pinout reference created during development.
Expansion-header GPIO was disabled by default in the Linux configuration used by the original project.
After initially obtaining no GPIO output, the solution was to modify:
/run/media/mmcblk0p1/uenv.txt
and add:
name_overlays=k3-j721e-edgeai-apps.dtbo k3-j721e-sk-rpi-exp-header.dtbo
After rebooting with that overlay, GPIO control became available.
This reflects the Processor SDK configuration used by the original project. Current Texas Instruments SDK releases may use different device-tree or overlay procedures, so check the documentation for the image you install.
The original GPIO test uses the Raspberry Pi-compatible GPIO interface:
import RPi.GPIO as GPIO
import time
output_pin = 18
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(output_pin, GPIO.OUT)
GPIO.output(output_pin, GPIO.HIGH)
time.sleep(3)
GPIO.output(output_pin, GPIO.LOW)This provides a simple hardware test before combining relay control with Machine Learning.
The repository's main source file is:
posture1.py
Its role is to bridge:
Machine Learning prediction
and:
GPIO action
The script parses the output produced by the Edge Impulse Linux Runner, identifies the posture label, and changes the relay state accordingly.
edge-impulse-linux-runner
β
βΌ
boundingBoxes output
β
βΌ
posture1.py
β
ββββββ΄βββββ
βΌ βΌ
`ok` `notok`
β β
βΌ βΌ
relay relay
state state
The important architectural point is that the inference model and the physical action remain separate components.
This makes it possible to replace the relay action with something else without retraining the model.
Instead of switching a relay, the same recognition event could trigger:
warning light
buzzer
screen message
industrial stack light
MQTT event
database log
Telegram message
supervisor notification
PLC input
The ML model answers:
What posture is visible?
while the application decides:
What should happen next?
The original build uses the Texas Instruments Processor SDK Linux image for the SK-TDA4VM.
Current official downloads:
Flash the provided:
.wic.xz
image to a microSD card.
The original tutorial used an older release than the current Texas Instruments SDK, so filenames, included packages, login defaults, and device-tree configuration may differ today.
The reference development workflow uses:
SK-TDA4VM
β
βΌ
Ethernet
β
βΌ
Router
β
βΌ
SSH / SFTP
Find the board's IP address through the router's DHCP-client list and connect over SSH.
The historical SDK used:
User: root
Password: empty
Do not assume current images use the same credentials.
If an image ships with permissive defaults, secure it before connecting the board to an untrusted network.
The reference setup installs the Linux tools with:
npm install -g --unsafe-perm edge-impulse-linuxThen launches the model with explicit TI acceleration:
edge-impulse-linux-runner \
--force-engine tidl \
--force-target runner-linux-aarch64-tda4vmOn the first run, authenticate with Edge Impulse and select the posture-detection project.
Once the Edge Impulse Linux Runner is active, the original setup exposes a camera-preview page on:
http://<TDA4VM-IP>:4912
For example:
http://192.168.1.50:4912
Use this preview to verify:
- worker visibility
- camera angle
- lighting
- framing
- model predictions
before relying on the parser.
Transfer:
posture1.py
to:
/opt/edge_ai_apps
using SFTP or another file-transfer method.
Then run:
cd /opt/edge_ai_apps
python3 posture1.pyThe script then connects the model output to the GPIO relay action.
tda4vmPostureEnforcer/
βββ LICENSE
βββ README.md
βββ TDA4VMGpioPinout.jpg
βββ posture1.py
Python glue code connecting Edge Impulse inference output to GPIO relay control.
Reference image for the SK-TDA4VM 40-pin expansion header.
Original repository description and Edge Impulse project link.
MIT License.
git clone https://github.com/ronibandini/tda4vmPostureEnforcer.git
cd tda4vmPostureEnforcerOpen:
and clone it into your own Edge Impulse account.
Download the current:
TI Processor SDK for SK-TDA4VM
and flash the .wic.xz image to a microSD card.
Attach a compatible USB camera such as:
Logitech C270
Logitech C920
Logitech C922
For the historical SDK configuration, add:
name_overlays=k3-j721e-edgeai-apps.dtbo k3-j721e-sk-rpi-exp-header.dtbo
to:
/run/media/mmcblk0p1/uenv.txt
Reboot the board.
Check the current TI SDK documentation before applying this to a newer image.
Test the relay output independently before introducing the model.
Do this with a harmless low-voltage test load first.
npm install -g --unsafe-perm edge-impulse-linuxedge-impulse-linux-runner \
--force-engine tidl \
--force-target runner-linux-aarch64-tda4vmVerify the model through:
http://<deviceIP>:4912
Copy:
posture1.py
to:
/opt/edge_ai_apps
and execute:
python3 posture1.pyTo create a model for another task or workplace:
1. Capture examples of accepted posture
2. Capture examples of unacceptable posture
3. Include different workers
4. Include realistic clothing
5. Include normal background variation
6. Label bounding boxes
7. Split train/test data
8. Train FOMO
9. Evaluate false positives
10. Evaluate false negatives
11. Deploy to TDA4VM
12. Validate using unseen workers
A production-quality system should use substantially more data than the reference proof of concept.
-
π· Multi-camera posture detection β combine front and side views using the TDA4VM's multi-camera capabilities to reduce ambiguity.
-
β±οΈ Temporal filtering β require several consecutive
notokdetections before generating an alert or control event, reducing reactions to single-frame false positives. -
π Event logging β save confidence, timestamps, posture duration, and machine state for later process analysis and model improvement.
Edge Impulse published a dedicated article by Nick Bild on July 3, 2023.
The feature covers:
- leather-work posture
- Texas Instruments SK-TDA4VM
- USB webcam
- approximately 50 good and 50 bad posture images
- bounding-box labeling
- Edge Impulse FOMO
- 71%+ F1 score
- local edge inference
- privacy advantages of on-device vision
- relay integration
- possible multi-camera extensions
Straightening Out Posture in the Workplace β Edge Impulse
The complete technical guide is part of the Edge Impulse Expert Network:
Correct Posture Detection and Enforcement β Texas Instruments TDA4VM
The guide documents the full workflow from TDA4VM setup through relay control.
The complete trained project is publicly cloneable:
Posture Detection β Edge Impulse Studio
The project is listed in the Edge Impulse Expert Network's Computer Vision Projects collection alongside other TDA4VM deployments.
Edge Impulse Expert Network project list
The project is also referenced in Wevolver's article on high-performance microprocessors for Edge AI computer vision.
It appears as an example of posture detection and immediate physical feedback running on a Texas Instruments vision platform.
More projects, technical experiments, embedded AI systems, unusual machines, and Maker Counterculture are collected in:
- Texas Instruments SK-TDA4VM
- Texas Instruments TDA4VM
- Processor SDK Linux for SK-TDA4VM
- Edge Impulse
- Public posture model
- Complete Edge Impulse tutorial
- FOMO object detection
- Open Camera
Other projects by Roni Bandini using Edge Impulse and Texas Instruments edge-AI hardware.
Real-time visual anomaly detection for industrial inspection using Edge Impulse FOMO-AD on the Texas Instruments SK-TDA4VM.
It uses the same hardware family for a different industrial computer-vision problem.
github.com/ronibandini/visualAnomaly
American Sign Language training system using Machine Learning and Texas Instruments edge-AI hardware.
Another project combining real-time computer vision with a physical learning/application workflow.
github.com/ronibandini/ASLTrainer
Real-time glass-break sound classification using Edge Impulse and GPIO output on the Thundercomm RUBIK Pi 3.
Like Posture Enforcer, it converts an Edge Impulse inference result into an immediate physical GPIO action.
github.com/ronibandini/Rubik-Pi-AudioClassification
The model is probabilistic.
Possible outcomes include:
bad posture classified as good
good posture classified as bad
no detection
multiple detections
A production system should therefore consider:
- confidence thresholds
- temporal filtering
- manual override
- event logging
- watchdogs
- fail-safe behavior
- independent safety mechanisms
TDA4VM Posture Enforcer is released under the MIT License.
See LICENSE for details.
Roni Bandini
Maker, AI developer, electronic artist and writer.
- π GitHub: @ronibandini
- πΌ LinkedIn: Roni Bandini
- πΈ Instagram: @ronibandini
- π¦ X: @RoniBandini
- βοΈ Medium: bandini.medium.com
- π οΈ Hackster: Roni Bandini
- π§ Hackaday.io: Roni Bandini
Buenos Aires, Argentina.