Franny Dean commited on
Commit
c6c7d4e
·
1 Parent(s): 3e750a2

retry html

Browse files
Files changed (2) hide show
  1. .ipynb_checkpoints/app-checkpoint.py +5 -5
  2. app.py +5 -5
.ipynb_checkpoints/app-checkpoint.py CHANGED
@@ -770,9 +770,9 @@ def generate_example():
770
  video = f"EchoNet-Dynamic/Videos/{filename}"
771
 
772
  plot, Rm, Ra, Emax, Emin, Vd,Tc, start_v = pvloop_simulator(Rm=round(results[4].item(),2), Ra=round(results[5].item(),2), Emax=round(results[2].item(),2), Emin=round(results[3].item(),2), Vd=round(results[6].item(),2), Tc=round(results[0].item(),2), start_v=round(results[1].item(),2))
773
- video = video.replace("avi", "mp4")
774
- #video = "<video autoplay loop muted> <source src=video_file type='video/mp4'/> </video>"
775
- animated = "prediction.mp4" # style="width:48px;height:48px;" # "<img src='prediction.gif' alt='pv_loop'>"
776
  return video, animated, Rm, Ra, Emax, Emin, Vd, Tc, start_v
777
 
778
 
@@ -853,8 +853,8 @@ with gr.Blocks() as demo:
853
 
854
  generate_button = gr.Button("Load sample echocardiogram and generate result")
855
  with gr.Row():
856
- video = gr.PlayableVideo(autoplay=True) #format="avi" gr.HTML()
857
- plot = gr.PlayableVideo(autoplay=True) # gr.HTML() #
858
 
859
  with gr.Row():
860
  Rm = gr.Number(label="Mitral valve circuit resistance (Rm) mmHg*s/ml:")
 
770
  video = f"EchoNet-Dynamic/Videos/{filename}"
771
 
772
  plot, Rm, Ra, Emax, Emin, Vd,Tc, start_v = pvloop_simulator(Rm=round(results[4].item(),2), Ra=round(results[5].item(),2), Emax=round(results[2].item(),2), Emin=round(results[3].item(),2), Vd=round(results[6].item(),2), Tc=round(results[0].item(),2), start_v=round(results[1].item(),2))
773
+ video_file = video.replace("avi", "mp4")
774
+ video = f"<video autoplay loop muted> <source src={video_file} type='video/mp4'/> </video>"
775
+ animated = "<video autoplay loop muted> <source src='prediction.mp4' type='video/mp4'/> </video>" # style="width:48px;height:48px;" # "<img src='prediction.gif' alt='pv_loop'>" # "prediction.mp4"
776
  return video, animated, Rm, Ra, Emax, Emin, Vd, Tc, start_v
777
 
778
 
 
853
 
854
  generate_button = gr.Button("Load sample echocardiogram and generate result")
855
  with gr.Row():
856
+ video = gr.HTML() # gr.PlayableVideo(autoplay=True) #
857
+ plot = gr.HTML() # gr.PlayableVideo(autoplay=True) #
858
 
859
  with gr.Row():
860
  Rm = gr.Number(label="Mitral valve circuit resistance (Rm) mmHg*s/ml:")
app.py CHANGED
@@ -770,9 +770,9 @@ def generate_example():
770
  video = f"EchoNet-Dynamic/Videos/{filename}"
771
 
772
  plot, Rm, Ra, Emax, Emin, Vd,Tc, start_v = pvloop_simulator(Rm=round(results[4].item(),2), Ra=round(results[5].item(),2), Emax=round(results[2].item(),2), Emin=round(results[3].item(),2), Vd=round(results[6].item(),2), Tc=round(results[0].item(),2), start_v=round(results[1].item(),2))
773
- video = video.replace("avi", "mp4")
774
- #video = "<video autoplay loop muted> <source src=video_file type='video/mp4'/> </video>"
775
- animated = "prediction.mp4" # style="width:48px;height:48px;" # "<img src='prediction.gif' alt='pv_loop'>"
776
  return video, animated, Rm, Ra, Emax, Emin, Vd, Tc, start_v
777
 
778
 
@@ -853,8 +853,8 @@ with gr.Blocks() as demo:
853
 
854
  generate_button = gr.Button("Load sample echocardiogram and generate result")
855
  with gr.Row():
856
- video = gr.PlayableVideo(autoplay=True) #format="avi" gr.HTML()
857
- plot = gr.PlayableVideo(autoplay=True) # gr.HTML() #
858
 
859
  with gr.Row():
860
  Rm = gr.Number(label="Mitral valve circuit resistance (Rm) mmHg*s/ml:")
 
770
  video = f"EchoNet-Dynamic/Videos/{filename}"
771
 
772
  plot, Rm, Ra, Emax, Emin, Vd,Tc, start_v = pvloop_simulator(Rm=round(results[4].item(),2), Ra=round(results[5].item(),2), Emax=round(results[2].item(),2), Emin=round(results[3].item(),2), Vd=round(results[6].item(),2), Tc=round(results[0].item(),2), start_v=round(results[1].item(),2))
773
+ video_file = video.replace("avi", "mp4")
774
+ video = f"<video autoplay loop muted> <source src={video_file} type='video/mp4'/> </video>"
775
+ animated = "<video autoplay loop muted> <source src='prediction.mp4' type='video/mp4'/> </video>" # style="width:48px;height:48px;" # "<img src='prediction.gif' alt='pv_loop'>" # "prediction.mp4"
776
  return video, animated, Rm, Ra, Emax, Emin, Vd, Tc, start_v
777
 
778
 
 
853
 
854
  generate_button = gr.Button("Load sample echocardiogram and generate result")
855
  with gr.Row():
856
+ video = gr.HTML() # gr.PlayableVideo(autoplay=True) #
857
+ plot = gr.HTML() # gr.PlayableVideo(autoplay=True) #
858
 
859
  with gr.Row():
860
  Rm = gr.Number(label="Mitral valve circuit resistance (Rm) mmHg*s/ml:")