oskarastrom commited on
Commit
72d01e6
1 Parent(s): c8cf97b

Update result_ui.py

Browse files
Files changed (1) hide show
  1. gradio_scripts/result_ui.py +2 -2
gradio_scripts/result_ui.py CHANGED
@@ -45,7 +45,7 @@ def update_result(i, state, result, inference_handler):
45
 
46
  # Check if files exist
47
  video_path = result["path_video"][i]
48
- if not os.path.exists(video_path): video_path = ""
49
 
50
  # Send update to UI, and to inference_handler to start next file inference
51
 
@@ -53,7 +53,7 @@ def update_result(i, state, result, inference_handler):
53
  return {
54
  zip_out: gr.update(value=result["path_zip"]),
55
  tabs[i]['tab']: gr.update(),
56
- tabs[i]['video']: gr.update(value=video_path, visible=True),
57
  tabs[i]['metadata']: gr.update(value=result["fish_info"][i], visible=True),
58
  tabs[i]['table']: gr.update(value=result["fish_table"][i], visible=True),
59
  tabs[i]['annotation_btn']: gr.update(visible=annotation_avaliable),
 
45
 
46
  # Check if files exist
47
  video_path = result["path_video"][i]
48
+ if not os.path.exists(video_path): video_path = None
49
 
50
  # Send update to UI, and to inference_handler to start next file inference
51
 
 
53
  return {
54
  zip_out: gr.update(value=result["path_zip"]),
55
  tabs[i]['tab']: gr.update(),
56
+ tabs[i]['video']: gr.update(value=video_path, visible=video_path is not None),
57
  tabs[i]['metadata']: gr.update(value=result["fish_info"][i], visible=True),
58
  tabs[i]['table']: gr.update(value=result["fish_table"][i], visible=True),
59
  tabs[i]['annotation_btn']: gr.update(visible=annotation_avaliable),