Skip to main content

Tools for annotating and developing ML models for benthic imagery

Project description

CoralNet-Toolbox ๐Ÿชธ๐Ÿงฐ

CoralNet-Toolbox

python-version version pypi-passing windows macos ubuntu

๐Ÿ” Annotation

Create patches, rectangles, and polygons with AI assistance

๐Ÿง  AI-Powered

Leverage SAM, YOLOE, and various foundation models

๐Ÿš€ Complete Workflow

From data collection to model training and deployment

๐Ÿšฆ Quick Start

Running the following command will install the coralnet-toolbox, which you can then run from the command line:

# cmd

# Install
pip install coralnet-toolbox

# Run
coralnet-toolbox

๐Ÿ“š Guides

For further information and instructions, please see the following guides:

๐ŸŽฅ Watch the Video Demos

Video Title

โฉ TL;Dr

The CoralNet-Toolbox is an unofficial codebase that can be used to augment processes associated with those on CoralNet.

It usesโœจUltralytics๐Ÿš€ as a base, which is an open-source library for computer vision and deep learning built in PyTorch. For more information on their AGPL-3.0 license, see here.

๐Ÿš€ Supported Models

The toolbox integrates a variety of state-of-the-art models to help you create rectangle and polygon annotations efficiently. Below is a categorized overview of the supported models and frameworks:

Category Models
Trainable - ๐Ÿฆพ YOLOv3
- ๐Ÿฆˆ YOLOv4
- ๐Ÿฆ… YOLOv5
- ๐Ÿฌ YOLOv6
- ๐Ÿข YOLOv7
- ๐Ÿ™ YOLOv8
- ๐Ÿ  YOLOv9
- ๐Ÿฆ‘ YOLOv10
- ๐Ÿš€ YOLO11
- ๐Ÿณ YOLO12
Segment Anything - ๐Ÿชธ SAM
- ๐ŸŒŠ CoralSCOP
- โšก FastSAM
- ๐Ÿ” RepViT-SAM
- โœ‚๏ธ EdgeSAM
- ๐Ÿ“ฑ MobileSAM
Visual Prompting - ๐Ÿ‘๏ธ YOLOE
- ๐Ÿค– AutoDistill:
ย ย ย โ€ข ๐Ÿฆ’ Grounding DINO
ย ย ย โ€ข ๐Ÿฆ‰ OWLViT
ย ย ย โ€ข โšก OmDetTurbo

These models enable fast, accurate, and flexible annotation workflows for a wide range of use cases for patch-based image classification, object detection, instance segmentation.

๐Ÿ› ๏ธ Toolbox Features

Patch Annotation Tool
Patch Annotation
Rectangle Annotation Tool
Rectangle Annotation
Polygon Annotation Tool
(Multi) Polygon Annotation
Patch-based Image Classification
Image Classification
Object Detection
Object Detection
Instance Segmentation
Instance Segmentation
Segment Anything Model (SAM)
Segment Anything (SAM)
Polygon Classification
Polygon Classification
Region-based Detection
Region-based Detection
Cut
Cut
Combine
Combine
Simplify
Simplify
See Anything (YOLOE)
See Anything (YOLOE)
Patch-based LAI Classification
LAI Classification

Video Inference
Video Inference
Explorer
Explorer

