Command line tool to do extract, transform, load and download operations on AI data for a number of projects at MBARI that require detection, clustering or classification workflows.
pip install mbari-aidata==1.81.0 Copy PIP instructions
A command line tool to do extract, transform, load (ETL) and download operations on AI data for a number of projects at MBARI that require detection, clustering or classification workflows. This tool is designed to work with Tator, a web based platform for video and image annotation and data management and Redis queues for ingesting data from real-time workflows.
More documentation and examples are available at https://docs.mbari.org/internal/ai/data.
pip install mbari-aidata Create the .env file with the following contents in the root directory of the project:
TATOR_TOKEN=your_api_token REDIS_PASSWORD=your_redis_password ENVIRONMENT=testing or production Create a configuration file in the root directory of the project:
touch config_cfe.yaml Or, use the project specific configuration from our docs server at https://docs.mbari.org/internal/ai/projects/
This file will be used to configure the project data, such as mounts, plugins, and database connections.
aidata download --version Baseline --labels "Diatoms, Copepods" --config https://docs.mbari.org/internal/ai/projects/uav-901902/config_uav.yml ⚙️Example configuration file:
# config_cfe.yml # Config file for CFE project production mounts: - name: "image" path: "/mnt/CFElab" host: "https://mantis.shore.mbari.org" nginx_root: "/CFElab" - name: "video" path: "/mnt/CFElab" host: "https://mantis.shore.mbari.org" nginx_root: "/CFElab" plugins: - name: "extractor" module: "mbari_aidata.plugins.extractors.tap_cfe_media" function: "extract_media" redis: host: "doris.shore.mbari.org" port: 6382 vss: project: "902111-CFE" model: "google/vit-base-patch16-224" tator: project: "902111-CFE" host: "https://mantis.shore.mbari.org" image: attributes: iso_datetime: #<-------Required for images type: datetime depth: type: float video: attributes: iso_start_datetime: #<-------Required for videos type: datetime box: attributes: Label: type: string score: type: float cluster: type: string saliency: type: float area: type: int exemplar: type: bool tdwa_box: #<-------Optional for video track loads attributes: Label: type: string score: type: float verified: type: bool similarity_score: type: float track_state: #<-------Optional for video track loads attributes: Label: type: string max_score: type: float num_frames: type: int verified: type: bool Track Format Tracks are video frames with a label and score for each detected object in the frame, along with a tracker_id to link detections across frames into tracks.
Track data is stored in a compressed .tar.gz file with the -tracks.tar.gz, e.g.
aidata load tracks --input video-tracks/tracks.tar.gz --dry-run --config config_cfe.yml video-tracks/tracks.tar.gz. This compressed file contains a structure like:
The detections.csv file contains the detections for each frame, e.g.
Metadata about video is in the metadata.json file, e.g.
{ "video_name": "video.mp4", "video_path": "/data/input/video.mp4", "processed_at": "2025-11-15T13:37:35.997007Z", "total_frames": 12000, "video_width": 1920, "video_height": 1080, "video_fps": 10, "total_detections": 3000, "unique_tracks": 148, "detection_threshold": 0.15, "min_track_frames": 5, "slice_size": 800, "rfdetr_model": "/mnt/models/best/checkpoint_best_total.pth" } The tracks.csv file contains the tracks for each frame, e.g.
A docker version is also available at mbari/aidata:latest or mbari/aidata:latest:cuda-124. For example, to download data from version Baseline using the docker image:
docker run -it --rm -v $(pwd):/mnt mbari/aidata:latest aidata download --version Baseline --labels "Diatoms, Copepods" --config config_cfe.yml to download multiple versions
See the Development Guide for more information on how to set up the development environment or the justfile
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
None of the files in this release were uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.




