This program detects harmful animals such as bears and repels them by sending push notifications and playing sounds.
The program is similar to the standard AI detection program, but it has an additional feature that not only sends push notifications when detection occurs, but also repeatedly plays a pre-prepared WAV file for a specified duration.
AIBOX OS comes with a Docker Image that can run YOLO11 with NCNN by default.
REPOSITORY TAG SIZE
aicap/arm64/ultralytics 1.0.250923 3.43GB
This image is based on the YOLO11 image published by Ultralytics, with necessary modules for NCNN conversion and execution installed, as well as environment setup for running the aicap command. Basic detection programs using YOLO11 running on AIBOX OS can operate in containers launched from this image.
The bear repellent program requires audio output functionality in addition to YOLO object detection, so we will create an image based on the standard Docker image with additional modules installed for audio output.
However, registering a Docker image on AIBOX requires a few steps. Please refer to the following to build and register the audio-enabled image.
A script is also available that summarizes the build and registration steps for this Docker image.
You can use this script to register an audio output-compatible Docker image on AIBOX by following the steps below.
$ sudo ramdisk disable
$ wget https://raw.githubusercontent.com/daddyYukio/AICAPTURE/refs/heads/main/docker/audio/setup.sh
$ wget https://raw.githubusercontent.com/daddyYukio/AICAPTURE/refs/heads/main/docker/audio/Dockerfile
$ sudo ./setup.sh
$ sudo ramdisk enable
$ docker images
REPOSITORY TAG IMAGE ID
aicap/arm64/ultralytics 1.0.250923-audio xxxxx
aicap/arm64/ultralytics 1.0.250923 xxxxx
If TAG=1.0.250923-audio is registered, you're all set!
The basic file structure is the same as the standard AI detection program.
(The audio file alert.wav has been added)
However, the docker-compose.yml content has been modified to use the audio-enabled Docker image and includes additional parameters to grant the Docker container access to USB-connected sound output devices.
The files that have been changed or added from the standard AI detection program are as follows:
| File Name | Description |
|---|---|
| extmod.py | Python program that performs object detection |
| alert.wav | Sound file to play when detection occurs |
| docker-compose.yml | File containing Docker container configuration and settings |
A script is available to update these files.
Download update.zip published on GitHub below, extract it, and run update.sh to update all necessary files at once.
After updating, connect a USB sound output device to AIBOX and reboot.
By default, the detection object is set to bear, so try pointing the camera at a photo of a bear.
When detected, you will receive a push notification on your smartphone and an alert sound will play for 10 seconds.
The detection program explanation has been posted as an article on Zenn, so please refer to it there.
The method for changing detection objects and modifying detection accuracy is the same as the standard AI detection program.
The alert sound played when detection occurs is alert.wav, saved in the same location as the program file.
It is a short WAV format file that is played on repeat.
To change the sound, replace this alert.wav file.
※The format must be WAV.
The playback duration is defined in the following external variable:
# Playback duration (seconds)
WAV_PLAY_TIME_SEC = 10