Update app.py
Browse files
app.py
CHANGED
|
@@ -99,16 +99,16 @@ def image_resize(img, resize=400):
|
|
| 99 |
return img
|
| 100 |
|
| 101 |
|
| 102 |
-
#@spaces.GPU(duration=10)
|
| 103 |
-
#def run_model_gpu(model, img):
|
| 104 |
-
# masks, flows, _ = model.eval(img, channels=[0,0])
|
| 105 |
-
# return masks, flows
|
| 106 |
-
|
| 107 |
@spaces.GPU(duration=10)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
def cellpose_segment(img_input):
|
| 109 |
img = image_resize(img_input)
|
| 110 |
-
|
| 111 |
-
masks, flows, _ = model.eval(img, channels=[0,0])
|
| 112 |
flows = flows[0]
|
| 113 |
# masks = np.zeros(img.shape[:2])
|
| 114 |
# flows = np.zeros_like(img)
|
|
|
|
| 99 |
return img
|
| 100 |
|
| 101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
@spaces.GPU(duration=10)
|
| 103 |
+
def run_model_gpu(img):
|
| 104 |
+
masks, flows, _ = model.eval(img, channels=[0,0])
|
| 105 |
+
return masks, flows
|
| 106 |
+
|
| 107 |
+
#@spaces.GPU(duration=10)
|
| 108 |
def cellpose_segment(img_input):
|
| 109 |
img = image_resize(img_input)
|
| 110 |
+
masks, flows = run_model_gpu(img)
|
| 111 |
+
#masks, flows, _ = model.eval(img, channels=[0,0])
|
| 112 |
flows = flows[0]
|
| 113 |
# masks = np.zeros(img.shape[:2])
|
| 114 |
# flows = np.zeros_like(img)
|