Spaces:
Build error
Build error
removed the tiing from som activation
Browse files- app.py +2 -3
- funcs/som.py +2 -2
app.py
CHANGED
|
@@ -179,7 +179,7 @@ def scores_to_dataframe(scores, start_time='2022-07-01 09:15:00+05:30', start_sc
|
|
| 179 |
|
| 180 |
def get_som_mp4_v2(csv_file_box, slice_size_slider, sample_rate, window_size_slider, reducer=reducer10d, cluster=cluster_som):
|
| 181 |
processed_file_box, json_file_box, slices_per_leg, plot_box_leg, plot_box_overlay, slice_slider, plot_slice_leg, get_all_slice, slice_json_box = process_data(csv_file_box, slice_size_slider, sample_rate, window_size_slider)
|
| 182 |
-
|
| 183 |
try:
|
| 184 |
if json_file_box is None:
|
| 185 |
return processed_file_box, json_file_box, slices_per_leg, plot_box_leg, plot_box_overlay, slice_slider, plot_slice_leg, get_all_slice, slice_json_box, None, None
|
|
@@ -231,8 +231,7 @@ def get_som_mp4_v2(csv_file_box, slice_size_slider, sample_rate, window_size_sli
|
|
| 231 |
file = {'csv_file': open('animation_table.csv', 'rb')}
|
| 232 |
response = requests.post(url, files=file)
|
| 233 |
|
| 234 |
-
# The response will contain the binary data of the MP4 file.
|
| 235 |
-
# You can write it to a file like this:
|
| 236 |
with open('animation.mp4', 'wb') as f:
|
| 237 |
f.write(response.content)
|
| 238 |
|
|
|
|
| 179 |
|
| 180 |
def get_som_mp4_v2(csv_file_box, slice_size_slider, sample_rate, window_size_slider, reducer=reducer10d, cluster=cluster_som):
|
| 181 |
processed_file_box, json_file_box, slices_per_leg, plot_box_leg, plot_box_overlay, slice_slider, plot_slice_leg, get_all_slice, slice_json_box = process_data(csv_file_box, slice_size_slider, sample_rate, window_size_slider)
|
| 182 |
+
print('finished processing')
|
| 183 |
try:
|
| 184 |
if json_file_box is None:
|
| 185 |
return processed_file_box, json_file_box, slices_per_leg, plot_box_leg, plot_box_overlay, slice_slider, plot_slice_leg, get_all_slice, slice_json_box, None, None
|
|
|
|
| 231 |
file = {'csv_file': open('animation_table.csv', 'rb')}
|
| 232 |
response = requests.post(url, files=file)
|
| 233 |
|
| 234 |
+
# The response will contain the binary data of the MP4 file. You can write it to a file like this:
|
|
|
|
| 235 |
with open('animation.mp4', 'wb') as f:
|
| 236 |
f.write(response.content)
|
| 237 |
|
funcs/som.py
CHANGED
|
@@ -186,8 +186,8 @@ class ClusterSOM:
|
|
| 186 |
plt.close()
|
| 187 |
|
| 188 |
# Set default frame duration if `times` is not provided.
|
| 189 |
-
if times is None:
|
| 190 |
-
|
| 191 |
|
| 192 |
# Create the video using moviepy and save it as a mp4 file
|
| 193 |
video = ImageSequenceClip(images, fps=30)
|
|
|
|
| 186 |
plt.close()
|
| 187 |
|
| 188 |
# Set default frame duration if `times` is not provided.
|
| 189 |
+
# if times is None:
|
| 190 |
+
# times = [500 for _ in range(len(images))]
|
| 191 |
|
| 192 |
# Create the video using moviepy and save it as a mp4 file
|
| 193 |
video = ImageSequenceClip(images, fps=30)
|