Here’s something fun to do with your family during upcoming holiday gatherings, whether virtual or in-person: Restore your old family photos using this photo restoration app, built with BaseTen and powered by the GFP-GAN model.
GFP-GAN is a blind face restoration model that was published in June 2021 by Xintao Wang, Yu Li, Honglun Zhang, and Ying Shan. Read their paper here: Towards Real-World Blind Face Restoration with Generative Facial Prior. You can also check out their GitHub code.
This model caught our eye when we saw an impressive before and after example making the rounds. We were eager to try the model out ourselves and so decided to build our own photo restoration app with BaseTen.
Here’s what building this photo restoration app with BaseTen entailed:
- We deployed the model on BaseTen. BaseTen provides a pretty simple yet flexible deployment flow, GFP-GAN’s GitHub repo contained the majority of code so it was a matter of installing the dependencies, abstracting the inference functions, and after a simple
baseten.deploy(), we were ready to serve predictions. We’ll shortly add the model to our growing model zoo so all BaseTen users can build apps with it!
- We allocated a single GPU to run inference, which in combination with BaseTen’s request buffering, should be able to handle a decent load.
- We created a new BaseTen application—all we need here is to serve predictions and build a simple frontend.
- We created a worklet (code that defines the application’s business logic).
- We built a view (user-facing interface) that allows users to upload a photo, click a “Restore” button, and see the model output, a restored version of their photo.
- We made the app public, so we could share it with users like you
And ta-da, our very own photo restoration app! BaseTen really is the fastest way to build ML-powered apps.