Yaroslav commited on
Commit
2b88e41
·
verified ·
1 Parent(s): 6f47cc6

making real 60: part 1

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -40,10 +40,10 @@ def increase_fps(input_video_path, target_fps=60):
40
  # Оптический поток
41
  flow = cv2.calcOpticalFlowFarneback(prev_frame_gray, next_frame_gray, None, 0.5, 3, 15, 3, 5, 1.2, 0)
42
 
43
- # Генерация промежуточных кадров
44
  for i in range(1, int(ratio)):
45
  alpha = i / ratio
46
- intermediate_frame = cv2.addWeighted(prev_frame, 1 - alpha, next_frame, alpha, 0)
 
47
  output.write(intermediate_frame)
48
 
49
  output.write(next_frame)
 
40
  # Оптический поток
41
  flow = cv2.calcOpticalFlowFarneback(prev_frame_gray, next_frame_gray, None, 0.5, 3, 15, 3, 5, 1.2, 0)
42
 
 
43
  for i in range(1, int(ratio)):
44
  alpha = i / ratio
45
+ flow_intermediate = flow * alpha
46
+ intermediate_frame = cv2.remap(prev_frame, flow_intermediate, None, cv2.INTER_LINEAR)
47
  output.write(intermediate_frame)
48
 
49
  output.write(next_frame)