Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -103,37 +103,37 @@ article = '<p>Detectron model is available from our repository <a href="https://
|
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
-
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
|
| 138 |
|
| 139 |
|
|
|
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
+
gr.Examples(['./d1.jpeg', './d2.jpeg', './d3.jpeg','./d4.jpeg','./d5.jpeg','./d6.jpeg'], inputs=input_image)
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
+
|
| 113 |
+
with gr.Row():
|
| 114 |
+
with gr.Column():
|
| 115 |
+
#gr.HTML("""<h5 style="color:navy;">3- Or insert direct url of an image.</h5>""")
|
| 116 |
+
input_url = gr.Textbox(label="Image URL", placeholder="")
|
| 117 |
+
#gr.HTML("""<h5 style="color:navy;">2- Or upload an image by clicking on the canvas.<br></h5>""")
|
| 118 |
+
input_image = gr.Image(type="filepath", image_mode="RGB", sources="upload", label="Input Image")
|
| 119 |
+
input_video = gr.Video(format="mp4",sources="upload", label="Input video" )
|
| 120 |
+
gr.HTML("""<h5 style="color:navy;">4- You can use this slider to control boxes min score: </h5>""")
|
| 121 |
+
sliderr = gr.Slider(minimum=0.0, maximum=1.0, value=0.4, label="Minimum score")
|
| 122 |
+
output_image = gr.Image(type="pil", label="Output")
|
| 123 |
+
output_video = gr.Video(format="mp4", label="Output")
|
| 124 |
+
|
| 125 |
+
|
| 126 |
+
img_interface = gr.Interface(
|
| 127 |
+
fn=inference,
|
| 128 |
+
inputs=[input_url,input_image,sliderr], outputs=[output_image], api_name="find"
|
| 129 |
+
)
|
| 130 |
+
video_interface = gr.Interface(
|
| 131 |
+
fn=infer_video,
|
| 132 |
+
inputs=[input_video], outputs=[output_video], api_name="vid"
|
| 133 |
+
)
|
| 134 |
+
demo = gr.TabbedInterface([img_interface, video_interface], ["Image Upload", "Video Upload"])
|
| 135 |
+
|
| 136 |
+
demo.launch()
|
| 137 |
|
| 138 |
|
| 139 |
|