steveyin commited on
Commit
426a72f
·
verified ·
1 Parent(s): c01d416

Upload webapp.py

Browse files
Files changed (1) hide show
  1. webapp.py +7 -3
webapp.py CHANGED
@@ -49,6 +49,7 @@ class DemoCase:
49
  self.FRAME_WIDTH: int = FRAME_WIDTH
50
  self.FRAME_HEIGHT: int = FRAME_HEIGHT
51
  self.YOLO_VERBOSE: bool = YOLO_VERBOSE
 
52
  # predefined yolov8 model references
53
  self.model_dict: dict = {
54
  "y8nano": "./data/models/yolov8n.pt",
@@ -279,7 +280,8 @@ class DemoCase:
279
  while True:
280
  if self._is_running:
281
  if self.stream0 is None:
282
- # Start the stream
 
283
  self.stream0 = CamGear(
284
  source=self.url_dict[self.cam_loc],
285
  colorspace=None,
@@ -383,12 +385,14 @@ class DemoCase:
383
  while True:
384
  if self._is_running:
385
  if self.stream1 is None:
386
- # Start the stream
 
387
  self.stream1 = CamGear(
388
  source=self.url_dict[self.cam_loc],
389
  colorspace=None,
390
  stream_mode=True,
391
- logging=True
 
392
  ).start()
393
 
394
  if (self._is_tracking and self.stream1 is not None):
 
49
  self.FRAME_WIDTH: int = FRAME_WIDTH
50
  self.FRAME_HEIGHT: int = FRAME_HEIGHT
51
  self.YOLO_VERBOSE: bool = YOLO_VERBOSE
52
+ self.STREAM_RESOLUTION: str = "720p"
53
  # predefined yolov8 model references
54
  self.model_dict: dict = {
55
  "y8nano": "./data/models/yolov8n.pt",
 
280
  while True:
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,
 
385
  while True:
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):