Skip to content

Commit

Permalink
Updated requirements.txt and Count labels module.
Browse files Browse the repository at this point in the history
  • Loading branch information
barrybarry9 committed Jul 26, 2024
1 parent 979384d commit a154597
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 6 additions & 2 deletions empanada_napari/_label_counter_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ def count_labels(label_values, label_divisor):

class_ids = np.unique(np.floor_divide(label_values, label_divisor)).tolist()
for ci in class_ids:
min_id = ci * label_divisor + 1
min_id = ci * label_divisor
max_id = (ci + 1) * label_divisor
label_ids = label_values[np.logical_and(label_values >= min_id, label_values < max_id)]
label_ids = label_values[(label_values >= min_id) & (label_values < max_id)]
label_queue[ci] = label_ids.tolist()

return label_queue, class_ids
Expand Down Expand Up @@ -225,6 +225,10 @@ def _get_current_image(labels_layer):
class_id, class_name = seg_class.split(',')
class_num = class_id.strip()
class_name = class_name.strip()

if not class_num.isdigit():
print(f'The class number you entered is invalid. Please provide an integer value!')
return
class_names[int(class_num)] = class_name

print(f'Class names: {class_names}')
Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
opencv-python==4.9.0.80
opencv-python-headless==4.9.0.80
napari[all]>=0.4.15
scikit-image>=0.18
empanada-dl>=0.1.5
napari-plugin-engine>=0.1.4
imagecodecs
numba==0.59.0

0 comments on commit a154597

Please sign in to comment.