coralnet-toolbox 0.0.75__py2.py3-none-any.whl → 0.0.76__py2.py3-none-any.whl
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.
- coralnet_toolbox/Annotations/QtPolygonAnnotation.py +57 -12
- coralnet_toolbox/Annotations/QtRectangleAnnotation.py +44 -14
- coralnet_toolbox/Explorer/transformer_models.py +13 -2
- coralnet_toolbox/IO/QtExportMaskAnnotations.py +538 -403
- coralnet_toolbox/Icons/system_monitor.png +0 -0
- coralnet_toolbox/QtEventFilter.py +4 -4
- coralnet_toolbox/QtMainWindow.py +104 -64
- coralnet_toolbox/QtProgressBar.py +1 -0
- coralnet_toolbox/QtSystemMonitor.py +370 -0
- coralnet_toolbox/Results/ConvertResults.py +14 -8
- coralnet_toolbox/Results/ResultsProcessor.py +3 -2
- coralnet_toolbox/SAM/QtDeployGenerator.py +1 -1
- coralnet_toolbox/SAM/QtDeployPredictor.py +10 -0
- coralnet_toolbox/SeeAnything/QtDeployGenerator.py +15 -10
- coralnet_toolbox/SeeAnything/QtDeployPredictor.py +10 -6
- coralnet_toolbox/Tile/QtTileBatchInference.py +4 -4
- coralnet_toolbox/Tools/QtSAMTool.py +140 -91
- coralnet_toolbox/Transformers/Models/GroundingDINO.py +72 -0
- coralnet_toolbox/Transformers/Models/OWLViT.py +72 -0
- coralnet_toolbox/Transformers/Models/OmDetTurbo.py +68 -0
- coralnet_toolbox/Transformers/Models/QtBase.py +120 -0
- coralnet_toolbox/{AutoDistill → Transformers}/Models/__init__.py +1 -1
- coralnet_toolbox/{AutoDistill → Transformers}/QtBatchInference.py +15 -15
- coralnet_toolbox/{AutoDistill → Transformers}/QtDeployModel.py +18 -16
- coralnet_toolbox/{AutoDistill → Transformers}/__init__.py +1 -1
- coralnet_toolbox/__init__.py +1 -1
- coralnet_toolbox/utilities.py +0 -15
- {coralnet_toolbox-0.0.75.dist-info → coralnet_toolbox-0.0.76.dist-info}/METADATA +9 -9
- {coralnet_toolbox-0.0.75.dist-info → coralnet_toolbox-0.0.76.dist-info}/RECORD +33 -31
- coralnet_toolbox/AutoDistill/Models/GroundingDINO.py +0 -81
- coralnet_toolbox/AutoDistill/Models/OWLViT.py +0 -76
- coralnet_toolbox/AutoDistill/Models/OmDetTurbo.py +0 -75
- coralnet_toolbox/AutoDistill/Models/QtBase.py +0 -112
- {coralnet_toolbox-0.0.75.dist-info → coralnet_toolbox-0.0.76.dist-info}/WHEEL +0 -0
- {coralnet_toolbox-0.0.75.dist-info → coralnet_toolbox-0.0.76.dist-info}/entry_points.txt +0 -0
- {coralnet_toolbox-0.0.75.dist-info → coralnet_toolbox-0.0.76.dist-info}/licenses/LICENSE.txt +0 -0
- {coralnet_toolbox-0.0.75.dist-info → coralnet_toolbox-0.0.76.dist-info}/top_level.txt +0 -0
@@ -18,6 +18,7 @@ from PyQt5.QtWidgets import (QApplication, QComboBox, QDialog,
|
|
18
18
|
from coralnet_toolbox.QtProgressBar import ProgressBar
|
19
19
|
|
20
20
|
from coralnet_toolbox.Results import ResultsProcessor
|
21
|
+
from coralnet_toolbox.Results import ConvertResults
|
21
22
|
from coralnet_toolbox.Results import MapResults
|
22
23
|
|
23
24
|
from coralnet_toolbox.utilities import rasterio_open
|
@@ -33,13 +34,13 @@ from coralnet_toolbox.Icons import get_icon
|
|
33
34
|
|
34
35
|
class DeployModelDialog(QDialog):
|
35
36
|
"""
|
36
|
-
Dialog for deploying and managing
|
37
|
+
Dialog for deploying and managing Transformers models.
|
37
38
|
Allows users to load, configure, and deactivate models, as well as make predictions on images.
|
38
39
|
"""
|
39
40
|
|
40
41
|
def __init__(self, main_window, parent=None):
|
41
42
|
"""
|
42
|
-
Initialize the
|
43
|
+
Initialize the TransformersDeployModelDialog.
|
43
44
|
|
44
45
|
Args:
|
45
46
|
main_window: The main application window.
|
@@ -52,7 +53,7 @@ class DeployModelDialog(QDialog):
|
|
52
53
|
self.annotation_window = main_window.annotation_window
|
53
54
|
|
54
55
|
self.setWindowIcon(get_icon("coral.png"))
|
55
|
-
self.setWindowTitle("
|
56
|
+
self.setWindowTitle("Transformers Deploy Model (Ctrl + 6)")
|
56
57
|
self.resize(400, 325)
|
57
58
|
|
58
59
|
# Initialize variables
|
@@ -66,6 +67,8 @@ class DeployModelDialog(QDialog):
|
|
66
67
|
self.ontology = None
|
67
68
|
self.class_mapping = {}
|
68
69
|
self.ontology_pairs = []
|
70
|
+
|
71
|
+
self.task = 'detect'
|
69
72
|
|
70
73
|
# Create the layout
|
71
74
|
self.layout = QVBoxLayout(self)
|
@@ -422,8 +425,6 @@ class DeployModelDialog(QDialog):
|
|
422
425
|
progress_bar.close()
|
423
426
|
# Restore cursor
|
424
427
|
QApplication.restoreOverrideCursor()
|
425
|
-
# Exit the dialog box
|
426
|
-
self.accept()
|
427
428
|
|
428
429
|
def load_new_model(self, model_name):
|
429
430
|
"""
|
@@ -433,8 +434,17 @@ class DeployModelDialog(QDialog):
|
|
433
434
|
model_name: Name of the model to load.
|
434
435
|
uncertainty_thresh: Threshold for uncertainty.
|
435
436
|
"""
|
437
|
+
|
438
|
+
# Clear the model
|
439
|
+
self.loaded_model = None
|
440
|
+
self.model_name = None
|
441
|
+
|
442
|
+
# Clear cache
|
443
|
+
gc.collect()
|
444
|
+
torch.cuda.empty_cache()
|
445
|
+
|
436
446
|
if "GroundingDINO" in model_name:
|
437
|
-
from coralnet_toolbox.
|
447
|
+
from coralnet_toolbox.Transformers.Models.GroundingDINO import GroundingDINOModel
|
438
448
|
|
439
449
|
model = model_name.split("-")[1].strip()
|
440
450
|
self.model_name = model_name
|
@@ -443,14 +453,14 @@ class DeployModelDialog(QDialog):
|
|
443
453
|
device=self.main_window.device)
|
444
454
|
|
445
455
|
elif "OmDetTurbo" in model_name:
|
446
|
-
from coralnet_toolbox.
|
456
|
+
from coralnet_toolbox.Transformers.Models.OmDetTurbo import OmDetTurboModel
|
447
457
|
|
448
458
|
self.model_name = model_name
|
449
459
|
self.loaded_model = OmDetTurboModel(ontology=self.ontology,
|
450
460
|
device=self.main_window.device)
|
451
461
|
|
452
462
|
elif "OWLViT" in model_name:
|
453
|
-
from coralnet_toolbox.
|
463
|
+
from coralnet_toolbox.Transformers.Models.OWLViT import OWLViTModel
|
454
464
|
|
455
465
|
self.model_name = model_name
|
456
466
|
self.loaded_model = OWLViTModel(ontology=self.ontology,
|
@@ -495,7 +505,6 @@ class DeployModelDialog(QDialog):
|
|
495
505
|
continue
|
496
506
|
|
497
507
|
results = self._apply_model(inputs)
|
498
|
-
results = self._update_results(results_processor, results, inputs, image_path)
|
499
508
|
results = self._apply_sam(results, image_path)
|
500
509
|
self._process_results(results_processor, results, image_path)
|
501
510
|
|
@@ -553,13 +562,6 @@ class DeployModelDialog(QDialog):
|
|
553
562
|
|
554
563
|
return results_list
|
555
564
|
|
556
|
-
def _update_results(self, results_processor, results, inputs, image_path):
|
557
|
-
"""Update the results to match Ultralytics format."""
|
558
|
-
return [results_processor.from_supervision(results,
|
559
|
-
inputs,
|
560
|
-
image_path,
|
561
|
-
self.class_mapping)]
|
562
|
-
|
563
565
|
def _apply_sam(self, results_list, image_path):
|
564
566
|
"""Apply SAM to the results if needed."""
|
565
567
|
# Check if SAM model is deployed and loaded
|
coralnet_toolbox/__init__.py
CHANGED
coralnet_toolbox/utilities.py
CHANGED
@@ -30,21 +30,6 @@ from coralnet_toolbox.QtProgressBar import ProgressBar
|
|
30
30
|
# ----------------------------------------------------------------------------------------------------------------------
|
31
31
|
|
32
32
|
|
33
|
-
def get_available_device():
|
34
|
-
"""
|
35
|
-
Get available devices
|
36
|
-
|
37
|
-
:return:
|
38
|
-
"""
|
39
|
-
devices = ['cpu',]
|
40
|
-
if torch.cuda.is_available():
|
41
|
-
for i in range(torch.cuda.device_count()):
|
42
|
-
devices.append(f'cuda:{i}')
|
43
|
-
if torch.backends.mps.is_available():
|
44
|
-
devices.append('mps')
|
45
|
-
return devices
|
46
|
-
|
47
|
-
|
48
33
|
@lru_cache(maxsize=32)
|
49
34
|
def rasterio_open(image_path):
|
50
35
|
"""
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: coralnet-toolbox
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.76
|
4
4
|
Summary: Tools for annotating and developing ML models for benthic imagery
|
5
5
|
Author-email: Jordan Pierce <jordan.pierce@noaa.gov>
|
6
6
|
License: MIT License
|
@@ -16,7 +16,7 @@ License-File: LICENSE.txt
|
|
16
16
|
Requires-Dist: PyQt5>=5.15.11
|
17
17
|
Requires-Dist: pyqtdarktheme
|
18
18
|
Requires-Dist: pyqtgraph
|
19
|
-
Requires-Dist: ultralytics>=8.3.
|
19
|
+
Requires-Dist: ultralytics>=8.3.191
|
20
20
|
Requires-Dist: lap>=0.5.12
|
21
21
|
Requires-Dist: open-clip-torch>=2.20.0
|
22
22
|
Requires-Dist: supervision>=0.24.0
|
@@ -27,7 +27,7 @@ Requires-Dist: pycocotools
|
|
27
27
|
Requires-Dist: ujson
|
28
28
|
Requires-Dist: timm==0.9.2
|
29
29
|
Requires-Dist: autodistill
|
30
|
-
Requires-Dist: transformers>=4.
|
30
|
+
Requires-Dist: transformers>=4.56.0
|
31
31
|
Requires-Dist: hf_xet
|
32
32
|
Requires-Dist: x-segment-anything>=0.0.8
|
33
33
|
Requires-Dist: yolo-tiling>=0.0.19
|
@@ -39,6 +39,8 @@ Requires-Dist: beautifulsoup4>=4.12.2
|
|
39
39
|
Requires-Dist: webdriver_manager
|
40
40
|
Requires-Dist: dill
|
41
41
|
Requires-Dist: seaborn
|
42
|
+
Requires-Dist: GPUtil
|
43
|
+
Requires-Dist: psutil
|
42
44
|
Provides-Extra: all
|
43
45
|
Requires-Dist: coralnet-toolbox[extra]; extra == "all"
|
44
46
|
Dynamic: license-file
|
@@ -114,6 +116,7 @@ For a complete installation guide (including CUDA setup), see the [Installation
|
|
114
116
|
| **Overview** | Get the big picture | [📋 Read More](https://jordan-pierce.github.io/CoralNet-Toolbox/overview) |
|
115
117
|
| **Installation** | Detailed setup instructions | [⚙️ Setup Guide](https://jordan-pierce.github.io/CoralNet-Toolbox/installation) |
|
116
118
|
| **Usage** | Learn the tools | [🛠️ User Manual](https://jordan-pierce.github.io/CoralNet-Toolbox/usage) |
|
119
|
+
| **Hot Keys** | Keyboard shortcuts | [⌨️ Shortcuts](https://jordan-pierce.github.io/CoralNet-Toolbox/hot-keys) |
|
117
120
|
| **Classification** | Community tutorial | [🧠 AI Tutorial](https://jordan-pierce.github.io/CoralNet-Toolbox/classify) |
|
118
121
|
|
119
122
|
</div>
|
@@ -179,7 +182,7 @@ The toolbox integrates state-of-the-art models for efficient annotation workflow
|
|
179
182
|
| **Framework** | **Models** | **Capability** |
|
180
183
|
|:---:|:---:|:---:|
|
181
184
|
| **YOLOE** | See Anything | Visual prompt detection |
|
182
|
-
| **
|
185
|
+
| **Transformers** | Grounding DINO • OWLViT • OmDetTurbo | Zero-shot detection |
|
183
186
|
|
184
187
|
</div>
|
185
188
|
|
@@ -277,12 +280,9 @@ uv pip install coralnet-toolbox
|
|
277
280
|
### 🚀 **Step 3: GPU Acceleration (Optional)**
|
278
281
|
For CUDA-enabled systems:
|
279
282
|
```bash
|
280
|
-
# Example for CUDA
|
281
|
-
conda install nvidia/label/cuda-11.8.0::cuda-nvcc -y
|
282
|
-
conda install nvidia/label/cuda-11.8.0::cuda-toolkit -y
|
283
|
-
|
283
|
+
# Example for CUDA 12.9
|
284
284
|
# Install PyTorch with CUDA support
|
285
|
-
uv pip install torch torchvision --index-url https://download.pytorch.org/whl/
|
285
|
+
uv pip install torch torchvision --index-url https://download.pytorch.org/whl/cu129 --upgrade
|
286
286
|
```
|
287
287
|
|
288
288
|
### 🏃♂️ **Step 4: Launch**
|
@@ -1,30 +1,23 @@
|
|
1
1
|
coralnet_toolbox/QtAnnotationWindow.py,sha256=YpE4e5gu0EcTqtzRNUcFqZl5SIjDaPK_FWxtFavfm4k,40950
|
2
2
|
coralnet_toolbox/QtConfidenceWindow.py,sha256=L5hR23uW91GpqnsNS9R1XF3zCTe2aU7w0iDoQMV0oyE,16190
|
3
|
-
coralnet_toolbox/QtEventFilter.py,sha256=
|
3
|
+
coralnet_toolbox/QtEventFilter.py,sha256=utGSwtKlKl-3qepN6aaVQm4sL513bfuJpA3-3VTqnDU,7701
|
4
4
|
coralnet_toolbox/QtImageWindow.py,sha256=B_38VR_0QARyo05UEvInmQKd3N74Dfb0g_QDeGCTUuY,51291
|
5
5
|
coralnet_toolbox/QtLabelWindow.py,sha256=O-mLtE6ycuuGloYYZX0Z9JYZtsBMmspqNeJWslrjfFc,51419
|
6
|
-
coralnet_toolbox/QtMainWindow.py,sha256=
|
6
|
+
coralnet_toolbox/QtMainWindow.py,sha256=4Znd0fezebQ-cWOKHjHTPVfj_DPH45A7tnUfxUEiqOQ,123615
|
7
7
|
coralnet_toolbox/QtPatchSampling.py,sha256=Ehj06auBGfQwIruLNYQjF8eFOCpl8G72p42UXXb2mUo,29013
|
8
|
-
coralnet_toolbox/QtProgressBar.py,sha256=
|
8
|
+
coralnet_toolbox/QtProgressBar.py,sha256=L9V1dD9NQ5K-IK2NhJtESoieWGd1ULLsACEXuUDE4Ck,7922
|
9
|
+
coralnet_toolbox/QtSystemMonitor.py,sha256=KSsUZ11GcHPH0Q7Pl8TUsFSB_jnWzNqGmtnf7IYYXpQ,16567
|
9
10
|
coralnet_toolbox/QtWorkArea.py,sha256=YXRvHQKpWUtWyv_o9lZ8rmxfm28dUOG9pmMUeimDhQ4,13578
|
10
|
-
coralnet_toolbox/__init__.py,sha256=
|
11
|
+
coralnet_toolbox/__init__.py,sha256=VV5fKKSOZQ99ek8daqcG9QSiYWU3u7JvjF5L9yq8tfA,207
|
11
12
|
coralnet_toolbox/main.py,sha256=6j2B_1reC_KDmqvq1C0fB-UeSEm8eeJOozp2f4XXMLQ,1573
|
12
|
-
coralnet_toolbox/utilities.py,sha256=
|
13
|
+
coralnet_toolbox/utilities.py,sha256=Up6_z0n-8p7KccFLgBvlSnhfgX8B_mVTSmIfajpkkug,31173
|
13
14
|
coralnet_toolbox/Annotations/QtAnnotation.py,sha256=4KxqDe_WPMGK18OYHZ1NqWzV87ARv8MnLAQdHFXo-Yg,27527
|
14
15
|
coralnet_toolbox/Annotations/QtMaskAnnotation.py,sha256=Hs8p-Lxv4OYqcx4Y7dayer1KxTaX-G0kuQe-W2JuGIE,16269
|
15
16
|
coralnet_toolbox/Annotations/QtMultiPolygonAnnotation.py,sha256=u0vPQPeaBCEdw5lMFygpBbjDKDSjvtV7Jkj03MDfj8M,16463
|
16
17
|
coralnet_toolbox/Annotations/QtPatchAnnotation.py,sha256=huoCsPloSA5uCZxG7pwIoO02GcHFDwW8-VohLxbCVnY,16608
|
17
|
-
coralnet_toolbox/Annotations/QtPolygonAnnotation.py,sha256=
|
18
|
-
coralnet_toolbox/Annotations/QtRectangleAnnotation.py,sha256=
|
18
|
+
coralnet_toolbox/Annotations/QtPolygonAnnotation.py,sha256=NYzca916tfZDOxbP9TBC5CaFEoiMiZec8QkwHtpfGLQ,35198
|
19
|
+
coralnet_toolbox/Annotations/QtRectangleAnnotation.py,sha256=F49Cc3MyPPHQp-qhfjsFACE5ZRwT4Hsq0jDi8nt9iVg,22492
|
19
20
|
coralnet_toolbox/Annotations/__init__.py,sha256=bpMldC70tT_lzMrOdBNDkEhG9dCX3tXEBd48IrcUg3E,419
|
20
|
-
coralnet_toolbox/AutoDistill/QtBatchInference.py,sha256=k871aW3XRX8kc4BDaS1aipbPh9WOZxgmilF2c4KOdVA,5646
|
21
|
-
coralnet_toolbox/AutoDistill/QtDeployModel.py,sha256=Fycm7wuydUfr1E2CUy00ridiI2JaNDZqAeoVB_HVydY,25923
|
22
|
-
coralnet_toolbox/AutoDistill/__init__.py,sha256=-cJSCr3HSVcybbkvdSZY_zz9EDLESq9A3gisHu3gIgM,206
|
23
|
-
coralnet_toolbox/AutoDistill/Models/GroundingDINO.py,sha256=xG20nLOrKjtzRhZznIIdwFXxBJ7RCeQ7h1z0V0J6trE,2781
|
24
|
-
coralnet_toolbox/AutoDistill/Models/OWLViT.py,sha256=disVxSQ80sS4SVYdwrQocFP_LN6YDQQhzfeORWe4veU,2572
|
25
|
-
coralnet_toolbox/AutoDistill/Models/OmDetTurbo.py,sha256=i2k9C0U8CzojKvv58CE_4wvquvR_JHUHRCe93Yzb5QQ,2526
|
26
|
-
coralnet_toolbox/AutoDistill/Models/QtBase.py,sha256=P9dzGgzOZJZr-hQltAIswWqUyfaUP40GcXc_X11GOv8,4220
|
27
|
-
coralnet_toolbox/AutoDistill/Models/__init__.py,sha256=3woEIkWjoNLlZhNijnyAwAimsBoy2AGCt_tks3Y4q6M,259
|
28
21
|
coralnet_toolbox/BreakTime/QtBreakout.py,sha256=KYlhLMHF_5HVkjR8JDjbNu8CB6SHsEpECAywXqWVw10,54763
|
29
22
|
coralnet_toolbox/BreakTime/QtSnake.py,sha256=XxmV64A_1avYf1uC_fXQpOZV3kCetz3CqboQsFwSIJk,22398
|
30
23
|
coralnet_toolbox/BreakTime/__init__.py,sha256=7d_CMXp7T872NV-a6xaGU4oq5wjWAWGyrnd-YD3BDJo,150
|
@@ -42,13 +35,13 @@ coralnet_toolbox/Explorer/QtFeatureStore.py,sha256=3VwGezs1stmu65Z4ZQpvY27rGEIJq
|
|
42
35
|
coralnet_toolbox/Explorer/QtSettingsWidgets.py,sha256=wwgMje5hga6GpJsAwFYXqd3G_Hew0oKmtu3tEr061Hs,36042
|
43
36
|
coralnet_toolbox/Explorer/QtViewers.py,sha256=2qtzxSQNsRoHYUdm2t046QCUJd51pKOts5DNtgMRmUY,69408
|
44
37
|
coralnet_toolbox/Explorer/__init__.py,sha256=wZPhf2oaUUyIQ2WK48Aj-4q1ENIZG2dGl1HF_mjhI6w,116
|
45
|
-
coralnet_toolbox/Explorer/transformer_models.py,sha256=
|
38
|
+
coralnet_toolbox/Explorer/transformer_models.py,sha256=yNgGoYEIWcSgCnCOSKdAatG4M6GRbtf4pVmUWGPxvWo,2878
|
46
39
|
coralnet_toolbox/Explorer/yolo_models.py,sha256=GicZrypDE699gut5KEW68Ui_KiTk4Ojt1uRkyDWJVI8,3473
|
47
40
|
coralnet_toolbox/IO/QtExportAnnotations.py,sha256=xeaS0BukC3cpkBIGT9DXRqHmvHhp-vOU47h6EoANpNg,4474
|
48
41
|
coralnet_toolbox/IO/QtExportCoralNetAnnotations.py,sha256=4royhF63EmeOlSIBX389EUjjvE-SF44_maW6qm52mdA,2778
|
49
42
|
coralnet_toolbox/IO/QtExportGeoJSONAnnotations.py,sha256=9HkHjQTRtH4VnYa50c5pyqQz30R_6gIH5i3xFF6kDWI,27759
|
50
43
|
coralnet_toolbox/IO/QtExportLabels.py,sha256=Vsav0wd1EK4g065aEWvxyNuvvM9BFB7UXxz6IJzwVBU,2588
|
51
|
-
coralnet_toolbox/IO/QtExportMaskAnnotations.py,sha256=
|
44
|
+
coralnet_toolbox/IO/QtExportMaskAnnotations.py,sha256=7prXGsFFXjF1dvaybEqmwBO-N1th0c-s8GsedmyB_RQ,32651
|
52
45
|
coralnet_toolbox/IO/QtExportTagLabAnnotations.py,sha256=JL4r1a6_PUjCzWQjMxOzxtkF2gyqIttpD14OxEcW-dA,11330
|
53
46
|
coralnet_toolbox/IO/QtExportTagLabLabels.py,sha256=e6OL8UNtLRAJrovfs1cxVz0k2bHuJXdVmO-A0OVpgSk,3164
|
54
47
|
coralnet_toolbox/IO/QtExportViscoreAnnotations.py,sha256=AUTzVB-N9uwlQPSds74YXyPVZzEHph7HDq01R88OBJY,19166
|
@@ -93,6 +86,7 @@ coralnet_toolbox/Icons/rocket.png,sha256=iMlRGlrNBS_dNBD2XIpN4RSrphCGbw_Ds1AYJ01
|
|
93
86
|
coralnet_toolbox/Icons/select.png,sha256=twnMIO9ylQYjvyGnAR28V6K3ds6xpArZQTrvf0uxS6g,1896
|
94
87
|
coralnet_toolbox/Icons/settings.png,sha256=rklROt3oKrfEk_qwN9J-JwvKok08iOkZy3OD4oNsLJQ,1376
|
95
88
|
coralnet_toolbox/Icons/snake.png,sha256=cwcekSkXwDi_fhtTU48u7FN4bIybbY53cWK0n7-IN9A,2361
|
89
|
+
coralnet_toolbox/Icons/system_monitor.png,sha256=ui6377kyFMHLnbfSFiE5NAJVnC16tku4RDi7Rv5vJ-0,739
|
96
90
|
coralnet_toolbox/Icons/target.png,sha256=jzb-S_sXWT8MfbvefhDNsuTdAZgV2nGf1ieawaCkByM,1702
|
97
91
|
coralnet_toolbox/Icons/tile.png,sha256=WiXKBpWVBfPv7gC8dnkc_gW3wuLQmLUyxYMWEM-G9ZU,382
|
98
92
|
coralnet_toolbox/Icons/transparent.png,sha256=ZkuGkVzh6zLVNau1Wj166-TtUlbCRqJObGt4vxMxnLk,1098
|
@@ -183,21 +177,21 @@ coralnet_toolbox/Rasters/RasterManager.py,sha256=GuTeuty3x4k8DWZ34FQ4BTNwRfjWu0l
|
|
183
177
|
coralnet_toolbox/Rasters/RasterTableModel.py,sha256=8ebirBkTUSy5Rdsoq10sqzDQBoYCH_Hu40dPiUhtlzc,15311
|
184
178
|
coralnet_toolbox/Rasters/__init__.py,sha256=Pi88uDQbtWxwHfJFdlsvbkwGNhtlyM_013l8bbJlFfw,428
|
185
179
|
coralnet_toolbox/Results/CombineResults.py,sha256=QrHyKhMrjNDtQ98PQabUflHhyv_8KXTGqU30tw9amV8,4523
|
186
|
-
coralnet_toolbox/Results/ConvertResults.py,sha256=
|
180
|
+
coralnet_toolbox/Results/ConvertResults.py,sha256=f9L1C7JQMVt7x2eSG4CAqpUDRhhc6eQZvTaqCiGUWmk,6310
|
187
181
|
coralnet_toolbox/Results/MapResults.py,sha256=sDieekB93RVKvD-9mW1zRsHOs85shYVIQklt9-kFJZI,8088
|
188
182
|
coralnet_toolbox/Results/Masks.py,sha256=C-zoobRaWXP_QdGcL7ZgSxytHOBdHIBUbQuGnoMZthE,5183
|
189
|
-
coralnet_toolbox/Results/ResultsProcessor.py,sha256=
|
183
|
+
coralnet_toolbox/Results/ResultsProcessor.py,sha256=WPyq4nETrnk9WpMaeFw0rlQRFqZkzAYz_qttT3_jaoA,17332
|
190
184
|
coralnet_toolbox/Results/__init__.py,sha256=WPdlq8aXzjrdQo5T3UqFh7jxge33iNEHiSRAmm0eJuw,630
|
191
185
|
coralnet_toolbox/SAM/QtBatchInference.py,sha256=UyuYLfPF4JrOmmuMOzshbKDEEribV669d9LURmuu6gg,6866
|
192
|
-
coralnet_toolbox/SAM/QtDeployGenerator.py,sha256=
|
193
|
-
coralnet_toolbox/SAM/QtDeployPredictor.py,sha256=
|
186
|
+
coralnet_toolbox/SAM/QtDeployGenerator.py,sha256=UtJH1ZQ9g_Wqa4s09PBMCrmNRpqUZZaTMpE7lfH_Xq0,26491
|
187
|
+
coralnet_toolbox/SAM/QtDeployPredictor.py,sha256=7jOFFnNqY7Ylr1IKjTI_YSrPYgCxHpI4ZBda7Kp806g,24413
|
194
188
|
coralnet_toolbox/SAM/__init__.py,sha256=Zxd75pFMrt5DfSmNNVSsQeCucIQ2rVaEiS0hT_OVIMM,293
|
195
189
|
coralnet_toolbox/SeeAnything/QtBatchInference.py,sha256=k3aftVzva84yATB4Su5DSI0lhkHDggUg3mVAx4AHmjw,7134
|
196
|
-
coralnet_toolbox/SeeAnything/QtDeployGenerator.py,sha256=
|
197
|
-
coralnet_toolbox/SeeAnything/QtDeployPredictor.py,sha256=
|
190
|
+
coralnet_toolbox/SeeAnything/QtDeployGenerator.py,sha256=5wG2XKhHzdNXjmG3u5Npc7TGBfFLMWPHzYQ12NlZvd0,68578
|
191
|
+
coralnet_toolbox/SeeAnything/QtDeployPredictor.py,sha256=sfaaJoDFM2ntdqD0CXsTSHRZIuCRfviVg4vqhG0sGdI,26804
|
198
192
|
coralnet_toolbox/SeeAnything/QtTrainModel.py,sha256=dQ6ZkeIr1migU-edGO-gQMENVP4o7WJsIANlSVhFK8k,28031
|
199
193
|
coralnet_toolbox/SeeAnything/__init__.py,sha256=4OgG9-aQ6_RZ942-Ift_q-kkp14kObMT4lDIIx9YSxQ,366
|
200
|
-
coralnet_toolbox/Tile/QtTileBatchInference.py,sha256=
|
194
|
+
coralnet_toolbox/Tile/QtTileBatchInference.py,sha256=oo7NeqEwwmxMEGBMo5v2SCnyQwJYq9pg-9yj3G_-vaM,10727
|
201
195
|
coralnet_toolbox/Tile/QtTileCreation.py,sha256=Cw6q0ZVXx0hU4uMuXA3OZ3_5bKu6oQgnlMFwaXSZbS0,39963
|
202
196
|
coralnet_toolbox/Tile/__init__.py,sha256=BlV-1bO9u-olfNAIvukUMPRzlw8dx-ayjrjMRQ-bSsk,463
|
203
197
|
coralnet_toolbox/Tile/TileDataset/QtBase.py,sha256=5zWtnNVbril0i3aVFv5q0VyMYcFP0Qb09ylqQ4smBXw,18623
|
@@ -212,7 +206,7 @@ coralnet_toolbox/Tools/QtPatchTool.py,sha256=57vFeR2jQ_VQRlMEIC_mH8NigUqOlVvmhaV
|
|
212
206
|
coralnet_toolbox/Tools/QtPolygonTool.py,sha256=mQB2NuGGUmo7W4Pf8DJI9PDa3PW7Hu2nOMf4uTyWAq8,11236
|
213
207
|
coralnet_toolbox/Tools/QtRectangleTool.py,sha256=VJWKktDiDN1TUZATRSe_1kjppFjV0AMYDZ8bK78dCXc,8672
|
214
208
|
coralnet_toolbox/Tools/QtResizeSubTool.py,sha256=cWJDx8PEtxoCLQKuyEyZ6ccBzFKau9j1djrSSpDgaq8,6524
|
215
|
-
coralnet_toolbox/Tools/QtSAMTool.py,sha256=
|
209
|
+
coralnet_toolbox/Tools/QtSAMTool.py,sha256=c719q573SRDxr5mLxNB7K5YNvZnWQYcFxzdm_I4f08Y,36529
|
216
210
|
coralnet_toolbox/Tools/QtSeeAnythingTool.py,sha256=ZjqaM0At7MCB5R0wgibph75FkH2ZIePfRnXQUQko6wE,38515
|
217
211
|
coralnet_toolbox/Tools/QtSelectSubTool.py,sha256=_FIjLhnEVY19Q87jhRKXGdghNfMBxxy_sECAIUo0BZA,3294
|
218
212
|
coralnet_toolbox/Tools/QtSelectTool.py,sha256=qAXRIGmjdzWjaH6GwhvlQSodZuFa6OnyckzNVfVDG2w,20983
|
@@ -222,9 +216,17 @@ coralnet_toolbox/Tools/QtTool.py,sha256=2MCjT151gYBN8KbsK0GX4WOrEg1uw3oeSkp7Elw1
|
|
222
216
|
coralnet_toolbox/Tools/QtWorkAreaTool.py,sha256=ApsIiEbkyWFWKW6qnFPPnL_Wgs2xa_Edif5kZU5_n8M,22733
|
223
217
|
coralnet_toolbox/Tools/QtZoomTool.py,sha256=F9CAoABv1jxcUS7dyIh1FYjgjOXYRI1xtBPNIR1g62o,4041
|
224
218
|
coralnet_toolbox/Tools/__init__.py,sha256=UYStZw1eA_yJ07IVli1MYSvk0pSCs1aS169LcQo630s,867
|
225
|
-
coralnet_toolbox
|
226
|
-
coralnet_toolbox
|
227
|
-
coralnet_toolbox
|
228
|
-
coralnet_toolbox
|
229
|
-
coralnet_toolbox
|
230
|
-
coralnet_toolbox
|
219
|
+
coralnet_toolbox/Transformers/QtBatchInference.py,sha256=Adry1H-oIMV6Ppo8yRJRx79oeG1yUthT5jqszj7EJ20,5764
|
220
|
+
coralnet_toolbox/Transformers/QtDeployModel.py,sha256=oH82XtP07f0n6fUhlPADUbFujTJt0ppSvitX15KeuaQ,25669
|
221
|
+
coralnet_toolbox/Transformers/__init__.py,sha256=Oef7mKgwlK_hi5ZtXlRTvpyKhf98JPwBELWE3zjrp9U,207
|
222
|
+
coralnet_toolbox/Transformers/Models/GroundingDINO.py,sha256=V77tapTLsXtTISbqsV9ZSGYgkJQTI1RKsT95QagYhqk,2747
|
223
|
+
coralnet_toolbox/Transformers/Models/OWLViT.py,sha256=l9R9XKN7grw6gF7EC9DWxF5sUsApLfi0WO-zj6pVVHU,2781
|
224
|
+
coralnet_toolbox/Transformers/Models/OmDetTurbo.py,sha256=vaXaQNqBCvnEFcPMt6x_EJI-gf-Wy3eYZPak7a527WY,2592
|
225
|
+
coralnet_toolbox/Transformers/Models/QtBase.py,sha256=AYGTOxopOXYrHSDWAenvyxAAgqHbQs3zIox-c4BX9YQ,4533
|
226
|
+
coralnet_toolbox/Transformers/Models/__init__.py,sha256=icJnQkt2vZksubEJuih0sT0q2vLR_Y-12WuTGquvxt8,260
|
227
|
+
coralnet_toolbox-0.0.76.dist-info/licenses/LICENSE.txt,sha256=AURacZ_G_PZKqqPQ9VB9Sqegblk67RNgWSGAYKwXXMY,521
|
228
|
+
coralnet_toolbox-0.0.76.dist-info/METADATA,sha256=MlZwkwAUGZWKcCzQVqIpHkuoenuz2arqnEIzviPsFps,15381
|
229
|
+
coralnet_toolbox-0.0.76.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
|
230
|
+
coralnet_toolbox-0.0.76.dist-info/entry_points.txt,sha256=oEeMoDlJ_2lq95quOeDHIx9hZpubUlSo80OLtgbcrbM,63
|
231
|
+
coralnet_toolbox-0.0.76.dist-info/top_level.txt,sha256=SMWPh4_9JfB8zVpPOOvjucV2_B_hvWW7bNWmMjG0LsY,17
|
232
|
+
coralnet_toolbox-0.0.76.dist-info/RECORD,,
|
@@ -1,81 +0,0 @@
|
|
1
|
-
from dataclasses import dataclass
|
2
|
-
|
3
|
-
import cv2
|
4
|
-
import numpy as np
|
5
|
-
|
6
|
-
import supervision as sv
|
7
|
-
|
8
|
-
from transformers import AutoProcessor, AutoModelForZeroShotObjectDetection
|
9
|
-
|
10
|
-
from autodistill.detection import CaptionOntology
|
11
|
-
from autodistill.helpers import load_image
|
12
|
-
|
13
|
-
from coralnet_toolbox.AutoDistill.Models.QtBase import QtBaseModel
|
14
|
-
|
15
|
-
|
16
|
-
# ----------------------------------------------------------------------------------------------------------------------
|
17
|
-
# Classes
|
18
|
-
# ----------------------------------------------------------------------------------------------------------------------
|
19
|
-
|
20
|
-
|
21
|
-
@dataclass
|
22
|
-
class GroundingDINOModel(QtBaseModel):
|
23
|
-
def __init__(self, ontology: CaptionOntology, model="SwinB", device: str = "cpu"):
|
24
|
-
super().__init__(ontology, device)
|
25
|
-
|
26
|
-
if model == "SwinB":
|
27
|
-
model_name = "IDEA-Research/grounding-dino-base"
|
28
|
-
else:
|
29
|
-
model_name = "IDEA-Research/grounding-dino-tiny"
|
30
|
-
|
31
|
-
self.processor = AutoProcessor.from_pretrained(model_name, use_fast=True)
|
32
|
-
self.model = AutoModelForZeroShotObjectDetection.from_pretrained(model_name).to(self.device)
|
33
|
-
|
34
|
-
def _process_predictions(self, image, texts, class_idx_mapper, confidence):
|
35
|
-
"""Process model predictions for a single image."""
|
36
|
-
inputs = self.processor(text=texts, images=image, return_tensors="pt").to(self.device)
|
37
|
-
outputs = self.model(**inputs)
|
38
|
-
|
39
|
-
results = self.processor.post_process_grounded_object_detection(
|
40
|
-
outputs,
|
41
|
-
inputs.input_ids,
|
42
|
-
box_threshold=confidence,
|
43
|
-
text_threshold=confidence,
|
44
|
-
target_sizes=[image.shape[:2]],
|
45
|
-
)[0]
|
46
|
-
|
47
|
-
boxes, scores, labels = (
|
48
|
-
results["boxes"],
|
49
|
-
results["scores"],
|
50
|
-
results["text_labels"],
|
51
|
-
)
|
52
|
-
|
53
|
-
final_boxes, final_scores, final_labels = [], [], []
|
54
|
-
|
55
|
-
for box, score, label in zip(boxes, scores, labels):
|
56
|
-
try:
|
57
|
-
box = box.detach().cpu().numpy().astype(int).tolist()
|
58
|
-
score = score.item()
|
59
|
-
# Grounding Dino issues...
|
60
|
-
label = class_idx_mapper[label.split(" ")[0]]
|
61
|
-
|
62
|
-
# Amplify scores
|
63
|
-
if score < confidence:
|
64
|
-
continue
|
65
|
-
|
66
|
-
final_boxes.append(box)
|
67
|
-
final_scores.append(score)
|
68
|
-
final_labels.append(label)
|
69
|
-
|
70
|
-
except Exception as e:
|
71
|
-
print(f"Error: Issue converting predictions:\n{e}")
|
72
|
-
continue
|
73
|
-
|
74
|
-
if len(final_boxes) == 0:
|
75
|
-
return None
|
76
|
-
|
77
|
-
return sv.Detections(
|
78
|
-
xyxy=np.array(final_boxes),
|
79
|
-
class_id=np.array(final_labels),
|
80
|
-
confidence=np.array(final_scores)
|
81
|
-
)
|
@@ -1,76 +0,0 @@
|
|
1
|
-
from dataclasses import dataclass
|
2
|
-
|
3
|
-
import cv2
|
4
|
-
import numpy as np
|
5
|
-
|
6
|
-
import supervision as sv
|
7
|
-
|
8
|
-
from transformers import OwlViTForObjectDetection, OwlViTProcessor
|
9
|
-
|
10
|
-
from autodistill.detection import CaptionOntology
|
11
|
-
from autodistill.helpers import load_image
|
12
|
-
|
13
|
-
from coralnet_toolbox.AutoDistill.Models.QtBase import QtBaseModel
|
14
|
-
|
15
|
-
|
16
|
-
# ----------------------------------------------------------------------------------------------------------------------
|
17
|
-
# Classes
|
18
|
-
# ----------------------------------------------------------------------------------------------------------------------
|
19
|
-
|
20
|
-
|
21
|
-
@dataclass
|
22
|
-
class OWLViTModel(QtBaseModel):
|
23
|
-
def __init__(self, ontology: CaptionOntology, device: str = "cpu"):
|
24
|
-
super().__init__(ontology, device)
|
25
|
-
|
26
|
-
model_name = "google/owlvit-base-patch32"
|
27
|
-
self.processor = OwlViTProcessor.from_pretrained(model_name, use_fast=True)
|
28
|
-
self.model = OwlViTForObjectDetection.from_pretrained(model_name).to(self.device)
|
29
|
-
|
30
|
-
def _process_predictions(self, image, texts, class_idx_mapper, confidence):
|
31
|
-
"""Process model predictions for a single image."""
|
32
|
-
inputs = self.processor(text=texts, images=image, return_tensors="pt").to(self.device)
|
33
|
-
outputs = self.model(**inputs)
|
34
|
-
|
35
|
-
results = self.processor.post_process_object_detection(
|
36
|
-
outputs,
|
37
|
-
threshold=confidence,
|
38
|
-
target_sizes=[image.shape[:2]]
|
39
|
-
)[0]
|
40
|
-
|
41
|
-
boxes, scores, labels = (
|
42
|
-
results["boxes"],
|
43
|
-
results["scores"],
|
44
|
-
results["labels"],
|
45
|
-
)
|
46
|
-
|
47
|
-
final_boxes, final_scores, final_labels = [], [], []
|
48
|
-
|
49
|
-
for box, score, label in zip(boxes, scores, labels):
|
50
|
-
try:
|
51
|
-
box = box.detach().cpu().numpy().astype(int).tolist()
|
52
|
-
score = score.item()
|
53
|
-
label_index = label.item()
|
54
|
-
class_label = texts[label_index]
|
55
|
-
label = class_idx_mapper[class_label]
|
56
|
-
|
57
|
-
# Filter by confidence
|
58
|
-
if score < confidence:
|
59
|
-
continue
|
60
|
-
|
61
|
-
final_boxes.append(box)
|
62
|
-
final_scores.append(score)
|
63
|
-
final_labels.append(label)
|
64
|
-
|
65
|
-
except Exception as e:
|
66
|
-
print(f"Error: Issue converting predictions:\n{e}")
|
67
|
-
continue
|
68
|
-
|
69
|
-
if len(final_boxes) == 0:
|
70
|
-
return None
|
71
|
-
|
72
|
-
return sv.Detections(
|
73
|
-
xyxy=np.array(final_boxes),
|
74
|
-
class_id=np.array(final_labels),
|
75
|
-
confidence=np.array(final_scores)
|
76
|
-
)
|
@@ -1,75 +0,0 @@
|
|
1
|
-
from dataclasses import dataclass
|
2
|
-
|
3
|
-
import cv2
|
4
|
-
import numpy as np
|
5
|
-
|
6
|
-
import supervision as sv
|
7
|
-
|
8
|
-
from transformers import AutoProcessor, OmDetTurboForObjectDetection
|
9
|
-
|
10
|
-
from autodistill.detection import CaptionOntology
|
11
|
-
from autodistill.helpers import load_image
|
12
|
-
|
13
|
-
from coralnet_toolbox.AutoDistill.Models.QtBase import QtBaseModel
|
14
|
-
|
15
|
-
|
16
|
-
# ----------------------------------------------------------------------------------------------------------------------
|
17
|
-
# Classes
|
18
|
-
# ----------------------------------------------------------------------------------------------------------------------
|
19
|
-
|
20
|
-
|
21
|
-
@dataclass
|
22
|
-
class OmDetTurboModel(QtBaseModel):
|
23
|
-
def __init__(self, ontology: CaptionOntology, device: str = "cpu"):
|
24
|
-
super().__init__(ontology, device)
|
25
|
-
|
26
|
-
model_name = "omlab/omdet-turbo-swin-tiny-hf"
|
27
|
-
self.processor = AutoProcessor.from_pretrained(model_name, use_fast=True)
|
28
|
-
self.model = OmDetTurboForObjectDetection.from_pretrained(model_name).to(self.device)
|
29
|
-
|
30
|
-
def _process_predictions(self, image, texts, class_idx_mapper, confidence):
|
31
|
-
"""Process model predictions for a single image."""
|
32
|
-
inputs = self.processor(text=texts, images=image, return_tensors="pt").to(self.device)
|
33
|
-
outputs = self.model(**inputs)
|
34
|
-
|
35
|
-
results = self.processor.post_process_grounded_object_detection(
|
36
|
-
outputs,
|
37
|
-
threshold=confidence,
|
38
|
-
target_sizes=[image.shape[:2]],
|
39
|
-
text_labels=texts,
|
40
|
-
)[0]
|
41
|
-
|
42
|
-
boxes, scores, labels = (
|
43
|
-
results["boxes"],
|
44
|
-
results["scores"],
|
45
|
-
results["text_labels"],
|
46
|
-
)
|
47
|
-
|
48
|
-
final_boxes, final_scores, final_labels = [], [], []
|
49
|
-
|
50
|
-
for box, score, label in zip(boxes, scores, labels):
|
51
|
-
try:
|
52
|
-
box = box.detach().cpu().numpy().astype(int).tolist()
|
53
|
-
score = score.item()
|
54
|
-
label = class_idx_mapper[label]
|
55
|
-
|
56
|
-
# Amplify scores
|
57
|
-
if score < confidence:
|
58
|
-
continue
|
59
|
-
|
60
|
-
final_boxes.append(box)
|
61
|
-
final_scores.append(score)
|
62
|
-
final_labels.append(label)
|
63
|
-
|
64
|
-
except Exception as e:
|
65
|
-
print(f"Error: Issue converting predictions:\n{e}")
|
66
|
-
continue
|
67
|
-
|
68
|
-
if len(final_boxes) == 0:
|
69
|
-
return None
|
70
|
-
|
71
|
-
return sv.Detections(
|
72
|
-
xyxy=np.array(final_boxes),
|
73
|
-
class_id=np.array(final_labels),
|
74
|
-
confidence=np.array(final_scores)
|
75
|
-
)
|