From 2f7d8b04dc0ed9b9e1147a730762624797a9f419 Mon Sep 17 00:00:00 2001 From: Emiliana <38952746+emilianavt@users.noreply.github.com> Date: Sat, 28 Nov 2020 15:54:06 +0100 Subject: [PATCH] Fixed a possible division by zero. --- tracker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tracker.py b/tracker.py index 24e16af..7782858 100644 --- a/tracker.py +++ b/tracker.py @@ -531,7 +531,7 @@ class Tracker(): # Multiple faces with single threads self.sessions = [] - self.max_workers = min(max_threads, max_faces) + self.max_workers = max(min(max_threads, max_faces), 1) extra_threads = max_threads % self.max_workers for i in range(self.max_workers): options = onnxruntime.SessionOptions()