Compare commits

...

7 Commits

Author SHA1 Message Date
Andrew Leech
5c28d513cd
Merge b214c54c07 into 7cbdb927da 2025-10-19 16:19:36 +04:00
Ibrahim Abdelkader
7cbdb927da
Merge pull request #2873 from kwagyeman/kwabena/add_yolo_lc
Some checks failed
🔥 Firmware Build / build-firmware (false, 0, false, DOCKER) (push) Has been cancelled
🔥 Firmware Build / build-firmware (false, 0, true, MPS2_AN500) (push) Has been cancelled
🔥 Firmware Build / build-firmware (false, 0, true, MPS3_AN547) (push) Has been cancelled
🔥 Firmware Build / build-firmware (false, 1, false, OPENMV_N6) (push) Has been cancelled
🔥 Firmware Build / build-firmware (true, 0, false, ARDUINO_GIGA) (push) Has been cancelled
🔥 Firmware Build / build-firmware (true, 0, false, ARDUINO_NANO_33_BLE_SENSE) (push) Has been cancelled
🔥 Firmware Build / build-firmware (true, 0, false, ARDUINO_NANO_RP2040_CONNECT) (push) Has been cancelled
🔥 Firmware Build / build-firmware (true, 0, false, ARDUINO_NICLA_VISION) (push) Has been cancelled
🔥 Firmware Build / build-firmware (true, 0, false, ARDUINO_PORTENTA_H7) (push) Has been cancelled
🔥 Firmware Build / build-firmware (true, 0, false, OPENMV2) (push) Has been cancelled
🔥 Firmware Build / build-firmware (true, 0, false, OPENMV3) (push) Has been cancelled
🔥 Firmware Build / build-firmware (true, 0, false, OPENMV4) (push) Has been cancelled
🔥 Firmware Build / build-firmware (true, 0, false, OPENMV4P) (push) Has been cancelled
🔥 Firmware Build / build-firmware (true, 0, false, OPENMVPT) (push) Has been cancelled
🔥 Firmware Build / build-firmware (true, 0, false, OPENMV_AE3) (push) Has been cancelled
🔥 Firmware Build / build-firmware (true, 0, false, OPENMV_N6) (push) Has been cancelled
🔥 Firmware Build / build-firmware (true, 0, false, OPENMV_RT1060) (push) Has been cancelled
🔥 Firmware Build / code-size-report (push) Has been cancelled
🔥 Firmware Build / stable-release (push) Has been cancelled
🔥 Firmware Build / development-release (push) Has been cancelled
scripts/examples: Add YOLO LC person tracking example.
2025-10-19 12:09:14 +03:00
Ibrahim Abdelkader
5ae4a02d41
Merge pull request #2889 from openmv/dependabot/github_actions/softprops/action-gh-release-2.4.1
build(deps): bump softprops/action-gh-release from 2.3.3 to 2.4.1
2025-10-19 12:05:39 +03:00
Kwabena W. Agyeman
3e22e0ea03 scripts/examples: Add YOLO LC person tracking example. 2025-10-18 21:29:43 -07:00
Kwabena W. Agyeman
30f499ea2d boards: Add YOLO LC model. 2025-10-18 21:27:14 -07:00
Andrew Leech
b214c54c07 docker: Add git worktree support. 2025-10-16 13:55:00 +11:00
dependabot[bot]
cdb0d91d74
build(deps): bump softprops/action-gh-release from 2.3.3 to 2.4.1
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.3.3 to 2.4.1.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](6cbd405e2c...6da8fa9354)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: 2.4.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-13 15:35:54 +00:00
15 changed files with 136 additions and 11 deletions

View File

@ -223,7 +223,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: '🔥 Create stable release'
uses: softprops/action-gh-release@6cbd405e2c4e67a21c47fa9e383d020e4e28b836
uses: softprops/action-gh-release@6da8fa9354ddfdc4aeace5fc48d7f679b5214090
with:
draft: true
files: firmware_*.zip
@ -275,7 +275,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: '🔥 Create development release'
uses: softprops/action-gh-release@6cbd405e2c4e67a21c47fa9e383d020e4e28b836
uses: softprops/action-gh-release@6da8fa9354ddfdc4aeace5fc48d7f679b5214090
with:
draft: false
name: Development Release

