Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,7 +25,23 @@ def print_directory_contents(path):
|
|
| 25 |
|
| 26 |
# Print the ckpt directory contents
|
| 27 |
print_directory_contents('./ckpt')
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
def infer(video_in):
|
| 30 |
|
| 31 |
# Need to find path to gradio temp vid from video input
|
|
@@ -57,6 +73,8 @@ def infer(video_in):
|
|
| 57 |
# Need to find where are the results stored, default should be "./outputs/tmp"
|
| 58 |
# Print the outputs directory contents
|
| 59 |
print_directory_contents('./outputs/tmp')
|
|
|
|
|
|
|
| 60 |
return "done"
|
| 61 |
|
| 62 |
with gr.Blocks() as demo:
|
|
|
|
| 25 |
|
| 26 |
# Print the ckpt directory contents
|
| 27 |
print_directory_contents('./ckpt')
|
| 28 |
+
|
| 29 |
+
def get_wav_files(path):
|
| 30 |
+
wav_files = [] # Initialize an empty list to store the paths of .wav files
|
| 31 |
+
for root, dirs, files in os.walk(path):
|
| 32 |
+
level = root.replace(path, '').count(os.sep)
|
| 33 |
+
indent = ' ' * 4 * (level)
|
| 34 |
+
print(f"{indent}{os.path.basename(root)}/")
|
| 35 |
+
subindent = ' ' * 4 * (level + 1)
|
| 36 |
+
for f in files:
|
| 37 |
+
file_path = os.path.join(root, f)
|
| 38 |
+
if f.lower().endswith('.wav'):
|
| 39 |
+
wav_files.append(file_path) # Add .wav file paths to the list
|
| 40 |
+
print(f"{subindent}{file_path}")
|
| 41 |
+
else:
|
| 42 |
+
print(f"{subindent}{f}")
|
| 43 |
+
return wav_files # Return the list of .wav file paths
|
| 44 |
+
|
| 45 |
def infer(video_in):
|
| 46 |
|
| 47 |
# Need to find path to gradio temp vid from video input
|
|
|
|
| 73 |
# Need to find where are the results stored, default should be "./outputs/tmp"
|
| 74 |
# Print the outputs directory contents
|
| 75 |
print_directory_contents('./outputs/tmp')
|
| 76 |
+
wave_files = get_wav_files('./outputs/tmp')
|
| 77 |
+
print(wave_files)
|
| 78 |
return "done"
|
| 79 |
|
| 80 |
with gr.Blocks() as demo:
|