Like everybody else in this COVID 19 time, in my work we are practicing social distancing, so, all meetings are online. One coworker was using a background filter in Teams and i want to do the same, unfortunately, filters are not available for linux at this moment, so, i implement my own filter (for fun).
While researching how to implement filters, i found this excellent post:
https://elder.dev/posts/open-source-virtual-background/
In this post they use docker whit a model called BodyPix for generating a mask of the background, i did not like this. I remember a model called Deeplab, this model implement semantic image segmentation
https://github.com/tensorflow/models/tree/master/research/deeplab
So, i get a trained model form the model zoo
https://github.com/tensorflow/models/blob/master/research/deeplab/g3doc/model_zoo.md
I implement it and!!!!
Nice! but i find the borders too big for me, so i apply an erode filter
Deeplab v3 inference Mask + erode
Better. Next step is mix the input and the mask
The result was not perfect (good for the work), the latency was ok whit my nvidia video card.
OK Background removal finished…. What i do now ? well… I love ASCII Art! y and found this cool post:
https://wshanshan.github.io/python/asciiart/
I implement the ASCII Art transformation function in my code and this is the result:
Pretty cool.
So, next step is make this a make this behave like a Webcam, for that, we use pyfakewebcam and v4l2loopback (like in elder.dev post) and we get this:
You can get the source code and install instructions in:
https://github.com/diegovazquez/ASCIILinuxVirtualWebCam
Thank you for reading.
submitted by /u/dhvazquez
[link] [comments]
from Linux, GNU/Linux, free software… https://ift.tt/2VG953K