Spaces:
Runtime error
Runtime error
update
Browse files
app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from demo import
|
| 3 |
|
| 4 |
|
| 5 |
def image_app():
|
|
@@ -47,7 +47,7 @@ def image_app():
|
|
| 47 |
output_image = gr.Image()
|
| 48 |
|
| 49 |
seg_automask_image_predict.click(
|
| 50 |
-
fn=
|
| 51 |
inputs=[
|
| 52 |
seg_automask_image_file,
|
| 53 |
seg_automask_image_model_type,
|
|
@@ -103,7 +103,7 @@ def video_app():
|
|
| 103 |
output_video = gr.Video()
|
| 104 |
|
| 105 |
seg_automask_video_predict.click(
|
| 106 |
-
fn=
|
| 107 |
inputs=[
|
| 108 |
seg_automask_video_file,
|
| 109 |
seg_automask_video_model_type,
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from demo import automask_image_app, automask_video_app
|
| 3 |
|
| 4 |
|
| 5 |
def image_app():
|
|
|
|
| 47 |
output_image = gr.Image()
|
| 48 |
|
| 49 |
seg_automask_image_predict.click(
|
| 50 |
+
fn=automask_image_app,
|
| 51 |
inputs=[
|
| 52 |
seg_automask_image_file,
|
| 53 |
seg_automask_image_model_type,
|
|
|
|
| 103 |
output_video = gr.Video()
|
| 104 |
|
| 105 |
seg_automask_video_predict.click(
|
| 106 |
+
fn=automask_video_app,
|
| 107 |
inputs=[
|
| 108 |
seg_automask_video_file,
|
| 109 |
seg_automask_video_model_type,
|
demo.py
CHANGED
|
@@ -3,7 +3,7 @@ from metaseg import SegAutoMaskPredictor, SegManualMaskPredictor, SahiAutoSegmen
|
|
| 3 |
# For image
|
| 4 |
|
| 5 |
|
| 6 |
-
def
|
| 7 |
SegAutoMaskPredictor().image_predict(
|
| 8 |
source=image_path,
|
| 9 |
model_type=model_type, # vit_l, vit_h, vit_b
|
|
@@ -20,7 +20,7 @@ def image_app(image_path, model_type, points_per_side, points_per_batch, min_are
|
|
| 20 |
# For video
|
| 21 |
|
| 22 |
|
| 23 |
-
def
|
| 24 |
SegAutoMaskPredictor().video_predict(
|
| 25 |
source=video_path,
|
| 26 |
model_type=model_type, # vit_l, vit_h, vit_b
|
|
|
|
| 3 |
# For image
|
| 4 |
|
| 5 |
|
| 6 |
+
def automask_image_app(image_path, model_type, points_per_side, points_per_batch, min_area):
|
| 7 |
SegAutoMaskPredictor().image_predict(
|
| 8 |
source=image_path,
|
| 9 |
model_type=model_type, # vit_l, vit_h, vit_b
|
|
|
|
| 20 |
# For video
|
| 21 |
|
| 22 |
|
| 23 |
+
def automask_video_app(video_path, model_type, points_per_side, points_per_batch, min_area):
|
| 24 |
SegAutoMaskPredictor().video_predict(
|
| 25 |
source=video_path,
|
| 26 |
model_type=model_type, # vit_l, vit_h, vit_b
|