We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 080081d + 27b4e86 commit b05108dCopy full SHA for b05108d
service/image_infer.py
@@ -14,7 +14,10 @@ def __init__(self, model_path):
14
self.cls_thresh = 0.5
15
self.nms_thresh = 0.2
16
self.model_path = model_path
17
- self.model_session = onnxruntime.InferenceSession(self.model_path)
+ so = onnxruntime.SessionOptions()
18
+ # 配置intra_op_num_threads为CPU核数时最佳
19
+ so.intra_op_num_threads = 4
20
+ self.model_session = onnxruntime.InferenceSession(self.model_path, sess_options=so)
21
22
def ui_infer(self, image_path):
23
origin_img = cv2.imread(image_path)
0 commit comments