coralnet-toolbox 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. coralnet_toolbox-0.0.1/.gitignore +23 -0
  2. coralnet_toolbox-0.0.1/LICENSE.txt +5 -0
  3. coralnet_toolbox-0.0.1/MANIFEST.in +7 -0
  4. coralnet_toolbox-0.0.1/PKG-INFO +259 -0
  5. coralnet_toolbox-0.0.1/README.md +224 -0
  6. coralnet_toolbox-0.0.1/coralnet_toolbox/Annotations/QtAnnotation.py +351 -0
  7. coralnet_toolbox-0.0.1/coralnet_toolbox/Annotations/QtPatchAnnotation.py +216 -0
  8. coralnet_toolbox-0.0.1/coralnet_toolbox/Annotations/QtPolygonAnnotation.py +445 -0
  9. coralnet_toolbox-0.0.1/coralnet_toolbox/Annotations/QtRectangleAnnotation.py +284 -0
  10. coralnet_toolbox-0.0.1/coralnet_toolbox/Annotations/__init__.py +11 -0
  11. coralnet_toolbox-0.0.1/coralnet_toolbox/AutoDistill/QtBatchInference.py +130 -0
  12. coralnet_toolbox-0.0.1/coralnet_toolbox/AutoDistill/QtDeployModel.py +481 -0
  13. coralnet_toolbox-0.0.1/coralnet_toolbox/AutoDistill/__init__.py +9 -0
  14. coralnet_toolbox-0.0.1/coralnet_toolbox/CoralNet/__init__.py +0 -0
  15. coralnet_toolbox-0.0.1/coralnet_toolbox/IO/QtExportAnnotations.py +89 -0
  16. coralnet_toolbox-0.0.1/coralnet_toolbox/IO/QtExportCoralNetAnnotations.py +61 -0
  17. coralnet_toolbox-0.0.1/coralnet_toolbox/IO/QtExportLabels.py +43 -0
  18. coralnet_toolbox-0.0.1/coralnet_toolbox/IO/QtExportTagLabAnnotations.py +195 -0
  19. coralnet_toolbox-0.0.1/coralnet_toolbox/IO/QtExportViscoreAnnotations.py +64 -0
  20. coralnet_toolbox-0.0.1/coralnet_toolbox/IO/QtImportAnnotations.py +126 -0
  21. coralnet_toolbox-0.0.1/coralnet_toolbox/IO/QtImportCoralNetAnnotations.py +173 -0
  22. coralnet_toolbox-0.0.1/coralnet_toolbox/IO/QtImportImages.py +57 -0
  23. coralnet_toolbox-0.0.1/coralnet_toolbox/IO/QtImportLabels.py +56 -0
  24. coralnet_toolbox-0.0.1/coralnet_toolbox/IO/QtImportTagLabAnnotations.py +238 -0
  25. coralnet_toolbox-0.0.1/coralnet_toolbox/IO/QtImportViscoreAnnotations.py +303 -0
  26. coralnet_toolbox-0.0.1/coralnet_toolbox/IO/__init__.py +25 -0
  27. coralnet_toolbox-0.0.1/coralnet_toolbox/Icons/__init__.py +30 -0
  28. coralnet_toolbox-0.0.1/coralnet_toolbox/Icons/apple.png +0 -0
  29. coralnet_toolbox-0.0.1/coralnet_toolbox/Icons/coral.png +0 -0
  30. coralnet_toolbox-0.0.1/coralnet_toolbox/Icons/opaque.png +0 -0
  31. coralnet_toolbox-0.0.1/coralnet_toolbox/Icons/parameters.png +0 -0
  32. coralnet_toolbox-0.0.1/coralnet_toolbox/Icons/patch.png +0 -0
  33. coralnet_toolbox-0.0.1/coralnet_toolbox/Icons/polygon.png +0 -0
  34. coralnet_toolbox-0.0.1/coralnet_toolbox/Icons/rabbit.png +0 -0
  35. coralnet_toolbox-0.0.1/coralnet_toolbox/Icons/rectangle.png +0 -0
  36. coralnet_toolbox-0.0.1/coralnet_toolbox/Icons/rocket.png +0 -0
  37. coralnet_toolbox-0.0.1/coralnet_toolbox/Icons/sam.png +0 -0
  38. coralnet_toolbox-0.0.1/coralnet_toolbox/Icons/select.png +0 -0
  39. coralnet_toolbox-0.0.1/coralnet_toolbox/Icons/slicer.png +0 -0
  40. coralnet_toolbox-0.0.1/coralnet_toolbox/Icons/transparent.png +0 -0
  41. coralnet_toolbox-0.0.1/coralnet_toolbox/Icons/turtle.png +0 -0
  42. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/BatchInference/QtBase.py +180 -0
  43. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/BatchInference/QtClassify.py +150 -0
  44. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/BatchInference/QtDetect.py +43 -0
  45. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/BatchInference/QtSegment.py +43 -0
  46. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/BatchInference/__init__.py +0 -0
  47. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/ConfusionMatrix.py +336 -0
  48. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/DeployModel/QtBase.py +363 -0
  49. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/DeployModel/QtClassify.py +133 -0
  50. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/DeployModel/QtDetect.py +171 -0
  51. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/DeployModel/QtSegment.py +168 -0
  52. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/DeployModel/__init__.py +0 -0
  53. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/EvaluateModel/QtBase.py +251 -0
  54. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/EvaluateModel/QtClassify.py +39 -0
  55. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/EvaluateModel/QtDetect.py +31 -0
  56. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/EvaluateModel/QtSegment.py +31 -0
  57. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/EvaluateModel/__init__.py +0 -0
  58. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/ExportDataset/QtBase.py +654 -0
  59. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/ExportDataset/QtClassify.py +113 -0
  60. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/ExportDataset/QtDetect.py +122 -0
  61. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/ExportDataset/QtSegment.py +122 -0
  62. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/ExportDataset/__init__.py +0 -0
  63. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/ImportDataset/QtBase.py +414 -0
  64. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/ImportDataset/QtDetect.py +15 -0
  65. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/ImportDataset/QtSegment.py +15 -0
  66. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/MergeDatasets/QtBase.py +332 -0
  67. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/MergeDatasets/QtClassify.py +18 -0
  68. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/MergeDatasets/__init__.py +0 -0
  69. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/OptimizeModel/QtBase.py +237 -0
  70. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/OptimizeModel/__init__.py +0 -0
  71. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/TrainModel/QtBase.py +581 -0
  72. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/TrainModel/QtClassify.py +64 -0
  73. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/TrainModel/QtDetect.py +68 -0
  74. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/TrainModel/QtSegment.py +63 -0
  75. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/TrainModel/__init__.py +0 -0
  76. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/WeightedDataset.py +168 -0
  77. coralnet_toolbox-0.0.1/coralnet_toolbox/MachineLearning/__init__.py +49 -0
  78. coralnet_toolbox-0.0.1/coralnet_toolbox/QtAnnotationWindow.py +614 -0
  79. coralnet_toolbox-0.0.1/coralnet_toolbox/QtConfidenceWindow.py +215 -0
  80. coralnet_toolbox-0.0.1/coralnet_toolbox/QtEventFilter.py +103 -0
  81. coralnet_toolbox-0.0.1/coralnet_toolbox/QtImageWindow.py +570 -0
  82. coralnet_toolbox-0.0.1/coralnet_toolbox/QtLabelWindow.py +635 -0
  83. coralnet_toolbox-0.0.1/coralnet_toolbox/QtMainWindow.py +1400 -0
  84. coralnet_toolbox-0.0.1/coralnet_toolbox/QtPatchSampling.py +361 -0
  85. coralnet_toolbox-0.0.1/coralnet_toolbox/QtProgressBar.py +73 -0
  86. coralnet_toolbox-0.0.1/coralnet_toolbox/ResultsProcessor.py +455 -0
  87. coralnet_toolbox-0.0.1/coralnet_toolbox/SAM/QtBatchInference.py +192 -0
  88. coralnet_toolbox-0.0.1/coralnet_toolbox/SAM/QtDeployGenerator.py +437 -0
  89. coralnet_toolbox-0.0.1/coralnet_toolbox/SAM/QtDeployPredictor.py +593 -0
  90. coralnet_toolbox-0.0.1/coralnet_toolbox/SAM/__init__.py +11 -0
  91. coralnet_toolbox-0.0.1/coralnet_toolbox/Slicer/QtSlicer.py +31 -0
  92. coralnet_toolbox-0.0.1/coralnet_toolbox/Slicer/QtSlicerDialog.py +68 -0
  93. coralnet_toolbox-0.0.1/coralnet_toolbox/Slicer/__init__.py +0 -0
  94. coralnet_toolbox-0.0.1/coralnet_toolbox/Tools/QtPanTool.py +42 -0
  95. coralnet_toolbox-0.0.1/coralnet_toolbox/Tools/QtPatchTool.py +70 -0
  96. coralnet_toolbox-0.0.1/coralnet_toolbox/Tools/QtPolygonTool.py +99 -0
  97. coralnet_toolbox-0.0.1/coralnet_toolbox/Tools/QtRectangleTool.py +105 -0
  98. coralnet_toolbox-0.0.1/coralnet_toolbox/Tools/QtSAMTool.py +498 -0
  99. coralnet_toolbox-0.0.1/coralnet_toolbox/Tools/QtSelectTool.py +311 -0
  100. coralnet_toolbox-0.0.1/coralnet_toolbox/Tools/QtTool.py +44 -0
  101. coralnet_toolbox-0.0.1/coralnet_toolbox/Tools/QtZoomTool.py +64 -0
  102. coralnet_toolbox-0.0.1/coralnet_toolbox/Tools/__init__.py +19 -0
  103. coralnet_toolbox-0.0.1/coralnet_toolbox/__init__.py +8 -0
  104. coralnet_toolbox-0.0.1/coralnet_toolbox/main.py +32 -0
  105. coralnet_toolbox-0.0.1/coralnet_toolbox/utilities.py +182 -0
  106. coralnet_toolbox-0.0.1/coralnet_toolbox.egg-info/PKG-INFO +259 -0
  107. coralnet_toolbox-0.0.1/coralnet_toolbox.egg-info/SOURCES.txt +121 -0
  108. coralnet_toolbox-0.0.1/coralnet_toolbox.egg-info/dependency_links.txt +1 -0
  109. coralnet_toolbox-0.0.1/coralnet_toolbox.egg-info/entry_points.txt +2 -0
  110. coralnet_toolbox-0.0.1/coralnet_toolbox.egg-info/requires.txt +19 -0
  111. coralnet_toolbox-0.0.1/coralnet_toolbox.egg-info/top_level.txt +1 -0
  112. coralnet_toolbox-0.0.1/docs/README.md +137 -0
  113. coralnet_toolbox-0.0.1/figures/CoralNet_Toolbox.png +0 -0
  114. coralnet_toolbox-0.0.1/figures/SegmentEverything.gif +0 -0
  115. coralnet_toolbox-0.0.1/figures/toolbox_qt.PNG +0 -0
  116. coralnet_toolbox-0.0.1/notebooks/ReefFutures_MIR.ipynb +862 -0
  117. coralnet_toolbox-0.0.1/notebooks/ReefFutures_Palmyra.ipynb +873 -0
  118. coralnet_toolbox-0.0.1/notebooks/ToYOLO.ipynb +85 -0
  119. coralnet_toolbox-0.0.1/pyproject.toml +78 -0
  120. coralnet_toolbox-0.0.1/requirements.txt +13 -0
  121. coralnet_toolbox-0.0.1/setup.cfg +4 -0
  122. coralnet_toolbox-0.0.1/setup.py +36 -0
  123. coralnet_toolbox-0.0.1/tests/test_coralnet_toolbox.py +3 -0
@@ -0,0 +1,23 @@
1
+ *.hd
2
+ *.hdf5
3
+ *.pt
4
+ *.pth
5
+ *.torchscript
6
+ *.bin
7
+ *.engine
8
+ *.onnx
9
+ *__pycache__/
10
+ *.amltmp
11
+ *.amlignore
12
+ *.ipynb_aml_checkpoints
13
+
14
+ *egg-info
15
+ *.idea
16
+ *.vscode
17
+ launch.json
18
+
19
+ build
20
+ dist
21
+
22
+ Data/
23
+ coralnet_toolbox/QtClustering.py
@@ -0,0 +1,5 @@
1
+ Software code created by U.S. Government employees is not subject to copyright in the United States (17 U.S.C. ยง105).
2
+ The United States/Department of Commerce reserve all rights to seek and obtain copyright protection in countries
3
+ other than the United States for Software authored in its entirety by the Department of Commerce. To this end, the
4
+ Department of Commerce hereby grants to Recipient a royalty-free, nonexclusive license to use, copy, and create
5
+ derivative works of the Software outside of the United States.
@@ -0,0 +1,7 @@
1
+ include LICENSE
2
+ include README.md
3
+ include requirements.txt
4
+
5
+ recursive-exclude * __pycache__
6
+ recursive-exclude * *.py[co]
7
+
@@ -0,0 +1,259 @@
1
+ Metadata-Version: 2.1
2
+ Name: coralnet-toolbox
3
+ Version: 0.0.1
4
+ Summary: Tools for annotating and developing ML models for benthic imagery
5
+ Home-page: https://github.com/Jordan-Pierce/CoralNet-Toolbox
6
+ Author: Jordan Pierce
7
+ Author-email: Jordan Pierce <jordan.pierce@noaa.gov>
8
+ License: MIT License
9
+ Project-URL: Homepage, https://github.com/Jordan-Pierce/CoralNet-Toolbox
10
+ Keywords: CoralNet-Toolbox
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Natural Language :: English
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Requires-Python: >=3.10, <3.11
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE.txt
18
+ Requires-Dist: PyQt5>=5.15.11
19
+ Requires-Dist: QtRangeSlider==0.1.5
20
+ Requires-Dist: ultralytics==8.3.0
21
+ Requires-Dist: supervision==0.24.0
22
+ Requires-Dist: pycocotools>=2.0.6
23
+ Requires-Dist: timm==0.9.2
24
+ Requires-Dist: autodistill==0.1.28
25
+ Requires-Dist: autodistill-grounding-dino==0.1.4
26
+ Requires-Dist: roboflow==1.1.48
27
+ Requires-Dist: x-segment-anything
28
+ Requires-Dist: rasterio>=1.4.1
29
+ Requires-Dist: requests
30
+ Requires-Dist: dill
31
+ Provides-Extra: all
32
+ Requires-Dist: coralnet-toolbox[extra]; extra == "all"
33
+ Provides-Extra: extra
34
+ Requires-Dist: pandas; extra == "extra"
35
+
36
+ # CoralNet-Toolbox
37
+
38
+ <p align="center">
39
+ <img src="figures/CoralNet_Toolbox.png" alt="CoralNet-Toolbox">
40
+ </p>
41
+
42
+ [![image](https://img.shields.io/pypi/v/CoralNet-Toolbox.svg)](https://pypi.python.org/pypi/CoralNet-Toolbox)
43
+
44
+
45
+ The `CoralNet-Toolbox` is an unofficial codebase that can be used to augment processes associated with those on
46
+ [CoralNet](https://coralnet.ucsd.edu/).
47
+
48
+ It usesโœจ[`Ultralytics`](https://github.com/ultralytics/ultralytics)๐Ÿš€ as a base, which is an open-source library for
49
+ computer vision and deep learning built in `PyTorch`. For more information on their `AGPL-3.0` license, see
50
+ [here](https://github.com/ultralytics/ultralytics/blob/main/LICENSE).
51
+
52
+ The `toolbox` also uses the following to create rectangle and polygon annotations:
53
+ - [`Fast-SAM`]()
54
+ - [`RepViT-SAM`]()
55
+ - [`EdgeSAM`](https://github.com/chongzhou96/EdgeSAM)
56
+ - [`MobileSAM`](https://github.com/ChaoningZhang/MobileSAM)
57
+ - [`SAM`](https://github.com/facebookresearch/segment-anything)
58
+ - [`AutoDistill`](https://github.com/autodistill)
59
+ - [`GroundingDino`]()
60
+
61
+ ## Quick Start
62
+
63
+ Running the following command will install the `coralnet-toolbox`, which you can then run from the command line:
64
+ ```bash
65
+ # cmd
66
+
67
+ # Install
68
+ pip install coralnet-toolbox
69
+
70
+ # Run
71
+ coralnet-toolbox
72
+ ```
73
+
74
+ <p align="center">
75
+ <img src="figures/SegmentEverything.gif" alt="CoralNet-Toolbox">
76
+ </p>
77
+
78
+
79
+ For further instructions, see [How to Install](); for information on how to use, check out the [docs](./docs).
80
+
81
+ ## Tools
82
+
83
+ Enhance your CoralNet experience with these tools:
84
+ - โœ๏ธ Annotate: Create annotations freely
85
+ - ๐Ÿ‘๏ธ Visualize: See CoralNet and CPCe annotations superimposed on images
86
+ - ๐Ÿ”ฌ Sample: Sample patches using various methods (Uniform, Random, Stratified)
87
+ - ๐Ÿงฉ Patches: Create patches (points)
88
+ - ๐Ÿ”ณ Rectangles: Create rectangles (bounding boxes)
89
+ - ๐ŸŸฃ Polygons: Create polygons (instance masks)
90
+ - ๐Ÿฆพ SAM: Use [`FastSAM`](), [`RepViT-SAM`](), [`EdgeSAM`](), [`MobileSAM`](), and [`SAM`]() to create polygons
91
+ - ๐Ÿงช AutoDistill: Use [`AutoDistill`](https://github.com/autodistill) to access `GroundingDINO` for creating rectangles
92
+ - ๐Ÿง  Train: Build local patch-based classifiers, object detection, and instance segmentation models
93
+ - ๐Ÿ”ฎ Deploy: Use trained models for predictions
94
+ - ๐Ÿ“Š Evaluation: Evaluate model performance
95
+ - ๐Ÿš€ Optimize: Productionize models for faster inferencing
96
+ - โš™๏ธ Batch Inference: Perform predictions on multiple images, automatically
97
+ - โ†”๏ธ I/O: Import and Export annotations from / to CoralNet, Viscore, and TagLab
98
+ - ๐Ÿ“ธ YOLO: Import and Export YOLO datasets for machine learning
99
+
100
+ ### TODO
101
+ - ๐Ÿ” API: Get predictions from any CoralNet source model
102
+ - ๐Ÿ“ฅ Download: Retrieve source data from CoralNet
103
+ - ๐Ÿ“ค Upload: Add images and annotations to CoralNet
104
+ - ๐Ÿ“ฆ Toolshed: Access tools from the old repository
105
+
106
+
107
+ <details open>
108
+ <summary><h2><b>Watch the Video Demos</b></h2></summary>
109
+ <p align="center">
110
+ <a href="https://youtube.com/playlist?list=PLG5z9IbwhS5NQT3B2jrg3hxQgilDeZak9&feature=shared">
111
+ <img src="https://raw.githubusercontent.com/Jordan-Pierce/CoralNet-Toolbox/refs/heads/main/figures/toolbox_qt.PNG" alt="Video Title" width="50%">
112
+ </a>
113
+ </p>
114
+ </details>
115
+
116
+ ## **How to Install**
117
+
118
+ ### Anaconda
119
+
120
+ It's recommended to use `Anaconda` to create an environment for the `toolbox`:
121
+ ```bash
122
+ # cmd
123
+
124
+ # Create and activate an environment
125
+ conda create --name coralnet-toolbox python=3.10 -y
126
+ conda activate coralnet-toolbox
127
+ ```
128
+
129
+ ### Install
130
+
131
+ Once this has finished, install the `toolbox`:
132
+ ```bash
133
+ # cmd
134
+
135
+ # Install
136
+ pip install coralnet-toolbox
137
+ ```
138
+
139
+ ### CUDA
140
+
141
+ If you have `CUDA`, you should install the versions of `cuda-nvcc` and `cudatoolkit` that you
142
+ need, and then install the corresponding versions of `torch` and `torchvision`. Below is an example of how that can be
143
+ done using `CUDA` version 11.8:
144
+ ```bash
145
+ # cmd
146
+
147
+ # Example for CUDA 11.8
148
+ conda install nvidia/label/cuda-11.8.0::cuda-nvcc -y
149
+ conda install nvidia/label/cuda-11.8.0::cuda-toolkit -y
150
+
151
+ # Example for torch w/ CUDA 11.8
152
+ pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118 --upgrade
153
+ ```
154
+
155
+ If `CUDA` is installed on your computer, and `torch` was built with it properly, you should see a `๐Ÿ‡` icon in the
156
+ `toolbox` instead of a `๐Ÿข`; if you have multiple `CUDA` devices available, you should see a `๐Ÿš€` icon,
157
+ and if you're using a Mac with `Metal`, you should see an `๐ŸŽ` icon (click on the icon to see the device information).
158
+
159
+ See here for more details on [`cuda-nvcc`](https://anaconda.org/nvidia/cuda-nvcc),
160
+ [`cudatoolkit`](https://anaconda.org/nvidia/cuda-toolkit), and [`torch`](https://pytorch.org/get-started/locally/)
161
+ versions.
162
+
163
+ ### Run
164
+ Finally, you can run the `toolbox` from the command line:
165
+ ```bash
166
+ # cmd
167
+
168
+ # Run
169
+ coralnet-toolbox
170
+ ```
171
+
172
+ ## GitHub Repository
173
+
174
+ If you prefer to clone the repository and run the `toolbox` from the source code, you can do so with the following:
175
+
176
+ ```bash
177
+ # cmd
178
+
179
+ # Create and activate an environment
180
+ conda create --name coralnet-toolbox python=3.10 -y
181
+ conda activate coralnet-toolbox
182
+
183
+ # Clone and enter the repository
184
+ git clone https://github.com/Jordan-Pierce/CoralNet-Toolbox.git
185
+ cd CoralNet-Toolbox
186
+
187
+ # Install the latest
188
+ pip install -e .
189
+
190
+ # Install CUDA requirements (if applicable)
191
+ conda install nvidia/label/cuda-11.8.0::cuda-nvcc -y
192
+ conda install nvidia/label/cuda-11.8.0::cuda-toolkit -y
193
+
194
+ # Example for torch w/ CUDA 11.8
195
+ pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118 --upgrade
196
+
197
+ # Run
198
+ coralnet-toolbox
199
+ ```
200
+
201
+ ## [**About CoralNet**](https://coralnet.ucsd.edu/source/)
202
+ Coral reefs are vital ecosystems that support a wide range of marine life and provide numerous
203
+ benefits to humans. However, they are under threat due to climate change, pollution, overfishing,
204
+ and other factors. CoralNet is a platform designed to aid researchers and scientists in studying
205
+ these important ecosystems and their inhabitants.
206
+
207
+ CoralNet allows users to upload photos of coral reefs and annotate them with detailed information
208
+ about the coral species and other features present in the images. The platform also provides tools
209
+ for analyzing the annotated images, and create patch-based image classifiers.
210
+
211
+ The CoralNet-Toolbox is an unofficial tool developed to augment processes associated with analyses that
212
+ use CoralNet and Coral Point Count (CPCe).
213
+
214
+
215
+ ## **Conclusion**
216
+ In summary, this repository provides a range of tools that can assist with interacting with
217
+ CoralNet and performing various tasks related to analyzing annotated images. These tools can be
218
+ useful for researchers and scientists working with coral reefs, as well as for students and
219
+ hobbyists interested in learning more about these important ecosystems.
220
+
221
+
222
+ ## Citation
223
+
224
+ If used in project or publication, please attribute your use of this repository with the following:
225
+
226
+ ```
227
+ @misc{CoralNet-Toolbox,
228
+ author = {Pierce, Jordan and Edwards, Clinton and Rojano, Sarah and Cook, Sophie and Sweeney, Edward and Costa, Bryan and Vieham, Shay and Battista, Tim},
229
+ title = {CoralNet-Toolbox},
230
+ year = {2023},
231
+ howpublished = {\url{https://github.com/Jordan-Pierce/CoralNet-Toolbox}},
232
+ note = {GitHub repository}
233
+ }
234
+ ```
235
+
236
+ ---
237
+
238
+ ## Disclaimer
239
+
240
+ This repository is a scientific product and is not official communication of the National
241
+ Oceanic and Atmospheric Administration, or the United States Department of Commerce. All NOAA
242
+ GitHub project code is provided on an 'as is' basis and the user assumes responsibility for its
243
+ use. Any claims against the Department of Commerce or Department of Commerce bureaus stemming from
244
+ the use of this GitHub project will be governed by all applicable Federal law. Any reference to
245
+ specific commercial products, processes, or services by service mark, trademark, manufacturer, or
246
+ otherwise, does not constitute or imply their endorsement, recommendation or favoring by the
247
+ Department of Commerce. The Department of Commerce seal and logo, or the seal and logo of a DOC
248
+ bureau, shall not be used in any manner to imply endorsement of any commercial product or activity
249
+ by DOC or the United States Government.
250
+
251
+
252
+ ## License
253
+
254
+ Software code created by U.S. Government employees is not subject to copyright in the United States
255
+ (17 U.S.C. ยง105). The United States/Department of Commerce reserve all rights to seek and obtain
256
+ copyright protection in countries other than the United States for Software authored in its
257
+ entirety by the Department of Commerce. To this end, the Department of Commerce hereby grants to
258
+ Recipient a royalty-free, nonexclusive license to use, copy, and create derivative works of the
259
+ Software outside of the United States.
@@ -0,0 +1,224 @@
1
+ # CoralNet-Toolbox
2
+
3
+ <p align="center">
4
+ <img src="figures/CoralNet_Toolbox.png" alt="CoralNet-Toolbox">
5
+ </p>
6
+
7
+ [![image](https://img.shields.io/pypi/v/CoralNet-Toolbox.svg)](https://pypi.python.org/pypi/CoralNet-Toolbox)
8
+
9
+
10
+ The `CoralNet-Toolbox` is an unofficial codebase that can be used to augment processes associated with those on
11
+ [CoralNet](https://coralnet.ucsd.edu/).
12
+
13
+ It usesโœจ[`Ultralytics`](https://github.com/ultralytics/ultralytics)๐Ÿš€ as a base, which is an open-source library for
14
+ computer vision and deep learning built in `PyTorch`. For more information on their `AGPL-3.0` license, see
15
+ [here](https://github.com/ultralytics/ultralytics/blob/main/LICENSE).
16
+
17
+ The `toolbox` also uses the following to create rectangle and polygon annotations:
18
+ - [`Fast-SAM`]()
19
+ - [`RepViT-SAM`]()
20
+ - [`EdgeSAM`](https://github.com/chongzhou96/EdgeSAM)
21
+ - [`MobileSAM`](https://github.com/ChaoningZhang/MobileSAM)
22
+ - [`SAM`](https://github.com/facebookresearch/segment-anything)
23
+ - [`AutoDistill`](https://github.com/autodistill)
24
+ - [`GroundingDino`]()
25
+
26
+ ## Quick Start
27
+
28
+ Running the following command will install the `coralnet-toolbox`, which you can then run from the command line:
29
+ ```bash
30
+ # cmd
31
+
32
+ # Install
33
+ pip install coralnet-toolbox
34
+
35
+ # Run
36
+ coralnet-toolbox
37
+ ```
38
+
39
+ <p align="center">
40
+ <img src="figures/SegmentEverything.gif" alt="CoralNet-Toolbox">
41
+ </p>
42
+
43
+
44
+ For further instructions, see [How to Install](); for information on how to use, check out the [docs](./docs).
45
+
46
+ ## Tools
47
+
48
+ Enhance your CoralNet experience with these tools:
49
+ - โœ๏ธ Annotate: Create annotations freely
50
+ - ๐Ÿ‘๏ธ Visualize: See CoralNet and CPCe annotations superimposed on images
51
+ - ๐Ÿ”ฌ Sample: Sample patches using various methods (Uniform, Random, Stratified)
52
+ - ๐Ÿงฉ Patches: Create patches (points)
53
+ - ๐Ÿ”ณ Rectangles: Create rectangles (bounding boxes)
54
+ - ๐ŸŸฃ Polygons: Create polygons (instance masks)
55
+ - ๐Ÿฆพ SAM: Use [`FastSAM`](), [`RepViT-SAM`](), [`EdgeSAM`](), [`MobileSAM`](), and [`SAM`]() to create polygons
56
+ - ๐Ÿงช AutoDistill: Use [`AutoDistill`](https://github.com/autodistill) to access `GroundingDINO` for creating rectangles
57
+ - ๐Ÿง  Train: Build local patch-based classifiers, object detection, and instance segmentation models
58
+ - ๐Ÿ”ฎ Deploy: Use trained models for predictions
59
+ - ๐Ÿ“Š Evaluation: Evaluate model performance
60
+ - ๐Ÿš€ Optimize: Productionize models for faster inferencing
61
+ - โš™๏ธ Batch Inference: Perform predictions on multiple images, automatically
62
+ - โ†”๏ธ I/O: Import and Export annotations from / to CoralNet, Viscore, and TagLab
63
+ - ๐Ÿ“ธ YOLO: Import and Export YOLO datasets for machine learning
64
+
65
+ ### TODO
66
+ - ๐Ÿ” API: Get predictions from any CoralNet source model
67
+ - ๐Ÿ“ฅ Download: Retrieve source data from CoralNet
68
+ - ๐Ÿ“ค Upload: Add images and annotations to CoralNet
69
+ - ๐Ÿ“ฆ Toolshed: Access tools from the old repository
70
+
71
+
72
+ <details open>
73
+ <summary><h2><b>Watch the Video Demos</b></h2></summary>
74
+ <p align="center">
75
+ <a href="https://youtube.com/playlist?list=PLG5z9IbwhS5NQT3B2jrg3hxQgilDeZak9&feature=shared">
76
+ <img src="https://raw.githubusercontent.com/Jordan-Pierce/CoralNet-Toolbox/refs/heads/main/figures/toolbox_qt.PNG" alt="Video Title" width="50%">
77
+ </a>
78
+ </p>
79
+ </details>
80
+
81
+ ## **How to Install**
82
+
83
+ ### Anaconda
84
+
85
+ It's recommended to use `Anaconda` to create an environment for the `toolbox`:
86
+ ```bash
87
+ # cmd
88
+
89
+ # Create and activate an environment
90
+ conda create --name coralnet-toolbox python=3.10 -y
91
+ conda activate coralnet-toolbox
92
+ ```
93
+
94
+ ### Install
95
+
96
+ Once this has finished, install the `toolbox`:
97
+ ```bash
98
+ # cmd
99
+
100
+ # Install
101
+ pip install coralnet-toolbox
102
+ ```
103
+
104
+ ### CUDA
105
+
106
+ If you have `CUDA`, you should install the versions of `cuda-nvcc` and `cudatoolkit` that you
107
+ need, and then install the corresponding versions of `torch` and `torchvision`. Below is an example of how that can be
108
+ done using `CUDA` version 11.8:
109
+ ```bash
110
+ # cmd
111
+
112
+ # Example for CUDA 11.8
113
+ conda install nvidia/label/cuda-11.8.0::cuda-nvcc -y
114
+ conda install nvidia/label/cuda-11.8.0::cuda-toolkit -y
115
+
116
+ # Example for torch w/ CUDA 11.8
117
+ pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118 --upgrade
118
+ ```
119
+
120
+ If `CUDA` is installed on your computer, and `torch` was built with it properly, you should see a `๐Ÿ‡` icon in the
121
+ `toolbox` instead of a `๐Ÿข`; if you have multiple `CUDA` devices available, you should see a `๐Ÿš€` icon,
122
+ and if you're using a Mac with `Metal`, you should see an `๐ŸŽ` icon (click on the icon to see the device information).
123
+
124
+ See here for more details on [`cuda-nvcc`](https://anaconda.org/nvidia/cuda-nvcc),
125
+ [`cudatoolkit`](https://anaconda.org/nvidia/cuda-toolkit), and [`torch`](https://pytorch.org/get-started/locally/)
126
+ versions.
127
+
128
+ ### Run
129
+ Finally, you can run the `toolbox` from the command line:
130
+ ```bash
131
+ # cmd
132
+
133
+ # Run
134
+ coralnet-toolbox
135
+ ```
136
+
137
+ ## GitHub Repository
138
+
139
+ If you prefer to clone the repository and run the `toolbox` from the source code, you can do so with the following:
140
+
141
+ ```bash
142
+ # cmd
143
+
144
+ # Create and activate an environment
145
+ conda create --name coralnet-toolbox python=3.10 -y
146
+ conda activate coralnet-toolbox
147
+
148
+ # Clone and enter the repository
149
+ git clone https://github.com/Jordan-Pierce/CoralNet-Toolbox.git
150
+ cd CoralNet-Toolbox
151
+
152
+ # Install the latest
153
+ pip install -e .
154
+
155
+ # Install CUDA requirements (if applicable)
156
+ conda install nvidia/label/cuda-11.8.0::cuda-nvcc -y
157
+ conda install nvidia/label/cuda-11.8.0::cuda-toolkit -y
158
+
159
+ # Example for torch w/ CUDA 11.8
160
+ pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118 --upgrade
161
+
162
+ # Run
163
+ coralnet-toolbox
164
+ ```
165
+
166
+ ## [**About CoralNet**](https://coralnet.ucsd.edu/source/)
167
+ Coral reefs are vital ecosystems that support a wide range of marine life and provide numerous
168
+ benefits to humans. However, they are under threat due to climate change, pollution, overfishing,
169
+ and other factors. CoralNet is a platform designed to aid researchers and scientists in studying
170
+ these important ecosystems and their inhabitants.
171
+
172
+ CoralNet allows users to upload photos of coral reefs and annotate them with detailed information
173
+ about the coral species and other features present in the images. The platform also provides tools
174
+ for analyzing the annotated images, and create patch-based image classifiers.
175
+
176
+ The CoralNet-Toolbox is an unofficial tool developed to augment processes associated with analyses that
177
+ use CoralNet and Coral Point Count (CPCe).
178
+
179
+
180
+ ## **Conclusion**
181
+ In summary, this repository provides a range of tools that can assist with interacting with
182
+ CoralNet and performing various tasks related to analyzing annotated images. These tools can be
183
+ useful for researchers and scientists working with coral reefs, as well as for students and
184
+ hobbyists interested in learning more about these important ecosystems.
185
+
186
+
187
+ ## Citation
188
+
189
+ If used in project or publication, please attribute your use of this repository with the following:
190
+
191
+ ```
192
+ @misc{CoralNet-Toolbox,
193
+ author = {Pierce, Jordan and Edwards, Clinton and Rojano, Sarah and Cook, Sophie and Sweeney, Edward and Costa, Bryan and Vieham, Shay and Battista, Tim},
194
+ title = {CoralNet-Toolbox},
195
+ year = {2023},
196
+ howpublished = {\url{https://github.com/Jordan-Pierce/CoralNet-Toolbox}},
197
+ note = {GitHub repository}
198
+ }
199
+ ```
200
+
201
+ ---
202
+
203
+ ## Disclaimer
204
+
205
+ This repository is a scientific product and is not official communication of the National
206
+ Oceanic and Atmospheric Administration, or the United States Department of Commerce. All NOAA
207
+ GitHub project code is provided on an 'as is' basis and the user assumes responsibility for its
208
+ use. Any claims against the Department of Commerce or Department of Commerce bureaus stemming from
209
+ the use of this GitHub project will be governed by all applicable Federal law. Any reference to
210
+ specific commercial products, processes, or services by service mark, trademark, manufacturer, or
211
+ otherwise, does not constitute or imply their endorsement, recommendation or favoring by the
212
+ Department of Commerce. The Department of Commerce seal and logo, or the seal and logo of a DOC
213
+ bureau, shall not be used in any manner to imply endorsement of any commercial product or activity
214
+ by DOC or the United States Government.
215
+
216
+
217
+ ## License
218
+
219
+ Software code created by U.S. Government employees is not subject to copyright in the United States
220
+ (17 U.S.C. ยง105). The United States/Department of Commerce reserve all rights to seek and obtain
221
+ copyright protection in countries other than the United States for Software authored in its
222
+ entirety by the Department of Commerce. To this end, the Department of Commerce hereby grants to
223
+ Recipient a royalty-free, nonexclusive license to use, copy, and create derivative works of the
224
+ Software outside of the United States.