Spanicin commited on
Commit
372a492
·
verified ·
1 Parent(s): 3845d1c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -142,9 +142,10 @@ def main(args):
142
  # first_coeff_path, crop_pic_path, crop_info = preprocess_model.generate(pic_path, first_frame_dir, args.preprocess,\
143
  # source_image_flag=True, pic_size=args.size)
144
 
145
- preprocess_dir = os.path.join(TEMP_DIR.name, "preprocess_data")
146
- os.makedirs(preprocess_dir, exist_ok=True)
147
- preprocessed_data_path = os.path.join(preprocess_dir, "preprocessed_data.pkl")
 
148
 
149
  if os.path.exists(preprocessed_data_path) and image_hardcoded == "yes":
150
  print("Loading preprocessed data...")
@@ -547,7 +548,7 @@ def check_generation_status():
547
  print("Deleted video file:", final_video_path)
548
 
549
  # TEMP_DIR.cleanup()
550
- preprocess_dir = os.path.join(TEMP_DIR.name, "preprocess_data")
551
  custom_cleanup(TEMP_DIR.name, preprocess_dir)
552
 
553
  print("Temporary files cleaned up, but preprocess_data is retained.")
 
142
  # first_coeff_path, crop_pic_path, crop_info = preprocess_model.generate(pic_path, first_frame_dir, args.preprocess,\
143
  # source_image_flag=True, pic_size=args.size)
144
 
145
+
146
+ fixed_temp_dir = "/tmp/preprocess_data"
147
+ os.makedirs(fixed_temp_dir, exist_ok=True)
148
+ preprocessed_data_path = os.path.join(fixed_temp_dir, "preprocessed_data.pkl")
149
 
150
  if os.path.exists(preprocessed_data_path) and image_hardcoded == "yes":
151
  print("Loading preprocessed data...")
 
548
  print("Deleted video file:", final_video_path)
549
 
550
  # TEMP_DIR.cleanup()
551
+ preprocess_dir = os.path.join("/tmp", "preprocess_data")
552
  custom_cleanup(TEMP_DIR.name, preprocess_dir)
553
 
554
  print("Temporary files cleaned up, but preprocess_data is retained.")