Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from model import Model
|
3 |
+
|
4 |
+
|
5 |
+
m = Model()
|
6 |
+
|
7 |
+
|
8 |
+
with gr.Blocks() as app:
|
9 |
+
gr.Markdown("app")
|
10 |
+
with gr.Tab("Toxic Image Detector"):
|
11 |
+
image_input_toxic = gr.Image()
|
12 |
+
image_output_toxic = gr.Label(num_top_classes=2)
|
13 |
+
image_button_toxic = gr.Button("image_toxic")
|
14 |
+
|
15 |
+
# image
|
16 |
+
image_button_toxic.click(m.image_toxic_detect, inputs=image_input_toxic, outputs=image_output_toxic)
|
17 |
+
|
18 |
+
|
19 |
+
demo.launch(server_name="0.0.0.0")
|