freealise commited on
Commit
78c46b3
1 Parent(s): c2f3170

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -135,9 +135,12 @@ def make_video(video_path, outdir='./vis_video_depth', encoder='vits'):
135
  if not ret:
136
  break
137
 
138
- thumbnail = cv2.cvtColor(cv2.resize(raw_frame, (128,256)), cv2.COLOR_BGR2GRAY)
139
- if len(thumbnail_old) > 0 and (thumbnail == thumbnail_old).all() == True:
140
- continue
 
 
 
141
  thumbnail_old = thumbnail
142
 
143
  frame = cv2.cvtColor(raw_frame, cv2.COLOR_BGR2RGB) / 255.0
 
135
  if not ret:
136
  break
137
 
138
+ thumbnail = cv2.cvtColor(cv2.resize(raw_frame, (16,32)), cv2.COLOR_BGR2GRAY).flatten()
139
+ if len(thumbnail_old) > 0:
140
+ diff = thumbnail - thumbnail_old
141
+ print(diff)
142
+ if sum(diff) == 0:
143
+ continue
144
  thumbnail_old = thumbnail
145
 
146
  frame = cv2.cvtColor(raw_frame, cv2.COLOR_BGR2RGB) / 255.0