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.
New in January
Deploy multiple model versions, model resource management, a cleaner Truss DX, and more.
Choosing the right horizontal scaling setup for high-traffic models
Horizontal scaling via replicas with load balancing is an important technique for handling high traffic to an ML model. Let’s examine three tips for understanding how to properly replicate your instances to save users time without wasting your money.