@@ -140,7 +140,7 @@ def worker_thread(session, frame, input, crop_info, queue, input_name, idx, trac
140
140
conf , lms = tracker .landmarks (output [0 ], crop_info )
141
141
if conf > tracker .threshold :
142
142
try :
143
- eye_state = tracker .get_eye_state (frame , lms , single = True )
143
+ eye_state = tracker .get_eye_state (frame , lms )
144
144
except :
145
145
eye_state = [(1.0 , 0.0 , 0.0 , 0.0 ), (1.0 , 0.0 , 0.0 , 0.0 )]
146
146
queue .put ((session , conf , (lms , eye_state ), crop_info , idx ))
@@ -548,14 +548,12 @@ def __init__(self, width, height, model_type=3, detection_threshold=0.6, thresho
548
548
self .input_name = self .session .get_inputs ()[0 ].name
549
549
550
550
options = onnxruntime .SessionOptions ()
551
- options .inter_op_num_threads = 1
552
- options .intra_op_num_threads = max ( max_threads , 4 )
551
+ # options.intra_op_num_threads = max(max_threads,4)
552
+ options .intra_op_num_threads = 1
553
553
options .execution_mode = onnxruntime .ExecutionMode .ORT_SEQUENTIAL
554
554
options .graph_optimization_level = onnxruntime .GraphOptimizationLevel .ORT_ENABLE_ALL
555
555
options .log_severity_level = 3
556
556
self .gaze_model = onnxruntime .InferenceSession (os .path .join (model_base_path , "mnv3_gaze32_split_opt.onnx" ), sess_options = options )
557
- options .intra_op_num_threads = 1
558
- self .gaze_model_single = onnxruntime .InferenceSession (os .path .join (model_base_path , "mnv3_gaze32_split_opt.onnx" ), sess_options = options )
559
557
560
558
self .detection = onnxruntime .InferenceSession (os .path .join (model_base_path , "mnv3_detection_opt.onnx" ), sess_options = options )
561
559
self .faces = []
@@ -922,7 +920,7 @@ def extract_face(self, frame, lms):
922
920
frame = frame [y1 :y2 , x1 :x2 ]
923
921
return frame , lms , offset
924
922
925
- def get_eye_state (self , frame , lms , single = False ):
923
+ def get_eye_state (self , frame , lms ):
926
924
if self .no_gaze :
927
925
return [(1.0 , 0.0 , 0.0 , 0.0 ), (1.0 , 0.0 , 0.0 , 0.0 )]
928
926
lms = np .array (lms )
@@ -938,10 +936,7 @@ def get_eye_state(self, frame, lms, single=False):
938
936
return [(1.0 , 0.0 , 0.0 , 0.0 ), (1.0 , 0.0 , 0.0 , 0.0 )]
939
937
both_eyes = np .concatenate ((right_eye , left_eye ))
940
938
results = None
941
- if single :
942
- results = self .gaze_model_single .run ([], {self .input_name : both_eyes })
943
- else :
944
- results = self .gaze_model .run ([], {self .input_name : both_eyes })
939
+ results = self .gaze_model .run ([], {self .input_name : both_eyes })
945
940
open = [0 , 0 ]
946
941
open [0 ] = 1 #results[1][0].argmax()
947
942
open [1 ] = 1 #results[1][1].argmax()
0 commit comments