Live dual-camera streaming from the ROV with YOLO-based crab detection for the 2026 MATE ROV Competition.
| Component | Device | Description |
|---|---|---|
rov/stream.py |
Raspberry Pi 4B / CM5 | Streams UC-684 cameras via RTP H264, serves Pi Camera stills over TCP |
topside/interface.py |
Topside laptop | PySide6 GUI with dual video feeds, YOLO26 crab detection, PS4 controller |
sudo apt install gstreamer1.0-tools gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \
gstreamer1.0-libav python3-dev
sudo pip3 install -r rov/requirements.txt --break-system-packagespicamera2 is pre-installed on Raspberry Pi OS - no additional install needed.
sudo python3 stream.py <topside_ip>Find your topside IP with ip addr show. Example: sudo python3 stream.py 192.168.2.1
Optional flags:
sudo python3 stream.py <topside_ip> --photo-port 5002When both UC-684s are connected, check their device nodes:
ls /dev/video*Then uncomment the t1 lines in stream.py and update the index if needed.
Python 3.12 is required. PyGObject's GStreamer bindings are broken on Python 3.14 (current Arch default). Use pyenv if your system Python is 3.14+:
pyenv install 3.12.9
pyenv local 3.12.9
python -m venv .venvOpen required ports before running - this is required even if UFW reports inactive:
sudo ufw allow 5000/udp # UC-684 camera 1
sudo ufw allow 5001/udp # UC-684 camera 2
sudo ufw allow 5002/tcp # Pi Camera stillsThe install script handles this automatically if UFW is active.
sudo apt install \
gstreamer1.0-tools gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \
gstreamer1.0-libav \
libgirepository-2.0-dev libcairo2-dev \
pkg-config python3-dev python3-gi python3-gst-1.0
pip install -r topside/requirements.txtOr use the install script:
bash topside/install_script.shsudo pacman -S gstreamer gst-plugins-good gst-plugins-bad \
gst-plugins-ugly gst-libav python-gobject gst-python pyenv
pyenv install 3.12.9
pyenv local 3.12.9
python -m venv .venv
source .venv/bin/activate.fish # Fish shell
# or: source .venv/bin/activate # Bash/Zsh
pip install -r topside/requirements.txtbrew install gstreamer gst-plugins-good gst-plugins-bad \
gst-plugins-ugly gst-libav gobject-introspection
pip install -r topside/requirements.txtNot recommended - PyGObject cannot be pip-installed on Windows. If required:
- Install GStreamer (MSVC 64-bit runtime + development)
- Add
C:\gstreamer\1.0\msvc_x86_64\binto your system PATH - Install Python 3.12
pip install PySide6 opencv-python numpy pygame ultralytics
Video streaming will not work without a separate PyGObject installation.
Activate your venv, place crab.pt in the topside/ folder, then:
source .venv/bin/activate.fish # Fish
# or: source .venv/bin/activate # Bash/Zsh
python interface.pyDetects European Green Crabs for MATE 2026 Task 2.1 (Mitigate Invasive Species). Only Green Crabs receive bounding boxes and are counted - Rock and Jonah crabs are intentionally excluded per competition rules.
To retrain the model:
# Export dataset from Roboflow as YOLOv8 format, extract to crab-dataset/
yolo detect train data=crab-dataset/data.yaml model=yolo26n.pt epochs=100 imgsz=640 device=0
cp runs/detect/train/weights/best.pt topside/crab.pt| Control | Action |
|---|---|
| 🦀 YOLO button | Toggle crab detection on/off |
| 🌊 Preprocess button | Toggle underwater color correction (red boost + CLAHE) |
| PS4 Circle (○) | Trigger Pi Camera Module 3 still capture |
| Capture Frame button | Save current video frame to disk |
Captured frames saved to topside/captured_frames/output_<timestamp>/.
| Component | Details |
|---|---|
| ROV computer | Raspberry Pi 4B (testing) / CM5 (competition) |
| Streaming cameras | Blue Robotics UC-684 × 2 (MJPEG, 1080p @ 30fps) |
| Photo camera | Raspberry Pi Camera Module 3 (12MP stills) |
| Controller | PS4 DualShock 4 |
| Tether | Gigabit ethernet tether → router |