Luigi commited on
Commit
5fc1115
·
1 Parent(s): aa69ba7

back to normal resolution 384x384 at 75% compression quality

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -124,17 +124,17 @@ def caption_frame(frame, size, model_file, clip_file, interval_ms, sys_prompt, u
124
  debug_msgs.append(f"[{timestamp}] Using CLIP weights: {clip_file}")
125
 
126
  t_resize = time.time()
127
- img = cv2.resize(frame.copy(), (64, 64))
128
  elapsed = (time.time() - t_resize) * 1000
129
  timestamp = time.strftime('%H:%M:%S')
130
- debug_msgs.append(f"[{timestamp}] Resized to 64x64 in {elapsed:.1f} ms")
131
 
132
  timestamp = time.strftime('%H:%M:%S')
133
  debug_msgs.append(f"[{timestamp}] Sleeping for {interval_ms} ms")
134
  time.sleep(interval_ms / 1000)
135
 
136
  t_enc = time.time()
137
- params = [int(cv2.IMWRITE_JPEG_QUALITY), 25]
138
  success, jpeg = cv2.imencode('.jpg', img, params)
139
  elapsed = (time.time() - t_enc) * 1000
140
  timestamp = time.strftime('%H:%M:%S')
 
124
  debug_msgs.append(f"[{timestamp}] Using CLIP weights: {clip_file}")
125
 
126
  t_resize = time.time()
127
+ img = cv2.resize(frame.copy(), (384, 384))
128
  elapsed = (time.time() - t_resize) * 1000
129
  timestamp = time.strftime('%H:%M:%S')
130
+ debug_msgs.append(f"[{timestamp}] Resized to 384x384 in {elapsed:.1f} ms")
131
 
132
  timestamp = time.strftime('%H:%M:%S')
133
  debug_msgs.append(f"[{timestamp}] Sleeping for {interval_ms} ms")
134
  time.sleep(interval_ms / 1000)
135
 
136
  t_enc = time.time()
137
+ params = [int(cv2.IMWRITE_JPEG_QUALITY), 75]
138
  success, jpeg = cv2.imencode('.jpg', img, params)
139
  elapsed = (time.time() - t_enc) * 1000
140
  timestamp = time.strftime('%H:%M:%S')