Enhance your CoralNet experience with these tools:

  • ๐Ÿ“ฅ Download: Retrieve Source data (images and annotations) from CoralNet
  • ๐ŸŽฌ Rasters: Import images, or extract frames directly from video files
  • โœ๏ธ Annotate: Create annotations freely
  • ๐Ÿ‘๏ธ Visualize: See CoralNet and CPCe annotations superimposed on images
  • ๐Ÿ”ฌ Sample: Sample patches using various methods (Uniform, Random, Stratified)
  • ๐Ÿงฉ Patches: Create patches (points)
  • ๐Ÿ”ณ Rectangles: Create rectangles (bounding boxes)
  • ๐ŸŸฃ Polygons: Create polygons (instance masks)
    • ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ MultiPolygons: Combine multiple, non-overlapping polygons (i.e, genets)
  • โœ๏ธ Edit: Cut and Combine polygons and rectangles
  • ๐Ÿฆพ SAM: Use FastSAM, CoralSCOP, RepViT-SAM, EdgeSAM, MobileSAM, and SAM to create polygons
  • ๐Ÿ‘ทโ€โ™‚๏ธ Work areas: Perform region-specific detections / segmentations with any model
  • ๐Ÿ‘€ YOLOE (See Anything): Detect similar appearing objects using visual prompts automatically
  • ๐Ÿงช AutoDistill: Use AutoDistill to access the following for creating rectangles and polygons:
    • Uses Grounding DINO, OWLViT, OmDetTurbo
  • ๐Ÿ“ป Tune: Tune hyperparameters to identify ideal training conditions
  • ๐Ÿง  Train: Build local patch-based classifiers, object detection, and instance segmentation models
  • ๐Ÿง™โ€โ™‚๏ธ Deploy: Use trained models for predictions
  • ๐Ÿ“Š Evaluation: Evaluate model performance
  • ๐Ÿš€ Optimize: Productionize models for faster inferencing
  • โš™๏ธ Batch Inference: Perform predictions on multiple images, automatically
  • ๐ŸŽž๏ธ Video Inference: Perform predictions on a video in real-time, record the output and analytics
  • ๐Ÿ”ฎ Explorer: Cluster, view, and re-label annotations using embeddings, mapped from feature-space
  • โ†”๏ธ I/O: Import and Export annotations from / to CoralNet, Viscore, and TagLab
    • Export annotations as GeoJSONs, segmentation masks
  • ๐Ÿ“ธ YOLO: Import and Export YOLO datasets for machine learning
  • ๐Ÿงฑ Tile Dataset: Tile existing Detection / Segmentation datasets
  • ๐Ÿ—๏ธ Tile Inference: Pre-compute multiple work areas for an entire image

๐Ÿ“ TODO

๐Ÿ’พ How to Install

๐Ÿ Anaconda

It's recommended to use Anaconda to create an environment for the toolbox:

# cmd

# Create and activate an environment
conda create --name coralnet10 python=3.10 -y
conda activate coralnet10

๐Ÿ“ฆ Install

Once this has finished, install the toolbox using uv:

# cmd

# Install uv first
pip install uv

# Install with uv
uv pip install coralnet-toolbox

Although fast, uv is still relatively new; if this fails, simply fall back to using pip:

# cmd

# Install
pip install coralnet-toolbox

โšก CUDA

If you have CUDA, you should install the versions of cuda-nvcc and cudatoolkit that you need, and then install the corresponding versions of torch and torchvision. Below is an example of how that can be done using CUDA version 11.8:

# cmd

# Example for CUDA 11.8
conda install nvidia/label/cuda-11.8.0::cuda-nvcc -y
conda install nvidia/label/cuda-11.8.0::cuda-toolkit -y

# Example for torch w/ CUDA 11.8
uv pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118 --upgrade

If CUDA is installed on your computer, and torch was built with it properly, you should see a ๐Ÿ‡ icon in the toolbox instead of a ๐Ÿข; if you have multiple CUDA devices available, you should see a ๐Ÿš€ icon, and if you're using a Mac with Metal, you should see an ๐ŸŽ icon (click on the icon to see the device information).

See here for more details on versions for the following:

โ–ถ๏ธ Run

Finally, you can run the toolbox from the command line:

# cmd

# Run
coralnet-toolbox

How to Upgrade

When opening the toolbox, you will be notified if there is an update available, and you have the option to do so, if you so choose. To upgrade, run the following command from your terminal:

# cmd

