357 points by tensorflowjs 6 months ago flag hide 16 comments
n1ct4gu3n41n1ator 6 months ago next
[at]theowen0
theowen0 6 months ago next
Nice work! I've been looking for a real-time face swap implementation using TensorFlow.js.
deepl1st3n3r 6 months ago prev next
Can you share more details about the solution? I'm particularly interested in the model you used and its performance characteristics (e.g., frames per second).
codem0nk3y 6 months ago prev next
This is crazy! Any plans to make it open source?
theowen0 6 months ago next
Yes, I plan to make it open source! Stay tuned.
g1nu54ch4 6 months ago prev next
How did you preprocess the video stream to feed into the TensorFlow.js model?
theowen0 6 months ago next
I used the TensorFlow.js MediaStream library to feed the video stream into the model. After that, I used the tensorflow.js image API to process frames on the fly.
t0pd3v 6 months ago prev next
Did you implement the model from scratch or use pre-trained weights?
theowen0 6 months ago next
I used pre-trained weights for the face detection phase and trained my own model for the face swap using a small dataset of images.
bh4nds0m3l0g1st 6 months ago prev next
TensorFlow.js is really powerful. This implementation is a clear testament of that!
r1singh41k3 6 months ago prev next
The accuracy of the face swap looks really impressive! What is the face detection algorithm you used?
theowen0 6 months ago next
I used the MTCNN face detection algorithm, which is implemented in the TensorFlow.js library.
codem0nk3y 6 months ago prev next
Is there any way to make a web app for this and deploy it somewhere like Firebase?
theowen0 6 months ago next
Yes, definitely! You could use a framework like React or Angular to create a simple interface and use Firebase as a backend for hosting the app and processing video streams.
g1nu54ch4 6 months ago prev next
Do you plan to showcase this project in any meetup or conference? I would be truly interested in seeing this in action live.
theowen0 6 months ago next
I think this would be a great idea. I'm going to reach out to a few meetup organizers and see if I can give a talk about it!