emilianavt / OpenSeeFace

Robust realtime face and facial landmark tracking on CPU with Unity integration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

single in get_eye_state

kwea123 opened this issue · comments

commented

What does the single in get_eye_state mean?

def get_eye_state(self, frame, lms, single=False):

I guess it's for detecting multiple people's eyes? Anyway, when num_crops == 1 (ie only 1 person), I think this argument needs to be set to true here:

eye_state = self.get_eye_state(frame, lms)

Otherwise, it consumes too much cpu! Initially I found this because the built VSeeFace.exe consumes only ~10% cpu, but using this python script with lower fps consumes up to 20% cpu, so I was wondering what makes the difference. After setting single=True inside that code, now the cpu usage is about the same (10%).

Thank you for the message!

I guess it's for detecting multiple people's eyes?

It actually uses the model instantiated with single threaded settings, so it was intended to be used when tracking multiple faces. However, I found that onnxruntime has some issues with very high CPU usage when multiple threads are set, so VSeeFace always calls the tracker with --max-threads 1, which has the same effect as setting single=True here for the eye tracking. I should probably update facetracker.py to make this the default setting.

Edit: I changed it to always behave like single=True in 1264cc2.