Spaces:
Running
Running
IbrahimaThioye
commited on
Commit
•
ff5470c
1
Parent(s):
d872626
Update app.py
Browse files
app.py
CHANGED
@@ -519,13 +519,13 @@ def classify():
|
|
519 |
# Calculate area and overlap statistics
|
520 |
area_data = []
|
521 |
for i, component_mask in enumerate(component_masks):
|
522 |
-
component_area = np.sum(component_mask) # Total component area in pixels
|
523 |
void_area_within_component = 0
|
524 |
max_void_area_percentage = 0
|
525 |
|
526 |
# Calculate overlap of each void mask with the component mask
|
527 |
for void_mask in void_masks:
|
528 |
-
overlap_area = np.sum(void_mask & component_mask) # Overlapping area
|
529 |
void_area_within_component += overlap_area
|
530 |
void_area_percentage = (overlap_area / component_area) * 100 if component_area > 0 else 0
|
531 |
max_void_area_percentage = max(max_void_area_percentage, void_area_percentage)
|
|
|
519 |
# Calculate area and overlap statistics
|
520 |
area_data = []
|
521 |
for i, component_mask in enumerate(component_masks):
|
522 |
+
component_area = np.sum(component_mask).item() # Total component area in pixels
|
523 |
void_area_within_component = 0
|
524 |
max_void_area_percentage = 0
|
525 |
|
526 |
# Calculate overlap of each void mask with the component mask
|
527 |
for void_mask in void_masks:
|
528 |
+
overlap_area = np.sum(void_mask & component_mask).item() # Overlapping area
|
529 |
void_area_within_component += overlap_area
|
530 |
void_area_percentage = (overlap_area / component_area) * 100 if component_area > 0 else 0
|
531 |
max_void_area_percentage = max(max_void_area_percentage, void_area_percentage)
|