Fixed thread calculation.
This commit is contained in:
parent
0a45f64a6f
commit
4ba81cb147
1 changed files with 2 additions and 2 deletions
|
|
@ -497,7 +497,7 @@ class Tracker():
|
|||
def __init__(self, width, height, model_type=3, detection_threshold=0.6, threshold=None, max_faces=1, discard_after=5, scan_every=3, bbox_growth=0.0, max_threads=4, silent=False, model_dir=None, no_gaze=False, use_retinaface=False, max_feature_updates=0, static_model=False, feature_level=2, try_hard=False):
|
||||
options = onnxruntime.SessionOptions()
|
||||
options.inter_op_num_threads = 1
|
||||
options.intra_op_num_threads = max(max_threads,4)
|
||||
options.intra_op_num_threads = min(max_threads,4)
|
||||
options.execution_mode = onnxruntime.ExecutionMode.ORT_SEQUENTIAL
|
||||
options.graph_optimization_level = onnxruntime.GraphOptimizationLevel.ORT_ENABLE_ALL
|
||||
options.log_severity_level = 3
|
||||
|
|
@ -536,7 +536,7 @@ class Tracker():
|
|||
for i in range(self.max_workers):
|
||||
options = onnxruntime.SessionOptions()
|
||||
options.inter_op_num_threads = 1
|
||||
options.intra_op_num_threads = max_threads // self.max_workers
|
||||
options.intra_op_num_threads = min(max(max_threads // self.max_workers, 4), 1)
|
||||
if options.intra_op_num_threads < 1:
|
||||
options.intra_op_num_threads = 1
|
||||
elif i < extra_threads:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue