arcan3 commited on
Commit
5374205
·
1 Parent(s): dcbbb6c

added uuid filenames

Browse files
Files changed (1) hide show
  1. app.py +7 -3
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
- name_animation_file = f'animation-{str(uuid.uuid4())}.mp4'
 
 
 
 
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('som_sequence.mp4')
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, 'som_sequence.mp4', name_animation_file, fig
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