Spaces:
Runtime error
Runtime error
Update webapp.py
Browse files
webapp.py
CHANGED
@@ -281,12 +281,13 @@ class DemoCase:
|
|
281 |
if self._is_running:
|
282 |
if self.stream0 is None:
|
283 |
# Start the stream, set desired resolution to be 720p
|
284 |
-
options = {"STREAM_RESOLUTION": self.STREAM_RESOLUTION}
|
285 |
self.stream0 = CamGear(
|
286 |
source=self.url_dict[self.cam_loc],
|
287 |
colorspace=None,
|
288 |
stream_mode=True,
|
289 |
-
logging=True
|
|
|
290 |
).start()
|
291 |
|
292 |
try:
|
@@ -314,7 +315,7 @@ class DemoCase:
|
|
314 |
)
|
315 |
# reducer frame size for performance, percentage int
|
316 |
frame = await reducer(
|
317 |
-
frame, percentage=self.frame_reduction
|
318 |
)
|
319 |
# handle JPEG encoding & yield frame in byte format
|
320 |
img_encoded = cv2.imencode(".jpg", frame)[1].tobytes()
|
@@ -386,13 +387,13 @@ class DemoCase:
|
|
386 |
if self._is_running:
|
387 |
if self.stream1 is None:
|
388 |
# Start the stream, set desired quality as 720p
|
389 |
-
options = {"STREAM_RESOLUTION": self.STREAM_RESOLUTION}
|
390 |
self.stream1 = CamGear(
|
391 |
source=self.url_dict[self.cam_loc],
|
392 |
colorspace=None,
|
393 |
stream_mode=True,
|
394 |
logging=True,
|
395 |
-
**options
|
396 |
).start()
|
397 |
|
398 |
if (self._is_tracking and self.stream1 is not None):
|
|
|
281 |
if self._is_running:
|
282 |
if self.stream0 is None:
|
283 |
# Start the stream, set desired resolution to be 720p
|
284 |
+
# options = {"STREAM_RESOLUTION": self.STREAM_RESOLUTION}
|
285 |
self.stream0 = CamGear(
|
286 |
source=self.url_dict[self.cam_loc],
|
287 |
colorspace=None,
|
288 |
stream_mode=True,
|
289 |
+
logging=True,
|
290 |
+
# **options
|
291 |
).start()
|
292 |
|
293 |
try:
|
|
|
315 |
)
|
316 |
# reducer frame size for performance, percentage int
|
317 |
frame = await reducer(
|
318 |
+
frame, percentage=self.frame_reduction*frame.shape[0]/720
|
319 |
)
|
320 |
# handle JPEG encoding & yield frame in byte format
|
321 |
img_encoded = cv2.imencode(".jpg", frame)[1].tobytes()
|
|
|
387 |
if self._is_running:
|
388 |
if self.stream1 is None:
|
389 |
# Start the stream, set desired quality as 720p
|
390 |
+
# options = {"STREAM_RESOLUTION": self.STREAM_RESOLUTION}
|
391 |
self.stream1 = CamGear(
|
392 |
source=self.url_dict[self.cam_loc],
|
393 |
colorspace=None,
|
394 |
stream_mode=True,
|
395 |
logging=True,
|
396 |
+
# **options
|
397 |
).start()
|
398 |
|
399 |
if (self._is_tracking and self.stream1 is not None):
|