multimodalart HF staff commited on
Commit
92a7202
·
1 Parent(s): 1ec57b2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -162,19 +162,19 @@ def preprocess_and_invert(input_video,
162
  preprocess_config['inversion_prompt'] = inversion_prompt
163
  not_processed = False
164
  if(not frames):
165
- preprocess_config['frames'],frames_per_second = video_to_frames(input_video)
166
  not_processed = True
167
  else:
168
  preprocess_config['frames'] = frames
169
  preprocess_config['data_path'] = input_video.split(".")[0]
170
 
171
  total_vid_frames = len(preprocess_config['frames'])
172
- total_vid_duration = total_vid_frames/frames_per_second
173
 
174
  if(total_vid_duration < 1):
175
  preprocess_config['n_frames'] = total_vid_frames
176
  else:
177
- preprocess_config['n_frames'] = int(frames_per_second/n_seconds)
178
 
179
  if preprocess_config['n_frames'] % batch_size != 0:
180
  preprocess_config['batch_size'] = largest_divisor(batch_size)
 
162
  preprocess_config['inversion_prompt'] = inversion_prompt
163
  not_processed = False
164
  if(not frames):
165
+ preprocess_config['frames'],n_fps_input = video_to_frames(input_video)
166
  not_processed = True
167
  else:
168
  preprocess_config['frames'] = frames
169
  preprocess_config['data_path'] = input_video.split(".")[0]
170
 
171
  total_vid_frames = len(preprocess_config['frames'])
172
+ total_vid_duration = total_vid_frames/n_fps_input
173
 
174
  if(total_vid_duration < 1):
175
  preprocess_config['n_frames'] = total_vid_frames
176
  else:
177
+ preprocess_config['n_frames'] = int(n_fps_input/n_seconds)
178
 
179
  if preprocess_config['n_frames'] % batch_size != 0:
180
  preprocess_config['batch_size'] = largest_divisor(batch_size)