View File

@ -38,6 +38,12 @@
"alignment": 16,
"optimize": "Performance"
},
{
"type": "tflite",
"path": "{TOP}/lib/models/yolo_lc_192.tflite",
"alignment": 16,
"optimize": "Performance"
},
{
"type": "tflite",
"path": "{TOP}/lib/models/blazeface_front_128.tflite",

View File

@ -32,6 +32,12 @@
"alignment": 16,
"optimize": "Performance"
},
{
"type": "tflite",
"path": "{TOP}/lib/models/yolo_lc_192.tflite",
"alignment": 16,
"optimize": "Performance"
},
{
"type": "tflite",
"path": "{TOP}/lib/models/blazeface_front_128.tflite",

View File

@ -38,6 +38,12 @@
"alignment": 16,
"optimize": "Performance"
},
{
"type": "tflite",
"path": "{TOP}/lib/models/yolo_lc_192.tflite",
"alignment": 16,
"optimize": "Performance"
},
{
"type": "tflite",
"path": "{TOP}/lib/models/blazeface_front_128.tflite",

View File

@ -38,6 +38,12 @@
"alignment": 16,
"optimize": "Performance"
},
{
"type": "tflite",
"path": "{TOP}/lib/models/yolo_lc_192.tflite",
"alignment": 16,
"optimize": "Performance"
},
{
"type": "tflite",
"path": "{TOP}/lib/models/blazeface_front_128.tflite",

View File

@ -38,6 +38,12 @@
"alignment": 16,
"optimize": "Performance"
},
{
"type": "tflite",
"path": "{TOP}/lib/models/yolo_lc_192.tflite",
"alignment": 16,
"optimize": "Performance"
},
{
"type": "tflite",
"path": "{TOP}/lib/models/blazeface_front_128.tflite",

View File

@ -20,6 +20,12 @@
"alignment": 16,
"optimize": "Performance"
},
{
"type": "tflite",
"path": "{TOP}/lib/models/yolo_lc_192.tflite",
"alignment": 16,
"optimize": "Performance"
},
{
"type": "tflite",
"path": "{TOP}/lib/models/yolo_v2_224_small.tflite",

View File

@ -8,6 +8,12 @@
"alignment": 32,
"profile": "default"
},
{
"type": "tflite",
"path": "{TOP}/lib/models/yolo_lc_192.tflite",
"alignment": 32,
"profile": "default"
},
{
"type": "tflite",
"path": "{TOP}/lib/models/yolo_v2_224_small.tflite",

View File

@ -38,6 +38,12 @@
"alignment": 16,
"optimize": "Performance"
},
{
"type": "tflite",
"path": "{TOP}/lib/models/yolo_lc_192.tflite",
"alignment": 16,
"optimize": "Performance"
},
{
"type": "tflite",
"path": "{TOP}/lib/models/blazeface_front_128.tflite",

View File

@ -29,10 +29,8 @@ ENV MAKE_URL="https://ftp.gnu.org/gnu/make/make-4.4.1.tar.gz"
RUN wget --no-check-certificate --user-agent="Mozilla/5.0" -O - ${MAKE_URL} | tar --strip-components=1 -xz -C /workspace/make
RUN cd /workspace/make && ./configure && make -j$(nproc)
# Set up directories
WORKDIR /workspace
COPY . .
# Permissive git permissions inside container
ENV HOME=/tmp
RUN git config --global --add safe.directory '*'
ENV PATH="/workspace/gcc/bin:/workspace/llvm/bin:/workspace/cmake/bin:/workspace/make:$PATH"

View File

@ -3,6 +3,27 @@ DOCKER_TAG = latest
CONTAINER_NAME = firmware-container
DOCKERFILE_PATH = Dockerfile
# Detect repository structure
REPO_ROOT := $(shell git rev-parse --show-toplevel)
GIT_DIR := $(shell realpath $$(git rev-parse --git-dir))
GIT_COMMON_DIR := $(shell realpath $$(git rev-parse --git-common-dir))
# Detect worktree: git-dir != git-common-dir
IS_WORKTREE := $(shell [ "$(GIT_DIR)" != "$(GIT_COMMON_DIR)" ] && echo "yes" || echo "no")
# Working directory inside container
WORKDIR = $(REPO_ROOT)
# Volume mounts: always mount repo at actual path
ifeq ($(IS_WORKTREE),yes)
# For worktrees, also mount the main repo (for .git references)
MAIN_REPO_PATH := $(shell dirname $(GIT_COMMON_DIR))
VOLUME_MOUNTS = -v $(MAIN_REPO_PATH)/.git:$(MAIN_REPO_PATH)/.git \
-v $(REPO_ROOT):$(WORKDIR)
else
VOLUME_MOUNTS = -v $(REPO_ROOT):$(WORKDIR)
endif
# Build the Docker image
build-image:
docker build \
@ -15,7 +36,8 @@ build-firmware: build-image
-e TARGET=$(TARGET) \
-e HOST_UID=$(shell id -u) \
-e HOST_GID=$(shell id -g) \
-v $(PWD)/build:/workspace/build \
-w $(WORKDIR) \
$(VOLUME_MOUNTS) \
--name $(CONTAINER_NAME) \
$(DOCKER_IMAGE_NAME):$(DOCKER_TAG) docker/build.sh
@ -23,7 +45,18 @@ build-firmware: build-image
shell:
docker run --rm -it \
-e shell="true" \
-v $(PWD)/build:/workspace/build \
-w $(WORKDIR) \
$(VOLUME_MOUNTS) \
$(DOCKER_IMAGE_NAME):$(DOCKER_TAG) bash
# Debug target to show detected paths
debug-paths:
@echo "IS_WORKTREE: $(IS_WORKTREE)"
@echo "REPO_ROOT: $(REPO_ROOT)"
@echo "GIT_DIR: $(GIT_DIR)"
@echo "GIT_COMMON_DIR: $(GIT_COMMON_DIR)"
@echo "MAIN_REPO_PATH: $(MAIN_REPO_PATH)"
@echo "WORKDIR: $(WORKDIR)"
@echo "VOLUME_MOUNTS: $(VOLUME_MOUNTS)"
.DEFAULT_GOAL := build-firmware

View File

@ -1,7 +1,8 @@
#!/bin/bash
set -e -x
BUILD_DIR=/workspace/build/${TARGET}
OPENMV="$(pwd)"
BUILD_DIR=${OPENMV}/build/${TARGET}
# Update submodules.
git submodule update --init --depth=1
@ -13,4 +14,4 @@ make -j$(nproc) -C lib/micropython/mpy-cross
make -j$(nproc) BUILD=${BUILD_DIR} TARGET=${TARGET} LLVM_PATH=/workspace/llvm/bin
# Fix permissions.
chown -R ${HOST_UID:-1000}:${HOST_GID:-1000} /workspace/build
chown -R ${HOST_UID:-1000}:${HOST_GID:-1000} ${OPENMV}/build

Binary file not shown.

View File

@ -0,0 +1 @@
person

View File

@ -0,0 +1,44 @@
# This work is licensed under the MIT license.
# Copyright (c) 2013-2025 OpenMV LLC. All rights reserved.
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# TensorFlow Lite YOLO LC Person Detector Example
#
# YOLO LC is a variant of YOLOV2 that is fast enough to run on OpenMV Cams without NPUs.
import csi
import time
import ml
from ml.postprocessing.darknet import YoloLC
# Initialize the sensor.
csi0 = csi.CSI()
csi0.reset()
csi0.pixformat(csi.RGB565)
csi0.framesize(csi.VGA)
csi0.window((400, 400))
# Load built-in person detection model
model = ml.Model("/rom/yolo_lc_192.tflite", postprocess=YoloLC(threshold=0.4))
print(model)
# Visualization parameters.
n = len(model.labels)
model_class_colors = [(int(255 * i // n), int(255 * (n - i - 1) // n), 255) for i in range(n)]
clock = time.clock()
while True:
clock.tick()
img = csi0.snapshot()
# boxes is a list of list per class of ((x, y, w, h), score) tuples
boxes = model.predict([img])
# Draw bounding boxes around the detected objects
for i, class_detections in enumerate(boxes):
rects = [r for r, score in class_detections]
labels = [model.labels[i] for j in range(len(rects))]
colors = [model_class_colors[i] for j in range(len(rects))]
ml.utils.draw_predictions(img, rects, labels, colors, format=None)
print(clock.fps(), "fps")