Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #84

Merged
merged 3 commits into from
Dec 16, 2024
Merged

Dev #84

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions coralnet_toolbox/Annotations/QtAnnotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,30 @@ def update_user_confidence(self, new_label: 'Label'):
self.show_message = False

def update_label(self, new_label: 'Label'):
# Initializing
if self.label is None:
self.label = new_label
self.update_graphics_item()
if self.label.id != new_label.id:
# Updating
elif self.label.id != new_label.id or self.label.color != new_label.color:
# Update the label in user_confidence if it exists
if self.user_confidence:
old_confidence = next(iter(self.user_confidence.values()))
self.user_confidence = {new_label: old_confidence}

# Update the label in machine_confidence if it exists
if self.machine_confidence:
new_machine_confidence = {}
for label, confidence in self.machine_confidence.items():
if label.id == self.label.id:
new_machine_confidence[new_label] = confidence
else:
new_machine_confidence[label] = confidence
self.machine_confidence = new_machine_confidence
# Update the label
self.label = new_label
self.update_graphics_item()

# Always update the graphics item
self.update_graphics_item()

def _prepare_data_for_qimage(self, data):
if data.shape[0] == 3: # RGB image
Expand Down
3 changes: 1 addition & 2 deletions coralnet_toolbox/MachineLearning/ExportDataset/QtBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ def setup_info_layout(self):
layout = QVBoxLayout()

# Create a QLabel with explanatory text and hyperlink
info_label = QLabel("Export Patches, Rectangles, and Polygons to create a YOLO-formatted \
Classification, Detection or Segmentation dataset.")
info_label = QLabel("Export Patches, Rectangles, and Polygons to create a YOLO-formatted Classification, Detection or Segmentation dataset.")

info_label.setOpenExternalLinks(True)
info_label.setWordWrap(True)
Expand Down
5 changes: 4 additions & 1 deletion coralnet_toolbox/QtLabelWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,10 @@ def edit_labels(self, old_label, new_label, delete_old=False):

self.update_labels_per_row()
self.reorganize_labels()


# Refresh the scene with the new label
self.annotation_window.set_image(self.annotation_window.current_image_path)

def delete_label(self, label):
if (label.short_label_code == "Review" and
label.long_label_code == "Review" and
Expand Down
2 changes: 1 addition & 1 deletion coralnet_toolbox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from coralnet_toolbox.main import run

__version__ = "0.0.13"
__version__ = "0.0.14"
__author__ = "Jordan Pierce"
__email__ = "[email protected]"
__credits__ = "National Center for Coastal and Ocean Sciences (NCCOS)"
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "coralnet-toolbox"
version = "0.0.13"
version = "0.0.14"
dynamic = [
"dependencies",
]
Expand Down Expand Up @@ -48,7 +48,7 @@ universal = true


[tool.bumpversion]
current_version = "0.0.13"
current_version = "0.0.14"
commit = true
tag = true

Expand Down
Loading