File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -89,9 +89,13 @@ def __init__(
89
89
self .calibrate_config = np .empty ((1 , 45 ))
90
90
self .min_max_array = np .empty ((2 , 45 ))
91
91
92
+ ort .disable_telemetry_events ()
92
93
self .opts = ort .SessionOptions ()
94
+ self .opts .inter_op_num_threads = 1
93
95
self .opts .intra_op_num_threads = settings .gui_inference_threads
94
96
self .opts .graph_optimization_level = ort .GraphOptimizationLevel .ORT_ENABLE_ALL
97
+ self .opts .add_session_config_entry ("session.intra_op.allow_spinning" , "0" ) # ~3% savings worth ~6ms avg latency. Not noticeable at 60fps?
98
+ self .opts .enable_mem_pattern = False
95
99
if self .runtime in ("ONNX" , "Default (ONNX)" ): # ONNX
96
100
if self .use_gpu :
97
101
provider = "DmlExecutionProvider"
Original file line number Diff line number Diff line change @@ -88,10 +88,13 @@ def __init__(
88
88
#self.calibrate_config = np.empty((1, 45))
89
89
#self.min_max_array = np.empty((2, 45))
90
90
91
-
91
+ ort . disable_telemetry_events ()
92
92
self .opts = ort .SessionOptions ()
93
+ self .opts .inter_op_num_threads = 1
93
94
self .opts .intra_op_num_threads = settings .gui_inference_threads
94
95
self .opts .graph_optimization_level = ort .GraphOptimizationLevel .ORT_ENABLE_ALL
96
+ self .opts .add_session_config_entry ("session.intra_op.allow_spinning" , "0" ) # ~3% savings worth ~6ms avg latency. Not noticeable at 60fps?
97
+ self .opts .enable_mem_pattern = False
95
98
if self .runtime in ("ONNX" , "Default (ONNX)" ): # ONNX
96
99
if self .use_gpu : provider = 'DmlExecutionProvider'
97
100
else : provider = "CPUExecutionProvider" # Build onnxruntime to get both DML and OpenVINO
@@ -219,7 +222,7 @@ def run(self):
219
222
self .current_image ,
220
223
self .current_frame_number ,
221
224
self .current_fps ,
222
- ) = self .capture_queue_incoming .get (block = True , timeout = 0.2 )
225
+ ) = self .capture_queue_incoming .get (block = True , timeout = 0.1 )
223
226
except queue .Empty :
224
227
# print("No image available")
225
228
continue
You can’t perform that action at this time.
0 commit comments