amanpreet7 commited on
Commit
8358b2c
·
verified ·
1 Parent(s): 06f9405

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -277,18 +277,20 @@ def process_video(api, drive_service, video_file):
277
 
278
  bvh_file_id, bvh_url, bvh_filename = get_bvh_from_folder(drive_service)
279
  if bvh_url and bvh_filename:
280
- # Automatically download the BVH file
281
  bvh_path, bvh_data = download_and_save_bvh(bvh_url, bvh_filename or "motion_capture.bvh")
282
 
283
  if bvh_path and bvh_data:
284
  progress_bar.progress(1.0)
285
  progress_text.text("Complete!")
286
 
287
- # Cleanup files on Google Drive
288
  if video_file_id:
289
  delete_from_drive(drive_service, video_file_id)
 
290
  if bvh_file_id:
291
  delete_from_drive(drive_service, bvh_file_id)
 
292
 
293
  st.success("Motion capture complete! BVH file ready for download.")
294
 
 
277
 
278
  bvh_file_id, bvh_url, bvh_filename = get_bvh_from_folder(drive_service)
279
  if bvh_url and bvh_filename:
280
+ # Immediately download the BVH file
281
  bvh_path, bvh_data = download_and_save_bvh(bvh_url, bvh_filename or "motion_capture.bvh")
282
 
283
  if bvh_path and bvh_data:
284
  progress_bar.progress(1.0)
285
  progress_text.text("Complete!")
286
 
287
+ # Immediately delete files from Google Drive
288
  if video_file_id:
289
  delete_from_drive(drive_service, video_file_id)
290
+ video_file_id = None # Set to None to prevent double deletion in cleanup
291
  if bvh_file_id:
292
  delete_from_drive(drive_service, bvh_file_id)
293
+ bvh_file_id = None # Set to None to prevent double deletion in cleanup
294
 
295
  st.success("Motion capture complete! BVH file ready for download.")
296