Spaces:
Sleeping
Sleeping
revert changes to functioning version
Browse files- app.py +7 -16
- requirements.txt +1 -1
app.py
CHANGED
@@ -47,20 +47,15 @@ CACHE_EXAMPLES = os.getenv('CACHE_EXAMPLES', '1') == '1'
|
|
47 |
def analyze(path):
|
48 |
#Measure time for inference
|
49 |
start = time.time()
|
50 |
-
|
51 |
-
|
52 |
path = Path(path)
|
53 |
-
result= allin1.analyze(
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
)
|
59 |
-
|
60 |
-
#stems_paths_string =""
|
61 |
-
#for stem in stems_paths:
|
62 |
-
# stems_paths_string += stem + '\n'
|
63 |
-
|
64 |
fig = allin1.visualize(
|
65 |
result,
|
66 |
multiprocess=False,
|
@@ -74,12 +69,10 @@ def analyze(path):
|
|
74 |
)
|
75 |
sonif_path = Path(f'./sonif/{path.stem}.sonif{path.suffix}').resolve().as_posix()
|
76 |
|
77 |
-
|
78 |
#Measure time for inference
|
79 |
end = time.time()
|
80 |
elapsed_time = end-start
|
81 |
|
82 |
-
|
83 |
return result.bpm, fig, sonif_path, elapsed_time
|
84 |
|
85 |
|
@@ -105,8 +98,6 @@ with gr.Blocks() as demo:
|
|
105 |
scale=9,
|
106 |
)
|
107 |
elapsed_time = gr.Textbox(label='Overall inference time', scale=1)
|
108 |
-
with gr.Row():
|
109 |
-
stems_paths = gr.Textbox(label='stems paths', scale=1)
|
110 |
|
111 |
#gr.Examples(
|
112 |
# examples=[
|
|
|
47 |
def analyze(path):
|
48 |
#Measure time for inference
|
49 |
start = time.time()
|
50 |
+
|
|
|
51 |
path = Path(path)
|
52 |
+
result = allin1.analyze(
|
53 |
+
path,
|
54 |
+
out_dir='./struct',
|
55 |
+
multiprocess=False,
|
56 |
+
keep_byproducts=True, # TODO: remove this
|
57 |
)
|
58 |
+
|
|
|
|
|
|
|
|
|
59 |
fig = allin1.visualize(
|
60 |
result,
|
61 |
multiprocess=False,
|
|
|
69 |
)
|
70 |
sonif_path = Path(f'./sonif/{path.stem}.sonif{path.suffix}').resolve().as_posix()
|
71 |
|
|
|
72 |
#Measure time for inference
|
73 |
end = time.time()
|
74 |
elapsed_time = end-start
|
75 |
|
|
|
76 |
return result.bpm, fig, sonif_path, elapsed_time
|
77 |
|
78 |
|
|
|
98 |
scale=9,
|
99 |
)
|
100 |
elapsed_time = gr.Textbox(label='Overall inference time', scale=1)
|
|
|
|
|
101 |
|
102 |
#gr.Examples(
|
103 |
# examples=[
|
requirements.txt
CHANGED
@@ -2,5 +2,5 @@
|
|
2 |
-f https://shi-labs.com/natten/wheels/cu118/torch2.0.0/index.html
|
3 |
natten
|
4 |
madmom @ git+https://github.com/CPJKU/madmom
|
5 |
-
allin1
|
6 |
gradio
|
|
|
2 |
-f https://shi-labs.com/natten/wheels/cu118/torch2.0.0/index.html
|
3 |
natten
|
4 |
madmom @ git+https://github.com/CPJKU/madmom
|
5 |
+
allin1
|
6 |
gradio
|