Spaces:
Runtime error
Runtime error
Commit
·
7251698
1
Parent(s):
2301d47
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,12 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
with gr.Blocks() as demo:
|
4 |
with gr.Row():
|
@@ -12,6 +20,13 @@ with gr.Blocks() as demo:
|
|
12 |
im2 = gr.Image(type='numpy',label='Image of scratches')
|
13 |
im3 = gr.Image(type='numpy',label='Image of car parts')
|
14 |
intersections = gr.Textbox(label='Information about type of damages on each part')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
if __name__ == "__main__":
|
17 |
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
import numpy as np
|
3 |
+
|
4 |
+
def inference(image):
|
5 |
+
img1 = np.array(np.rand(240,240))
|
6 |
+
img2 = np.array(np.rand(240,240))
|
7 |
+
img3 = np.array(np.rand(240,240))
|
8 |
+
parts_list_damage = 'test'
|
9 |
+
return img1, img2, img3, parts_list_damage
|
10 |
|
11 |
with gr.Blocks() as demo:
|
12 |
with gr.Row():
|
|
|
20 |
im2 = gr.Image(type='numpy',label='Image of scratches')
|
21 |
im3 = gr.Image(type='numpy',label='Image of car parts')
|
22 |
intersections = gr.Textbox(label='Information about type of damages on each part')
|
23 |
+
|
24 |
+
#actions
|
25 |
+
submit_button.click(
|
26 |
+
fn=inference,
|
27 |
+
inputs = [image],
|
28 |
+
outputs = [img1,img2,img3,intersections]
|
29 |
+
)
|
30 |
|
31 |
if __name__ == "__main__":
|
32 |
demo.launch()
|