Spaces:
Running
Running
Taejun Kim
commited on
Commit
·
cb80448
1
Parent(s):
756b159
Debug
Browse files
app.py
CHANGED
|
@@ -13,6 +13,20 @@ def greet(path, progress=gr.Progress(track_tqdm=True)):
|
|
| 13 |
fig = allin1.visualize(result)
|
| 14 |
allin1.sonify(result, out_dir='./sonif')
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
return fig, Path(f'./sonif/{path.stem}.sonif{path.suffix}').resolve().as_posix()
|
| 17 |
|
| 18 |
|
|
|
|
| 13 |
fig = allin1.visualize(result)
|
| 14 |
allin1.sonify(result, out_dir='./sonif')
|
| 15 |
|
| 16 |
+
import os
|
| 17 |
+
|
| 18 |
+
def list_files(startpath):
|
| 19 |
+
for root, dirs, files in os.walk(startpath):
|
| 20 |
+
level = root.replace(startpath, '').count(os.sep)
|
| 21 |
+
indent = ' ' * 4 * level
|
| 22 |
+
print('{}{}/'.format(indent, os.path.basename(root)))
|
| 23 |
+
subindent = ' ' * 4 * (level + 1)
|
| 24 |
+
for f in files:
|
| 25 |
+
print('{}{}'.format(subindent, f))
|
| 26 |
+
|
| 27 |
+
startpath = '.' # start from the current directory
|
| 28 |
+
list_files(startpath)
|
| 29 |
+
|
| 30 |
return fig, Path(f'./sonif/{path.stem}.sonif{path.suffix}').resolve().as_posix()
|
| 31 |
|
| 32 |
|