Update app.py
Browse files
app.py
CHANGED
|
@@ -6,6 +6,7 @@ from cellpose import models
|
|
| 6 |
from matplotlib.colors import hsv_to_rgb
|
| 7 |
import matplotlib.pyplot as plt
|
| 8 |
import os, io, base64
|
|
|
|
| 9 |
|
| 10 |
try:
|
| 11 |
model = models.CellposeModel(gpu=True, pretrained_model="cyto3")
|
|
@@ -113,6 +114,8 @@ def cellpose_segment(img_input):
|
|
| 113 |
|
| 114 |
outpix = plot_outlines(img_input, masks)
|
| 115 |
overlay = plot_overlay(img_input, masks)
|
|
|
|
|
|
|
| 116 |
return outpix, overlay, flows, masks
|
| 117 |
|
| 118 |
# Gradio Interface
|
|
|
|
| 6 |
from matplotlib.colors import hsv_to_rgb
|
| 7 |
import matplotlib.pyplot as plt
|
| 8 |
import os, io, base64
|
| 9 |
+
from PIL import Image
|
| 10 |
|
| 11 |
try:
|
| 12 |
model = models.CellposeModel(gpu=True, pretrained_model="cyto3")
|
|
|
|
| 114 |
|
| 115 |
outpix = plot_outlines(img_input, masks)
|
| 116 |
overlay = plot_overlay(img_input, masks)
|
| 117 |
+
masks = Image.fromarray(masks)
|
| 118 |
+
|
| 119 |
return outpix, overlay, flows, masks
|
| 120 |
|
| 121 |
# Gradio Interface
|