Omnibus commited on
Commit
86d74a1
β€’
1 Parent(s): e37ccb3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -208,9 +208,10 @@ def draw_boxes(image, bounds, color='blue', width=1):
208
 
209
  def detect(img, target_lang,target_lang2=None):
210
  if target_lang2 != None:
211
- lang=lang_id[target_lang]
212
- lang2=lang_id[target_lang2]
213
- lang=[f"{lang},{lang2}"]
 
214
  else:
215
  lang=[f"{lang_id[target_lang]}"]
216
 
@@ -224,7 +225,7 @@ with gr.Blocks() as robot:
224
  im=gr.Image(type="filepath")
225
  with gr.Row():
226
  target_lang = gr.Dropdown(label="Detect language", choices=list(lang_id.keys()),value="English")
227
- target_lang2 = gr.Dropdown(label="Detect language", choices=list(lang_id.keys()),value="English")
228
 
229
  go_btn=gr.Button()
230
  out_im=gr.Image()
 
208
 
209
  def detect(img, target_lang,target_lang2=None):
210
  if target_lang2 != None:
211
+ lang=f"{lang_id[target_lang]}"
212
+ lang2=f"{lang_id[target_lang2]}"
213
+
214
+ lang=[lang,lang2]
215
  else:
216
  lang=[f"{lang_id[target_lang]}"]
217
 
 
225
  im=gr.Image(type="filepath")
226
  with gr.Row():
227
  target_lang = gr.Dropdown(label="Detect language", choices=list(lang_id.keys()),value="English")
228
+ target_lang2 = gr.Dropdown(label="Detect language", choices=list(lang_id.keys()),value=None)
229
 
230
  go_btn=gr.Button()
231
  out_im=gr.Image()