Spaces:
Running
Running
Franny Dean
commited on
Commit
·
ba170f2
1
Parent(s):
f0f0a6f
gif save with video object
Browse files- .ipynb_checkpoints/app-checkpoint.py +3 -3
- app.py +3 -3
.ipynb_checkpoints/app-checkpoint.py
CHANGED
@@ -486,7 +486,7 @@ def pvloop_simulator(Rm, Ra, Emax, Emin, Vd, Tc, start_v, animate=True):
|
|
486 |
|
487 |
if animate:
|
488 |
anim = animation.FuncAnimation(fig, partial(update), frames=100, interval=30)
|
489 |
-
anim.save("prediction.
|
490 |
|
491 |
return plt, Rm, Ra, Emax, Emin, Vd, Tc, start_v
|
492 |
|
@@ -771,7 +771,7 @@ def generate_example():
|
|
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 |
-
animated = "prediction.
|
775 |
return video, animated, Rm, Ra, Emax, Emin, Vd, Tc, start_v
|
776 |
|
777 |
|
@@ -853,7 +853,7 @@ with gr.Blocks() as demo:
|
|
853 |
generate_button = gr.Button("Load sample echocardiogram and generate result")
|
854 |
with gr.Row():
|
855 |
video = gr.PlayableVideo(autoplay=True) #format="avi"
|
856 |
-
plot = gr.
|
857 |
|
858 |
with gr.Row():
|
859 |
Rm = gr.Number(label="Mitral valve circuit resistance (Rm) mmHg*s/ml:")
|
|
|
486 |
|
487 |
if animate:
|
488 |
anim = animation.FuncAnimation(fig, partial(update), frames=100, interval=30)
|
489 |
+
anim.save("prediction.git")
|
490 |
|
491 |
return plt, Rm, Ra, Emax, Emin, Vd, Tc, start_v
|
492 |
|
|
|
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 |
+
animated = "prediction.gif"
|
775 |
return video, animated, Rm, Ra, Emax, Emin, Vd, Tc, start_v
|
776 |
|
777 |
|
|
|
853 |
generate_button = gr.Button("Load sample echocardiogram and generate result")
|
854 |
with gr.Row():
|
855 |
video = gr.PlayableVideo(autoplay=True) #format="avi"
|
856 |
+
plot = gr.HTML()
|
857 |
|
858 |
with gr.Row():
|
859 |
Rm = gr.Number(label="Mitral valve circuit resistance (Rm) mmHg*s/ml:")
|
app.py
CHANGED
@@ -486,7 +486,7 @@ def pvloop_simulator(Rm, Ra, Emax, Emin, Vd, Tc, start_v, animate=True):
|
|
486 |
|
487 |
if animate:
|
488 |
anim = animation.FuncAnimation(fig, partial(update), frames=100, interval=30)
|
489 |
-
anim.save("prediction.
|
490 |
|
491 |
return plt, Rm, Ra, Emax, Emin, Vd, Tc, start_v
|
492 |
|
@@ -771,7 +771,7 @@ def generate_example():
|
|
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 |
-
animated = "prediction.
|
775 |
return video, animated, Rm, Ra, Emax, Emin, Vd, Tc, start_v
|
776 |
|
777 |
|
@@ -853,7 +853,7 @@ with gr.Blocks() as demo:
|
|
853 |
generate_button = gr.Button("Load sample echocardiogram and generate result")
|
854 |
with gr.Row():
|
855 |
video = gr.PlayableVideo(autoplay=True) #format="avi"
|
856 |
-
plot = gr.
|
857 |
|
858 |
with gr.Row():
|
859 |
Rm = gr.Number(label="Mitral valve circuit resistance (Rm) mmHg*s/ml:")
|
|
|
486 |
|
487 |
if animate:
|
488 |
anim = animation.FuncAnimation(fig, partial(update), frames=100, interval=30)
|
489 |
+
anim.save("prediction.git")
|
490 |
|
491 |
return plt, Rm, Ra, Emax, Emin, Vd, Tc, start_v
|
492 |
|
|
|
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 |
+
animated = "prediction.gif"
|
775 |
return video, animated, Rm, Ra, Emax, Emin, Vd, Tc, start_v
|
776 |
|
777 |
|
|
|
853 |
generate_button = gr.Button("Load sample echocardiogram and generate result")
|
854 |
with gr.Row():
|
855 |
video = gr.PlayableVideo(autoplay=True) #format="avi"
|
856 |
+
plot = gr.HTML()
|
857 |
|
858 |
with gr.Row():
|
859 |
Rm = gr.Number(label="Mitral valve circuit resistance (Rm) mmHg*s/ml:")
|