Spaces:
Runtime error
Runtime error
Update webapp.py
Browse files
webapp.py
CHANGED
@@ -144,9 +144,9 @@ class DemoCase:
|
|
144 |
if (bool(cam_loc_key) is False or bool(cam_loc_val) is False):
|
145 |
self.cam_loc = self.cam_loc_default
|
146 |
logging.warning(
|
147 |
-
f
|
148 |
-
f
|
149 |
-
f
|
150 |
)
|
151 |
elif cam_loc_key not in self.url_dict:
|
152 |
if try_site(self.url_dict[self.cam_loc]):
|
@@ -421,22 +421,6 @@ class DemoCase:
|
|
421 |
logging.warning(
|
422 |
"client disconnected in frame1_producer"
|
423 |
)
|
424 |
-
frame = (np.random.standard_normal([
|
425 |
-
self.FRAME_HEIGHT, self.FRAME_WIDTH, 3
|
426 |
-
]) * 255).astype(np.uint8)
|
427 |
-
frame = await reducer(
|
428 |
-
frame, percentage=self.frame_reduction
|
429 |
-
)
|
430 |
-
img_encoded = cv2.imencode(".jpg", frame)[1].tobytes()
|
431 |
-
logging.info(
|
432 |
-
f"_is_running is {self._is_running} in frame0_producer"
|
433 |
-
)
|
434 |
-
yield (
|
435 |
-
b"--frame\r\nContent-Type:video/jpeg2000\r\n\r\n" +
|
436 |
-
img_encoded + b"\r\n"
|
437 |
-
)
|
438 |
-
await asyncio.sleep(0.00001)
|
439 |
-
|
440 |
else:
|
441 |
if self._is_running is True:
|
442 |
pass
|
|
|
144 |
if (bool(cam_loc_key) is False or bool(cam_loc_val) is False):
|
145 |
self.cam_loc = self.cam_loc_default
|
146 |
logging.warning(
|
147 |
+
f"input cam_loc_key, cam_loc_val pair invalid, use default "
|
148 |
+
f"{{{self.cam_loc_default}: "
|
149 |
+
f"{self.url_dict[self.cam_loc_default]}}}"
|
150 |
)
|
151 |
elif cam_loc_key not in self.url_dict:
|
152 |
if try_site(self.url_dict[self.cam_loc]):
|
|
|
421 |
logging.warning(
|
422 |
"client disconnected in frame1_producer"
|
423 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
424 |
else:
|
425 |
if self._is_running is True:
|
426 |
pass
|