Spaces:
Build error
Build error
added uuid filenames
Browse files
app.py
CHANGED
@@ -225,7 +225,11 @@ def get_som_mp4_v2(csv_file_box, slice_size_slider, sample_rate, window_size_sli
|
|
225 |
csv_writer.writerow(header)
|
226 |
csv_writer.writerows(processed_data)
|
227 |
|
228 |
-
|
|
|
|
|
|
|
|
|
229 |
os.system(f'curl -X POST -F "csv_file=@animation_table.csv" https://metric-space.ngrok.io/generate --output {name_animation_file}')
|
230 |
# #with hhtp requests
|
231 |
# url = "https://metric-space.ngrok.io/generate"
|
@@ -241,11 +245,11 @@ def get_som_mp4_v2(csv_file_box, slice_size_slider, sample_rate, window_size_sli
|
|
241 |
# passing the time values for each slice
|
242 |
|
243 |
som_video = cluster.plot_activation(embedding10d, times=time_list)
|
244 |
-
som_video.write_videofile(
|
245 |
|
246 |
# 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, som_video, 'animation.mp4', fig
|
247 |
|
248 |
-
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,
|
249 |
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, 'som_sequence.mp4', None
|
250 |
|
251 |
# ml inference
|
|
|
225 |
csv_writer.writerow(header)
|
226 |
csv_writer.writerows(processed_data)
|
227 |
|
228 |
+
|
229 |
+
uuid_name = f'{str(uuid.uuid4())}'
|
230 |
+
name_animation_file = f'animation-{uuid_name}.mp4'
|
231 |
+
name_som_sequence_file = f'sequence-{uuid_name}.mp4'
|
232 |
+
|
233 |
os.system(f'curl -X POST -F "csv_file=@animation_table.csv" https://metric-space.ngrok.io/generate --output {name_animation_file}')
|
234 |
# #with hhtp requests
|
235 |
# url = "https://metric-space.ngrok.io/generate"
|
|
|
245 |
# passing the time values for each slice
|
246 |
|
247 |
som_video = cluster.plot_activation(embedding10d, times=time_list)
|
248 |
+
som_video.write_videofile(name_som_sequence_file)
|
249 |
|
250 |
# 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, som_video, 'animation.mp4', fig
|
251 |
|
252 |
+
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, name_som_sequence_file, name_animation_file, fig
|
253 |
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, 'som_sequence.mp4', None
|
254 |
|
255 |
# ml inference
|