-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
auto-track sample implementation #82
Comments
Thank you for that. I am still not quite sure about adding it to this project. If you are not using the bodypix mask otherwise, wouldn't one of the CV face detection options be faster? I will make a few more changes to I will definitely refer back to your code example. |
Sorry, I just found it easiest to add it to python_tf_bodypix. Not professional at all... It works but scaling up the resolution (1920x1080 vs 640x480) becomes a performance problem. I wanted to combine it with the background subtraction that bodypix provides and to be able to select which body parts are cropped. And the model is pretty fast on the CPU. I'll fork the repo and maintain my own version for now. |
What I find that actually calculating individual part masks can take up a significant additional amount. And also combining images. I am sure there must be faster ways even without a GPU. But as it's now, that may be a bit slow when scaling up. For auto-track to work nicely, it will probably be good to interpolate movements and zoom in and out depending on the size of the detected face. My default resolution is 848x480. With that I already find it not looking very sharp. Doesn't it start to look like a bit retro when you significantly zoom in on your face with a similar resolution?
Do you have a GPU that TensorFlow can't use? |
On this branch (https://github.com/benbatya/python-tf-bodypix/tree/autoframe_feature) I'm getting about 13fps. I scale down a high resolution to width=640 and maintain aspect ratio, run bodypix on the smaller image and then scale the bounding boxes. So it maintains the fps okay. The multiple rescaling is a slight perf hit but not as bad as running bodypix on the high resolution. The key is that even if the final resolution is 1/3 of the original high res images, transmitting it into a zoom meeting means that there deceased resolution is not noticable. In big meetings, zoom will drop the resolution of each incoming stream down to 160x90 px at 7fps. It's very good at managing limited bandwidth. I think that your suggestion about interpolating the frames is a good one. I just use a moving window mean to smooth out the camera view motion. Another fix is to handle when there's no detectable body in the frame so the view doesn't revert to default. I have a P1000 on my laptop which I'd like to use but don't know how to run tflite models on it. I think that there's a way to configure the device selection but don't know how to do it. Also, it may not be worth it. The overhead DMA transfer times can be significant so if the model runs fast enough on the cpu, transferring it to the gpu may actually be a slow down |
@de-code I got inspired to split auto-track into a separate mode and just add it to this project.
I like the effect a lot with my 120deg FOV Spedal camera because I can move around the room and it (mostly) tracks my face which is very convenient for long boring meetings. I know that we talked about adding it to layered-vision but it just was easiest to add the additional mode in this project.
Enjoy!
Ben
auto_track.patch.txt
The text was updated successfully, but these errors were encountered: