A Python tool for detecting and catching the invasive Vespa velutina, while recognizing and not triggering on native Vespa crabro. Powered by the latest YOLO26 object detection model from Ultralytics.
Developed by Lab42 at ERNI (betterask.erni)
V2 Trap — Open interactive 3D viewer
V2 trap deployed in the field
Tracking a Vespa velutina
Tracking a Vespa crabro
Capturing a paper Vespa velutina with the V1 prototype trap
- Accurate distinction between Vespa velutina and Vespa crabro
- Automated or dry-run trap triggering
- Real-time detection from camera, image, video, or CSV files
Clone the repository and install dependencies:
git clone https://github.com/gitDew/waspinator.git
cd waspinator
python -m venv .venv
# Activate the virtual environment
#bash
source .venv/bin/activate
#windows
.\.venv\Scripts\Activate.ps1
#then install requirements
pip install -r requirements.txtIf you want to run Waspinator directly on a Raspberry Pi 5 (in your own 3D printed trap), follow these steps to set up your environment:
-
Install required system packages:
sudo apt update sudo apt install -y libgl1 libglib2.0-0 sudo apt install python3-picamera2
-
Make changes to config
sudo nano /boot/firmware/config.txt #add the following line to the file somewhere at the top dtoverlay=pwm-2chan #restart your device sudo reboot
-
Set up a Python virtual environment (recommended):
# Create virtual environment python -m venv .venv --system-site-packages # Activate the virtual environment source .venv/bin/activate
-
Install Python dependencies:
pip install --upgrade pip pip install -r requirements.txt
-
Run Setup to move servo to initial position
python -m waspinator setup
Once this ran, you can screw in the motor lever to the servo and make sure that the trap is in the OPEN state. After that you can mount the camera and close up the entire trap. it should be ready now.
The Pi Camera module is supported via python3-picamera2 so you can use the camera as a video source for wasp detection and trapping.
Make sure your camera is enabled and properly connected.
Once everything is installed, you can start Waspinator as described in the Usage section.
- Python 3.8+
- Ultralytics YOLO
- Other dependencies as per
requirements.txt
Run the main detection-and-capture script via command line:
Detect and catch invasive Vespa velutina from picamera2 (default):
python -m waspinator startFrom a video file:
python -m waspinator start --source path/to/video.mp4Image file:
python -m waspinator start --source path/to/image.jpgCSV file (for batch inference):
python -m waspinator start --source path/to/inputs.csv--dry-run: Do not trigger trap hardware (simulation mode)python -m waspinator start --dry-run
--show: Display real-time frames/resultspython -m waspinator start --show
--step: Manual stepping through frames (press SPACE to advance)
For all options:
python -m waspinator start --helpHardware & 3D Printing (by @DarioHefti)
Prototype 3D models for the waspinator trap are available in the hardware/ directory as .stl files. You can freely download and print these files to build your own trap housing.
- Stefan Bräm
- Stefan Hoehne
- Francesco Farinoli
- Dietmar Hummel (@hudi84)
- Dario Hefti (@DarioHefti)
- Krisztián Harmat (@gitDew)

