# CoralNet-Toolbox
<div align="center">
<p>
<img src="https://raw.githubusercontent.com/Jordan-Pierce/CoralNet-Toolbox/refs/heads/main/figures/CoralNet_Toolbox.png" alt="CoralNet-Toolbox">
</p>
</div>
<div align="center">
[![python-version](https://img.shields.io/pypi/pyversions/CoralNet-Toolbox.svg)](https://pypi.org/project/CoralNet-Toolbox)
[![version](https://img.shields.io/pypi/v/CoralNet-Toolbox.svg)](https://pypi.python.org/pypi/CoralNet-Toolbox)
[![pypi-passing](https://github.com/Jordan-Pierce/CoralNet-Toolbox/actions/workflows/pypi.yml/badge.svg)](https://pypi.org/project/CoralNet-Toolbox)
[![windows](https://github.com/Jordan-Pierce/CoralNet-Toolbox/actions/workflows/windows.yml/badge.svg)](https://pypi.org/project/CoralNet-Toolbox)
[![macos](https://github.com/Jordan-Pierce/CoralNet-Toolbox/actions/workflows/macos.yml/badge.svg)](https://pypi.org/project/CoralNet-Toolbox)
[![ubuntu](https://github.com/Jordan-Pierce/CoralNet-Toolbox/actions/workflows/ubuntu.yml/badge.svg)](https://pypi.org/project/CoralNet-Toolbox)
</div>
## Quick Start
Running the following command will install the `coralnet-toolbox`, which you can then run from the command line:
```bash
# cmd
# Install
pip install coralnet-toolbox
# Run
coralnet-toolbox
```
For further instructions please see the following:
- [Installation](https://jordan-pierce.github.io/CoralNet-Toolbox/installation)
- [Usage](https://jordan-pierce.github.io/CoralNet-Toolbox/usage)
<details open>
<summary><h2><b>Watch the Video Demos</b></h2></summary>
<p align="center">
<a href="https://youtube.com/playlist?list=PLG5z9IbwhS5NQT3B2jrg3hxQgilDeZak9&feature=shared">
<img src="https://raw.githubusercontent.com/Jordan-Pierce/CoralNet-Toolbox/refs/heads/main/figures/toolbox_qt.PNG" alt="Video Title" width="75%">
</a>
</p>
</details>
## TL;Dr
The `CoralNet-Toolbox` is an unofficial codebase that can be used to augment processes associated with those on
[CoralNet](https://coralnet.ucsd.edu/).
It usesโจ[`Ultralytics`](https://github.com/ultralytics/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](https://github.com/ultralytics/ultralytics/blob/main/LICENSE).
The `toolbox` also uses the following to create rectangle and polygon annotations:
- [`Fast-SAM`](https://github.com/CASIA-IVA-Lab/FastSAM)
- [`RepViT-SAM`](https://github.com/THU-MIG/RepViT)
- [`EdgeSAM`](https://github.com/chongzhou96/EdgeSAM)
- [`MobileSAM`](https://github.com/ChaoningZhang/MobileSAM)
- [`CoralSCOP`](https://github.com/zhengziqiang/CoralSCOP)
- [`SAM`](https://github.com/facebookresearch/segment-anything)
- [`AutoDistill`](https://github.com/autodistill)
- [`GroundingDino`](https://github.com/IDEA-Research/GroundingDINO)
## Tools
Enhance your CoralNet experience with these tools:
- โ๏ธ 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)
- ๐ฆพ SAM: Use `FastSAM`, `CoralSCOP`, `RepViT-SAM`, `EdgeSAM`, `MobileSAM`, and `SAM` to create polygons
- ๐งช AutoDistill: Use `AutoDistill` to access `GroundingDINO` for creating rectangles
- ๐ง 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
- โ๏ธ I/O: Import and Export annotations from / to CoralNet, Viscore, and TagLab
- ๐ธ YOLO: Import and Export YOLO datasets for machine learning
### TODO
- ๐ API: Get predictions from any CoralNet source model
- ๐ฅ Download: Retrieve source data from CoralNet
- ๐ค Upload: Add images and annotations to CoralNet
- ๐ฆ Toolshed: Access tools from the old repository
## **How to Install**
### Anaconda
It's recommended to use `Anaconda` to create an environment for the `toolbox`:
```bash
# 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`:
```bash
# 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:
```bash
# 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
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:
- [`cuda-nvcc`](https://anaconda.org/nvidia/cuda-nvcc)
- [`cudatoolkit`](https://anaconda.org/nvidia/cuda-toolkit)
- [`torch`](https://pytorch.org/get-started/locally/)
### Run
Finally, you can run the `toolbox` from the command line:
```bash
# cmd
# Run
coralnet-toolbox
```
## [**About CoralNet**](https://coralnet.ucsd.edu/source/)
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.
Raw data
{
"_id": null,
"home_page": null,
"name": "coralnet-toolbox",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.11,>=3.10",
"maintainer_email": null,
"keywords": "CoralNet-Toolbox",
"author": null,
"author_email": "Jordan Pierce <jordan.pierce@noaa.gov>",
"download_url": "https://files.pythonhosted.org/packages/b5/d0/47ee769046fddd2ea9bf2978181d9cc94c2cdfd76b9cc2661bc06c406c5a/coralnet_toolbox-0.0.15.tar.gz",
"platform": null,
"description": "# CoralNet-Toolbox\n\n<div align=\"center\">\n <p>\n <img src=\"https://raw.githubusercontent.com/Jordan-Pierce/CoralNet-Toolbox/refs/heads/main/figures/CoralNet_Toolbox.png\" alt=\"CoralNet-Toolbox\">\n </p>\n</div>\n\n\n<div align=\"center\">\n\n[![python-version](https://img.shields.io/pypi/pyversions/CoralNet-Toolbox.svg)](https://pypi.org/project/CoralNet-Toolbox)\n[![version](https://img.shields.io/pypi/v/CoralNet-Toolbox.svg)](https://pypi.python.org/pypi/CoralNet-Toolbox)\n[![pypi-passing](https://github.com/Jordan-Pierce/CoralNet-Toolbox/actions/workflows/pypi.yml/badge.svg)](https://pypi.org/project/CoralNet-Toolbox)\n[![windows](https://github.com/Jordan-Pierce/CoralNet-Toolbox/actions/workflows/windows.yml/badge.svg)](https://pypi.org/project/CoralNet-Toolbox)\n[![macos](https://github.com/Jordan-Pierce/CoralNet-Toolbox/actions/workflows/macos.yml/badge.svg)](https://pypi.org/project/CoralNet-Toolbox)\n[![ubuntu](https://github.com/Jordan-Pierce/CoralNet-Toolbox/actions/workflows/ubuntu.yml/badge.svg)](https://pypi.org/project/CoralNet-Toolbox)\n</div>\n\n\n## Quick Start\n\nRunning the following command will install the `coralnet-toolbox`, which you can then run from the command line:\n```bash\n# cmd\n\n# Install\npip install coralnet-toolbox\n\n# Run\ncoralnet-toolbox\n```\n\nFor further instructions please see the following:\n- [Installation](https://jordan-pierce.github.io/CoralNet-Toolbox/installation)\n- [Usage](https://jordan-pierce.github.io/CoralNet-Toolbox/usage)\n\n<details open>\n <summary><h2><b>Watch the Video Demos</b></h2></summary>\n <p align=\"center\">\n <a href=\"https://youtube.com/playlist?list=PLG5z9IbwhS5NQT3B2jrg3hxQgilDeZak9&feature=shared\">\n <img src=\"https://raw.githubusercontent.com/Jordan-Pierce/CoralNet-Toolbox/refs/heads/main/figures/toolbox_qt.PNG\" alt=\"Video Title\" width=\"75%\">\n </a>\n </p>\n</details>\n\n## TL;Dr\n\nThe `CoralNet-Toolbox` is an unofficial codebase that can be used to augment processes associated with those on\n[CoralNet](https://coralnet.ucsd.edu/).\n\nIt uses\u2728[`Ultralytics`](https://github.com/ultralytics/ultralytics)\ud83d\ude80 as a base, which is an open-source library for\ncomputer vision and deep learning built in `PyTorch`. For more information on their `AGPL-3.0` license, see\n[here](https://github.com/ultralytics/ultralytics/blob/main/LICENSE).\n\nThe `toolbox` also uses the following to create rectangle and polygon annotations:\n- [`Fast-SAM`](https://github.com/CASIA-IVA-Lab/FastSAM)\n- [`RepViT-SAM`](https://github.com/THU-MIG/RepViT)\n- [`EdgeSAM`](https://github.com/chongzhou96/EdgeSAM)\n- [`MobileSAM`](https://github.com/ChaoningZhang/MobileSAM)\n- [`CoralSCOP`](https://github.com/zhengziqiang/CoralSCOP)\n- [`SAM`](https://github.com/facebookresearch/segment-anything)\n- [`AutoDistill`](https://github.com/autodistill)\n - [`GroundingDino`](https://github.com/IDEA-Research/GroundingDINO)\n\n\n## Tools\n\nEnhance your CoralNet experience with these tools:\n- \u270f\ufe0f Annotate: Create annotations freely\n- \ud83d\udc41\ufe0f Visualize: See CoralNet and CPCe annotations superimposed on images\n- \ud83d\udd2c Sample: Sample patches using various methods (Uniform, Random, Stratified)\n- \ud83e\udde9 Patches: Create patches (points)\n- \ud83d\udd33 Rectangles: Create rectangles (bounding boxes)\n- \ud83d\udfe3 Polygons: Create polygons (instance masks)\n- \ud83e\uddbe SAM: Use `FastSAM`, `CoralSCOP`, `RepViT-SAM`, `EdgeSAM`, `MobileSAM`, and `SAM` to create polygons\n- \ud83e\uddea AutoDistill: Use `AutoDistill` to access `GroundingDINO` for creating rectangles\n- \ud83e\udde0 Train: Build local patch-based classifiers, object detection, and instance segmentation models\n- \ud83d\udd2e Deploy: Use trained models for predictions\n- \ud83d\udcca Evaluation: Evaluate model performance\n- \ud83d\ude80 Optimize: Productionize models for faster inferencing\n- \u2699\ufe0f Batch Inference: Perform predictions on multiple images, automatically\n- \u2194\ufe0f I/O: Import and Export annotations from / to CoralNet, Viscore, and TagLab\n- \ud83d\udcf8 YOLO: Import and Export YOLO datasets for machine learning\n\n### TODO\n- \ud83d\udd0d API: Get predictions from any CoralNet source model\n- \ud83d\udce5 Download: Retrieve source data from CoralNet\n- \ud83d\udce4 Upload: Add images and annotations to CoralNet\n- \ud83d\udce6 Toolshed: Access tools from the old repository\n\n\n## **How to Install**\n\n### Anaconda\n\nIt's recommended to use `Anaconda` to create an environment for the `toolbox`:\n```bash\n# cmd\n\n# Create and activate an environment\nconda create --name coralnet10 python=3.10 -y\nconda activate coralnet10\n```\n\n### Install\n\nOnce this has finished, install the `toolbox`:\n```bash\n# cmd\n\n# Install\npip install coralnet-toolbox\n```\n\n### CUDA\n\nIf you have `CUDA`, you should install the versions of `cuda-nvcc` and `cudatoolkit` that you\nneed, and then install the corresponding versions of `torch` and `torchvision`. Below is an example of how that can be\ndone using `CUDA` version 11.8:\n```bash\n# cmd\n\n# Example for CUDA 11.8\nconda install nvidia/label/cuda-11.8.0::cuda-nvcc -y\nconda install nvidia/label/cuda-11.8.0::cuda-toolkit -y\n\n# Example for torch w/ CUDA 11.8\npip install torch torchvision --index-url https://download.pytorch.org/whl/cu118 --upgrade\n```\n\nIf `CUDA` is installed on your computer, and `torch` was built with it properly, you should see a `\ud83d\udc07` icon in the\n`toolbox` instead of a `\ud83d\udc22`; if you have multiple `CUDA` devices available, you should see a `\ud83d\ude80` icon,\nand if you're using a Mac with `Metal`, you should see an `\ud83c\udf4e` icon (click on the icon to see the device information).\n\nSee here for more details on versions for the following:\n- [`cuda-nvcc`](https://anaconda.org/nvidia/cuda-nvcc)\n- [`cudatoolkit`](https://anaconda.org/nvidia/cuda-toolkit)\n- [`torch`](https://pytorch.org/get-started/locally/)\n\n\n### Run\nFinally, you can run the `toolbox` from the command line:\n```bash\n# cmd\n\n# Run\ncoralnet-toolbox\n```\n\n## [**About CoralNet**](https://coralnet.ucsd.edu/source/)\nCoral reefs are vital ecosystems that support a wide range of marine life and provide numerous\nbenefits to humans. However, they are under threat due to climate change, pollution, overfishing,\nand other factors. CoralNet is a platform designed to aid researchers and scientists in studying\nthese important ecosystems and their inhabitants.\n\nCoralNet allows users to upload photos of coral reefs and annotate them with detailed information\nabout the coral species and other features present in the images. The platform also provides tools\nfor analyzing the annotated images, and create patch-based image classifiers.\n\nThe CoralNet-Toolbox is an unofficial tool developed to augment processes associated with analyses that\nuse CoralNet and Coral Point Count (CPCe).\n\n\n## **Conclusion**\nIn summary, this repository provides a range of tools that can assist with interacting with\nCoralNet and performing various tasks related to analyzing annotated images. These tools can be\nuseful for researchers and scientists working with coral reefs, as well as for students and\nhobbyists interested in learning more about these important ecosystems.\n\n\n## Citation\n\nIf used in project or publication, please attribute your use of this repository with the following:\n\n```\n@misc{CoralNet-Toolbox,\n author = {Pierce, Jordan and Edwards, Clinton and Rojano, Sarah and Cook, Sophie and Sweeney, Edward and Costa, Bryan and Vieham, Shay and Battista, Tim},\n title = {CoralNet-Toolbox},\n year = {2023},\n howpublished = {\\url{https://github.com/Jordan-Pierce/CoralNet-Toolbox}},\n note = {GitHub repository}\n}\n```\n\n---\n\n## Disclaimer\n\nThis repository is a scientific product and is not official communication of the National\nOceanic and Atmospheric Administration, or the United States Department of Commerce. All NOAA\nGitHub project code is provided on an 'as is' basis and the user assumes responsibility for its\nuse. Any claims against the Department of Commerce or Department of Commerce bureaus stemming from\nthe use of this GitHub project will be governed by all applicable Federal law. Any reference to\nspecific commercial products, processes, or services by service mark, trademark, manufacturer, or\notherwise, does not constitute or imply their endorsement, recommendation or favoring by the\nDepartment of Commerce. The Department of Commerce seal and logo, or the seal and logo of a DOC\nbureau, shall not be used in any manner to imply endorsement of any commercial product or activity\nby DOC or the United States Government.\n\n\n## License\n\nSoftware code created by U.S. Government employees is not subject to copyright in the United States\n(17 U.S.C. \u00a7105). The United States/Department of Commerce reserve all rights to seek and obtain\ncopyright protection in countries other than the United States for Software authored in its\nentirety by the Department of Commerce. To this end, the Department of Commerce hereby grants to\nRecipient a royalty-free, nonexclusive license to use, copy, and create derivative works of the\nSoftware outside of the United States.\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Tools for annotating and developing ML models for benthic imagery",
"version": "0.0.15",
"project_urls": {
"Homepage": "https://github.com/Jordan-Pierce/CoralNet-Toolbox"
},
"split_keywords": [
"coralnet-toolbox"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4ddeb86b4eee627e9110912a7c78c0340103c04448bc7bf70e3fb83eea29e8a1",
"md5": "2fd5d3f45577f57a7fab8c6c766c1bde",
"sha256": "8f49aa97e3c6efb9ee45663194fa351b549e3fe3e3c8e058e5c94ea235b4f8ef"
},
"downloads": -1,
"filename": "coralnet_toolbox-0.0.15-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "2fd5d3f45577f57a7fab8c6c766c1bde",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": "<3.11,>=3.10",
"size": 187788,
"upload_time": "2024-12-19T19:42:11",
"upload_time_iso_8601": "2024-12-19T19:42:11.173874Z",
"url": "https://files.pythonhosted.org/packages/4d/de/b86b4eee627e9110912a7c78c0340103c04448bc7bf70e3fb83eea29e8a1/coralnet_toolbox-0.0.15-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b5d047ee769046fddd2ea9bf2978181d9cc94c2cdfd76b9cc2661bc06c406c5a",
"md5": "529cc946c7176afe2e6a42856a5dd7ab",
"sha256": "e925ce6d119b17a03384a2399ba3ecf2697a38cee729341671f8a8c06f38b287"
},
"downloads": -1,
"filename": "coralnet_toolbox-0.0.15.tar.gz",
"has_sig": false,
"md5_digest": "529cc946c7176afe2e6a42856a5dd7ab",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.11,>=3.10",
"size": 15143191,
"upload_time": "2024-12-19T19:42:14",
"upload_time_iso_8601": "2024-12-19T19:42:14.794971Z",
"url": "https://files.pythonhosted.org/packages/b5/d0/47ee769046fddd2ea9bf2978181d9cc94c2cdfd76b9cc2661bc06c406c5a/coralnet_toolbox-0.0.15.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-19 19:42:14",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Jordan-Pierce",
"github_project": "CoralNet-Toolbox",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "PyQt5",
"specs": [
[
">=",
"5.15.11"
]
]
},
{
"name": "QtRangeSlider",
"specs": [
[
">=",
"0.1.5"
]
]
},
{
"name": "ultralytics",
"specs": [
[
"==",
"8.3.0"
]
]
},
{
"name": "supervision",
"specs": [
[
">=",
"0.24.0"
]
]
},
{
"name": "scikit-learn",
"specs": []
},
{
"name": "pycocotools",
"specs": []
},
{
"name": "timm",
"specs": [
[
"==",
"0.9.2"
]
]
},
{
"name": "autodistill",
"specs": []
},
{
"name": "autodistill-grounding-dino",
"specs": []
},
{
"name": "x-segment-anything",
"specs": [
[
">=",
"0.0.6"
]
]
},
{
"name": "roboflow",
"specs": []
},
{
"name": "rasterio",
"specs": []
},
{
"name": "requests",
"specs": []
},
{
"name": "dill",
"specs": []
}
],
"lcname": "coralnet-toolbox"
}