Skip to content

Commit

Permalink
Try faster threading
Browse files Browse the repository at this point in the history
  • Loading branch information
briemla committed Sep 24, 2024
1 parent 5010b8f commit ec97915
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions OTVision/detect/yolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ def _load_model(self) -> YOLOv8:

def _predict(self, video: Path) -> Generator[Results, None, None]:
with av.open(str(video.absolute())) as container:
container.streams.video[0].thread_type = "AUTO"
for frame in container.decode(video=0):
results = self.model.predict(
source=frame.to_ndarray(format="rgb24"),
Expand Down

0 comments on commit ec97915

Please sign in to comment.