Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -221,15 +221,25 @@ def detect(img, target_lang,target_lang2=None):
|
|
| 221 |
im_out=draw_boxes(im, bounds)
|
| 222 |
return im_out,pd.DataFrame(bounds),pd.DataFrame(bounds).iloc[:,1:]
|
| 223 |
with gr.Blocks() as robot:
|
| 224 |
-
im=gr.Image(type="filepath")
|
| 225 |
with gr.Row():
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 231 |
with gr.Row():
|
| 232 |
-
|
| 233 |
-
|
|
|
|
|
|
|
|
|
|
| 234 |
go_btn.click(detect,[im,target_lang,target_lang2],[out_im,out_txt,data_f])
|
| 235 |
robot.queue(concurrency_count=10).launch()
|
|
|
|
| 221 |
im_out=draw_boxes(im, bounds)
|
| 222 |
return im_out,pd.DataFrame(bounds),pd.DataFrame(bounds).iloc[:,1:]
|
| 223 |
with gr.Blocks() as robot:
|
|
|
|
| 224 |
with gr.Row():
|
| 225 |
+
with gr.Column():
|
| 226 |
+
im=gr.Image(type="filepath")
|
| 227 |
+
with gr.Column():
|
| 228 |
+
with gr.Row():
|
| 229 |
+
target_lang = gr.Dropdown(label="Detect language", choices=list(lang_id.keys()),value="English")
|
| 230 |
+
target_lang2 = gr.Dropdown(label="Detect language", choices=list(lang_id.keys()),value="")
|
| 231 |
+
go_btn=gr.Button()
|
| 232 |
+
with gr.Row():
|
| 233 |
+
with gr.Column():
|
| 234 |
+
out_im=gr.Image()
|
| 235 |
+
with gr.Column():
|
| 236 |
+
out_txt=gr.Textbox(lines=8)
|
| 237 |
+
data_f=gr.Dataframe()
|
| 238 |
with gr.Row():
|
| 239 |
+
with gr.Column():
|
| 240 |
+
trans_im=gr.Image()
|
| 241 |
+
gr.Column()
|
| 242 |
+
|
| 243 |
+
|
| 244 |
go_btn.click(detect,[im,target_lang,target_lang2],[out_im,out_txt,data_f])
|
| 245 |
robot.queue(concurrency_count=10).launch()
|