Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -39,6 +39,7 @@ def create_segmentation(mask_np_list):
|
|
39 |
#@spaces.GPU
|
40 |
def run_segmentation_wrapper(image):
|
41 |
try:
|
|
|
42 |
image, mask_np_list,mask_label_list = run_segmentation(image)
|
43 |
#image = image.convert('RGB')
|
44 |
segmentation = create_segmentation(mask_np_list)
|
@@ -47,7 +48,8 @@ def run_segmentation_wrapper(image):
|
|
47 |
sliderup = gr.Slider(value = 0, minimum=0, maximum=max_val, step=1, visible=True)
|
48 |
gr.Info('Segmentation finish. Select mask id and move to the next step.')
|
49 |
return image, segmentation, mask_np_list, mask_label_list, image, sliderup, sliderup , 'Segmentation finish. Select mask id and move to the next step.'
|
50 |
-
except:
|
|
|
51 |
sliderup = gr.Slider(value = 0, minimum=0, maximum=1, step=1, visible=False)
|
52 |
gr.Warning('Please upload an image before proceeding.')
|
53 |
return None,None,None,None,None, sliderup, sliderup , 'Please upload an image before proceeding.'
|
|
|
39 |
#@spaces.GPU
|
40 |
def run_segmentation_wrapper(image):
|
41 |
try:
|
42 |
+
print(image.shape)
|
43 |
image, mask_np_list,mask_label_list = run_segmentation(image)
|
44 |
#image = image.convert('RGB')
|
45 |
segmentation = create_segmentation(mask_np_list)
|
|
|
48 |
sliderup = gr.Slider(value = 0, minimum=0, maximum=max_val, step=1, visible=True)
|
49 |
gr.Info('Segmentation finish. Select mask id and move to the next step.')
|
50 |
return image, segmentation, mask_np_list, mask_label_list, image, sliderup, sliderup , 'Segmentation finish. Select mask id and move to the next step.'
|
51 |
+
except Exception as e:
|
52 |
+
print(e)
|
53 |
sliderup = gr.Slider(value = 0, minimum=0, maximum=1, step=1, visible=False)
|
54 |
gr.Warning('Please upload an image before proceeding.')
|
55 |
return None,None,None,None,None, sliderup, sliderup , 'Please upload an image before proceeding.'
|