# Field Demonstration of MarineSitu's Marine Energy Monitoring Tools - Project Artifacts

This repository holds the public data and software for the TEAMER project "Field Demonstration of MarineSitu's Marine Energy Monitoring Tools" (RFTS 11), a four-month deployment at the Pacific Northwest National Laboratory Marine and Coastal Research Laboratory in Sequim, WA.

It contains sample imagery paired with the detections recorded for it during the deployment, the trained detection models and their validation data, tools to reproduce the performance analysis and to review the imagery, and the project's post-access report.

## Contents

1. model_validation/
   Contains scripts for calculating performance metrics (Precision, Recall, mAP) and analyzing false positive rates for optical and acoustic models.
   - **Dependencies:** Ultralytics (YOLOv8), Polars, Pandas

2. data_viewer/
   Contains a playback utility for reviewing synchronized instrument data and verifying object detection predictions visually.
   - **Dependencies:** OpenCV, NumPy

3. sample_data/
   A representative selection of verified detections from the MCRL pier deployment, organized by subject: fish, crab, a bird on two cameras, and seals on imaging sonar. Twelve windows across July, August, and October 2024, each reviewed before inclusion. Structured to work directly with the data_viewer tool.
   - **Size:** ~44 MB, 924 frames

4. Post-access report
   The project's public post-access report, provided as a separate document rather than an archive. It covers the deployment, the model development workflow, and the performance results the model_validation tools reproduce.

## Setup

Download all three archives and extract them into the same directory, so that
they sit alongside each other:

```text
your-folder/
├── data_viewer/
├── model_validation/
└── sample_data/
```

The commands below assume that layout, and the sample data paths will not
resolve without it. Python 3.10 or newer is required. Each directory contains
its own README with fuller instructions.

## Getting Started

Each tool is independent to keep dependencies lightweight.

### Validate models

```bash
cd model_validation
./setup.sh
source .venv/bin/activate
python model_validation.py --help
```

### Set up the viewer

```bash
cd data_viewer
./setup.sh
source .venv/bin/activate
python data_viewer.py --help
```

### View the sample data

With the viewer environment active:

```bash
# Fish detections
python data_viewer.py --path "../sample_data/fish/" --start "2024-08-22 19:00:00" --end "2024-08-22 19:10:00" --instrument Camera1

# Crabs on the seabed
python data_viewer.py --path "../sample_data/crab/" --start "2024-08-21 05:50:00" --end "2024-08-21 05:59:55" --instrument Camera1

# Seals on imaging sonar
python data_viewer.py --path "../sample_data/seal_sonar/" --start "2024-08-02 08:00:13" --end "2024-08-02 08:05:22" --instrument Gemini1Polar

# A bird on two cameras at once
python data_viewer.py --path "../sample_data/bird/" --start "2024-07-21 00:19:00" --end "2024-07-21 00:19:10" --instrument Camera1 Camera2 --min_confidence 0.5
```

`sample_data/README.md` lists every window and explains how to read the labels.

## License

Software developed in this repository is licensed under **AGPL-3.0**.

Models evaluated in `model_validation` were developed using MarineSitu's commercial license with Ultralytics.

## Contact

MarineSitu, Inc.
www.marinesitu.com