chmcbs
commited on
Commit
·
d36fd45
1
Parent(s):
8ee30a6
Improve formatting of head count message
Browse files- app.py +1 -1
- inference.py +2 -2
app.py
CHANGED
|
@@ -38,7 +38,7 @@ def process_image(image):
|
|
| 38 |
overlay_np[max(0,y-3):y+4, max(0,x-3):x+4] = [255, 0, 0]
|
| 39 |
|
| 40 |
overlay = Image.fromarray(overlay_np)
|
| 41 |
-
count_message = f"### 🌾 {num_heads} heads detected
|
| 42 |
return count_message, overlay
|
| 43 |
except Exception as e:
|
| 44 |
return f"Error: {str(e)}", None
|
|
|
|
| 38 |
overlay_np[max(0,y-3):y+4, max(0,x-3):x+4] = [255, 0, 0]
|
| 39 |
|
| 40 |
overlay = Image.fromarray(overlay_np)
|
| 41 |
+
count_message = f"### 🌾 {num_heads} heads detected"
|
| 42 |
return count_message, overlay
|
| 43 |
except Exception as e:
|
| 44 |
return f"Error: {str(e)}", None
|
inference.py
CHANGED
|
@@ -155,7 +155,7 @@ if __name__ == "__main__":
|
|
| 155 |
|
| 156 |
# Count heads
|
| 157 |
num_heads = model.count_heads(predictions)
|
| 158 |
-
print(f"\n🌾 {num_heads} heads detected
|
| 159 |
|
| 160 |
# Create visualisations
|
| 161 |
print("\nGenerating visualisations...")
|
|
@@ -170,4 +170,4 @@ if __name__ == "__main__":
|
|
| 170 |
overlay_all.save(output_all)
|
| 171 |
|
| 172 |
print(f"✓ Saved head overlay to: {output_heads}")
|
| 173 |
-
print(f"✓ Saved full segmentation to: {output_all}")
|
|
|
|
| 155 |
|
| 156 |
# Count heads
|
| 157 |
num_heads = model.count_heads(predictions)
|
| 158 |
+
print(f"\n🌾 {num_heads} heads detected")
|
| 159 |
|
| 160 |
# Create visualisations
|
| 161 |
print("\nGenerating visualisations...")
|
|
|
|
| 170 |
overlay_all.save(output_all)
|
| 171 |
|
| 172 |
print(f"✓ Saved head overlay to: {output_heads}")
|
| 173 |
+
print(f"✓ Saved full segmentation to: {output_all}")
|