Spaces:
Running
Running
frances-dean
commited on
Commit
•
11e40e8
1
Parent(s):
1a803ca
Update app.py
Browse files
app.py
CHANGED
@@ -482,16 +482,19 @@ def generate_example():
|
|
482 |
# get random input
|
483 |
data_path = 'EchoNet-Dynamic'
|
484 |
image_data = Echo(root = data_path, split = 'all', target_type=['Filename','LargeIndex','SmallIndex'])
|
485 |
-
image_loaded_data = DataLoader(image_data, batch_size=
|
486 |
val_data = next(iter(image_loaded_data))
|
487 |
#create_echo_clip(val_data,'test')
|
488 |
val_seq = val_data[0]
|
489 |
-
|
490 |
-
video = f"EchoNet-Dynamic/Videos/{filename}"
|
491 |
val_tensor = torch.tensor(val_seq, dtype=torch.float32)
|
492 |
-
|
|
|
|
|
|
|
|
|
493 |
|
494 |
-
plot, Rm, Ra, Emax, Emin, Vd,Tc, start_v = pvloop_simulator(Rm=round(results[
|
495 |
video = video.replace("avi", "mp4")
|
496 |
return video, plot, Rm, Ra, Emax, Emin, Vd, Tc, start_v
|
497 |
|
|
|
482 |
# get random input
|
483 |
data_path = 'EchoNet-Dynamic'
|
484 |
image_data = Echo(root = data_path, split = 'all', target_type=['Filename','LargeIndex','SmallIndex'])
|
485 |
+
image_loaded_data = DataLoader(image_data, batch_size=30, shuffle=True)
|
486 |
val_data = next(iter(image_loaded_data))
|
487 |
#create_echo_clip(val_data,'test')
|
488 |
val_seq = val_data[0]
|
489 |
+
|
|
|
490 |
val_tensor = torch.tensor(val_seq, dtype=torch.float32)
|
491 |
+
n=random.randint(0, 29)
|
492 |
+
results = model(val_tensor)[n]
|
493 |
+
|
494 |
+
filename = val_data[1][0][n]
|
495 |
+
video = f"EchoNet-Dynamic/Videos/{filename}"
|
496 |
|
497 |
+
plot, Rm, Ra, Emax, Emin, Vd,Tc, start_v = pvloop_simulator(Rm=round(results[4].item(),2), Ra=round(results[5].item(),2), Emax=results[2].item(), 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))
|
498 |
video = video.replace("avi", "mp4")
|
499 |
return video, plot, Rm, Ra, Emax, Emin, Vd, Tc, start_v
|
500 |
|