final cleanup; setting `supervision>=0.20.0` in `requirements.txt` and refactoring stream processing scripts

This commit is contained in:
SkalskiP 2024-04-24 22:41:59 +02:00
parent d531c59f85
commit a45341ce63
6 changed files with 18 additions and 24 deletions

View File

@ -1,5 +1,5 @@
gdown
inference
supervision==0.19.0
supervision>=0.20.0
tqdm
ultralytics

View File

@ -1,4 +1,4 @@
supervision==0.19.0
supervision>=0.20.0
tqdm==4.66.1
requests
ultralytics==8.0.237

View File

@ -24,18 +24,15 @@ class CustomSink:
self.fps_monitor = sv.FPSMonitor()
self.polygons = load_zones_config(file_path=zone_configuration_path)
self.timers = [ClockBasedTimer() for _ in self.polygons]
self.zones = None
self.zones = [
sv.PolygonZone(
polygon=polygon,
triggering_anchors=(sv.Position.CENTER,),
)
for polygon in self.polygons
]
def on_prediction(self, result: dict, frame: VideoFrame) -> None:
if self.zones is None:
self.zones = [
sv.PolygonZone(
polygon=polygon,
triggering_anchors=(sv.Position.CENTER,),
)
for polygon in self.polygons
]
self.fps_monitor.tick()
fps = self.fps_monitor.fps

View File

@ -1,5 +1,5 @@
opencv-python
supervision
supervision>=0.20.0
ultralytics
inference
pytube

View File

@ -25,18 +25,15 @@ class CustomSink:
self.fps_monitor = sv.FPSMonitor()
self.polygons = load_zones_config(file_path=zone_configuration_path)
self.timers = [ClockBasedTimer() for _ in self.polygons]
self.zones = None
self.zones = [
sv.PolygonZone(
polygon=polygon,
triggering_anchors=(sv.Position.CENTER,),
)
for polygon in self.polygons
]
def on_prediction(self, detections: sv.Detections, frame: VideoFrame) -> None:
if self.zones is None:
self.zones = [
sv.PolygonZone(
polygon=polygon,
triggering_anchors=(sv.Position.CENTER,),
)
for polygon in self.polygons
]
self.fps_monitor.tick()
fps = self.fps_monitor.fps

View File

@ -1,5 +1,5 @@
gdown
inference
supervision>=0.19.0
supervision>=0.20.0
tqdm
ultralytics