Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
BrightHai committed Apr 2, 2022
2 parents 56561d1 + b05108d commit 1b33616
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion service/image_infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ def __init__(self, model_path):
self.cls_thresh = 0.5
self.nms_thresh = 0.2
self.model_path = model_path
self.model_session = onnxruntime.InferenceSession(self.model_path)
so = onnxruntime.SessionOptions()
# 配置intra_op_num_threads为CPU核数时最佳
so.intra_op_num_threads = 4
self.model_session = onnxruntime.InferenceSession(self.model_path, sess_options=so)

def ui_infer(self, image_path):
origin_img = cv2.imread(image_path)
Expand Down

0 comments on commit 1b33616

Please sign in to comment.