Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -107,8 +107,8 @@ if what == 'Upload audio file':
|
|
| 107 |
|
| 108 |
my_bar = st.progress(0)
|
| 109 |
|
| 110 |
-
|
| 111 |
-
text =
|
| 112 |
|
| 113 |
|
| 114 |
C_AH = np.array([0.16793381, 0.61851003, 0.3930835 , 2.73506039, 0.84535045,
|
|
@@ -131,7 +131,7 @@ if what == 'Upload audio file':
|
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
-
text =
|
| 135 |
|
| 136 |
model = torch.load("model.pt")
|
| 137 |
|
|
@@ -140,7 +140,7 @@ if what == 'Upload audio file':
|
|
| 140 |
|
| 141 |
my_bar.progress(15)
|
| 142 |
|
| 143 |
-
text =
|
| 144 |
|
| 145 |
input_values = feature_extractor(wav, return_tensors="pt", sampling_rate = sr).input_values
|
| 146 |
|
|
@@ -311,7 +311,7 @@ if what == 'Upload audio file':
|
|
| 311 |
brain0 = Image.open('BrainAndSpinal.png')
|
| 312 |
|
| 313 |
|
| 314 |
-
text =
|
| 315 |
|
| 316 |
|
| 317 |
|
|
@@ -588,7 +588,7 @@ if what == 'Upload audio file':
|
|
| 588 |
|
| 589 |
loaded = int(30 + (54 * f) / len(ema))
|
| 590 |
my_bar.progress(loaded)
|
| 591 |
-
text =
|
| 592 |
|
| 593 |
|
| 594 |
def animate(frame_number):
|
|
@@ -807,7 +807,7 @@ if what == 'Upload audio file':
|
|
| 807 |
|
| 808 |
my_bar.progress(85)
|
| 809 |
|
| 810 |
-
text =
|
| 811 |
|
| 812 |
from moviepy.editor import *
|
| 813 |
|
|
@@ -832,7 +832,7 @@ if what == 'Upload audio file':
|
|
| 832 |
|
| 833 |
my_bar.progress(100)
|
| 834 |
|
| 835 |
-
text =
|
| 836 |
|
| 837 |
st.video(video_bytes)
|
| 838 |
|
|
|
|
| 107 |
|
| 108 |
my_bar = st.progress(0)
|
| 109 |
|
| 110 |
+
TA = st.empty()
|
| 111 |
+
text = TA.text_area("", "Firing up!")
|
| 112 |
|
| 113 |
|
| 114 |
C_AH = np.array([0.16793381, 0.61851003, 0.3930835 , 2.73506039, 0.84535045,
|
|
|
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
+
text = TA.text_area("", "Loading wav2vec 2.0 ...")
|
| 135 |
|
| 136 |
model = torch.load("model.pt")
|
| 137 |
|
|
|
|
| 140 |
|
| 141 |
my_bar.progress(15)
|
| 142 |
|
| 143 |
+
text = TA.text_area("", "Estimating phonemes ...")
|
| 144 |
|
| 145 |
input_values = feature_extractor(wav, return_tensors="pt", sampling_rate = sr).input_values
|
| 146 |
|
|
|
|
| 311 |
brain0 = Image.open('BrainAndSpinal.png')
|
| 312 |
|
| 313 |
|
| 314 |
+
text = TA.text_area("", "Rendering frame: 0 of " + str(len(ema)))
|
| 315 |
|
| 316 |
|
| 317 |
|
|
|
|
| 588 |
|
| 589 |
loaded = int(30 + (54 * f) / len(ema))
|
| 590 |
my_bar.progress(loaded)
|
| 591 |
+
text = TA.text_area("", "Rendering frame: " + str(f) + " of " + str(len(ema)))
|
| 592 |
|
| 593 |
|
| 594 |
def animate(frame_number):
|
|
|
|
| 807 |
|
| 808 |
my_bar.progress(85)
|
| 809 |
|
| 810 |
+
text = TA.text_area("", "Merging audio and video ...")
|
| 811 |
|
| 812 |
from moviepy.editor import *
|
| 813 |
|
|
|
|
| 832 |
|
| 833 |
my_bar.progress(100)
|
| 834 |
|
| 835 |
+
text = TA.text_area("", "Done !")
|
| 836 |
|
| 837 |
st.video(video_bytes)
|
| 838 |
|