Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -54,29 +54,12 @@ with gr.Blocks() as demo2:
|
|
| 54 |
row_count=0,
|
| 55 |
col_count=(3, "fixed"),
|
| 56 |
)
|
| 57 |
-
|
|
|
|
|
|
|
| 58 |
btn_add_segm = gr.Button(value="create dataset")
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
gr.Markdown("*****")
|
| 62 |
-
def calculator(num1, operation, num2):
|
| 63 |
-
if operation == "add":
|
| 64 |
-
return num1 + num2
|
| 65 |
-
elif operation == "subtract":
|
| 66 |
-
return num1 - num2
|
| 67 |
-
elif operation == "multiply":
|
| 68 |
-
return num1 * num2
|
| 69 |
-
elif operation == "divide":
|
| 70 |
-
return num1 / num2
|
| 71 |
-
gr.Interface(
|
| 72 |
-
calculator,[
|
| 73 |
-
"number",
|
| 74 |
-
gr.Radio(["add", "subtract", "multiply", "divide"]),
|
| 75 |
-
"number"
|
| 76 |
-
],
|
| 77 |
-
"number",
|
| 78 |
-
live=True,
|
| 79 |
-
)
|
| 80 |
gr.Markdown("*****")
|
| 81 |
gr.Examples([os.path.join(os.path.dirname(__file__), "test.mp4")], inputs=input_video)
|
| 82 |
|
|
|
|
| 54 |
row_count=0,
|
| 55 |
col_count=(3, "fixed"),
|
| 56 |
)
|
| 57 |
+
def make_dataset(df):
|
| 58 |
+
return df.fillna(-1)
|
| 59 |
+
df2 = gr.Dataframe()
|
| 60 |
btn_add_segm = gr.Button(value="create dataset")
|
| 61 |
+
btn.click(make_dataset, inputs=df, outputs=df2)
|
| 62 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
gr.Markdown("*****")
|
| 64 |
gr.Examples([os.path.join(os.path.dirname(__file__), "test.mp4")], inputs=input_video)
|
| 65 |
|