Spaces:
Runtime error
Runtime error
set default interval to 3s
Browse files
app.py
CHANGED
|
@@ -115,7 +115,7 @@ def caption_frame(frame):
|
|
| 115 |
st.title("🎥 Real-Time Camera Captioning with SmolVLM2 (CPU)")
|
| 116 |
|
| 117 |
interval_ms = st.slider(
|
| 118 |
-
"Caption every N ms", min_value=100, max_value=10000, value=
|
| 119 |
)
|
| 120 |
|
| 121 |
RTC_CONFIG = RTCConfiguration({
|
|
@@ -133,7 +133,6 @@ class CaptionProcessor(VideoProcessorBase):
|
|
| 133 |
now = time.time()
|
| 134 |
if now - self.last_time >= self.interval:
|
| 135 |
self.last_time = now
|
| 136 |
-
print("DEBUG ▶ CaptionProcessor.recv: time reached, generating caption")
|
| 137 |
self.caption = caption_frame(img)
|
| 138 |
return av.VideoFrame.from_ndarray(img, format="bgr24")
|
| 139 |
|
|
|
|
| 115 |
st.title("🎥 Real-Time Camera Captioning with SmolVLM2 (CPU)")
|
| 116 |
|
| 117 |
interval_ms = st.slider(
|
| 118 |
+
"Caption every N ms", min_value=100, max_value=10000, value=3000, step=100
|
| 119 |
)
|
| 120 |
|
| 121 |
RTC_CONFIG = RTCConfiguration({
|
|
|
|
| 133 |
now = time.time()
|
| 134 |
if now - self.last_time >= self.interval:
|
| 135 |
self.last_time = now
|
|
|
|
| 136 |
self.caption = caption_frame(img)
|
| 137 |
return av.VideoFrame.from_ndarray(img, format="bgr24")
|
| 138 |
|