uv pip install -U coralnet-toolbox==[enter_newest_version_here]

Again, fall back to using just pip and not uv if this fails.

๐ŸŒŠ Success Stories

Using the toolbox? Share your successes and we can feature your work to help others learn!

๐Ÿ  About CoralNet

Coral reefs are vital ecosystems that support a wide range of marine life and provide numerous benefits to humans. However, they are under threat due to climate change, pollution, overfishing, and other factors. CoralNet is a platform designed to aid researchers and scientists in studying these important ecosystems and their inhabitants.

CoralNet allows users to upload photos of coral reefs and annotate them with detailed information about the coral species and other features present in the images. The platform also provides tools for analyzing the annotated images, and create patch-based image classifiers.

The CoralNet-Toolbox is an unofficial tool developed to augment processes associated with analyses that use CoralNet and Coral Point Count (CPCe).

๐Ÿ Conclusion

In summary, this repository provides a range of tools that can assist with interacting with CoralNet and performing various tasks related to analyzing annotated images. These tools can be useful for researchers and scientists working with coral reefs, as well as for students and hobbyists interested in learning more about these important ecosystems.

๐Ÿ“ Citation

If used in project or publication, please attribute your use of this repository with the following:

@misc{CoralNet-Toolbox,
  author = {Pierce, Jordan and Edwards, Clinton and Rojano, Sarah and Cook, Sophie and Sweeney, Edward and Costa, Bryan and Vieham, Shay and Battista, Tim},
  title = {CoralNet-Toolbox},
  year = {2023},
  howpublished = {\url{https://github.com/Jordan-Pierce/CoralNet-Toolbox}},
  note = {GitHub repository}
}

โš ๏ธ Disclaimer

This repository is a scientific product and is not official communication of the National Oceanic and Atmospheric Administration, or the United States Department of Commerce. All NOAA GitHub project code is provided on an 'as is' basis and the user assumes responsibility for its use. Any claims against the Department of Commerce or Department of Commerce bureaus stemming from the use of this GitHub project will be governed by all applicable Federal law. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation or favoring by the Department of Commerce. The Department of Commerce seal and logo, or the seal and logo of a DOC bureau, shall not be used in any manner to imply endorsement of any commercial product or activity by DOC or the United States Government.

๐Ÿ“ License

Software code created by U.S. Government employees is not subject to copyright in the United States (17 U.S.C. ยง105). The United States/Department of Commerce reserve all rights to seek and obtain copyright protection in countries other than the United States for Software authored in its entirety by the Department of Commerce. To this end, the Department of Commerce hereby grants to Recipient a royalty-free, nonexclusive license to use, copy, and create derivative works of the Software outside of the United States.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coralnet_toolbox-0.0.71.tar.gz (496.3 kB view details)

Uploaded Source

Built Distribution

coralnet_toolbox-0.0.71-py2.py3-none-any.whl (563.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file coralnet_toolbox-0.0.71.tar.gz.

File metadata

  • Download URL: coralnet_toolbox-0.0.71.tar.gz
  • Upload date:
  • Size: 496.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for coralnet_toolbox-0.0.71.tar.gz
Algorithm Hash digest
SHA256 9726a8a771706a81436f1bbd95e2964153895c7f0fe2172a683948d439975338
MD5 da03ab67a98bd6898cf942ee206e9253
BLAKE2b-256 18c9e835a271692ef59991bd0b3b77f13cb7f9a6d390ee9834b46da7c30e3f10

See more details on using hashes here.

File details

Details for the file coralnet_toolbox-0.0.71-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for coralnet_toolbox-0.0.71-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4ad2ce6e5dc0e07edbda4518a6589c2eb7bdf74288ccc513ca4384d745a3ed37
MD5 24cd6247a9359e78c443946cedd5b436
BLAKE2b-256 801fc53204b52e9577f86500b92617faf6c784d319d20555cf08a6d12096dab1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page