Do you know it is super easy to deploy a Gradio APP on Jarvislabs.ai 🤔 In this post we will explore how to deploy a Marvel character classifier app on Jarvislabs.ai.
You can play with the app here.
For training the classifier, We use a slightly modified version of Jeremy Howard's kaggle kernel.
To create the Gradio app, all we need is the below code.
from fastai.vision.all import *
path = Path('marvel_characters')
dls = DataBlock(
learn = vision_learner(dls, 'seresnext50_32x4d')
character,_,probs = learn.predict(img)
probs = [o.item() for o in probs]
import gradio as gr
demo = gr.Interface(fn=find_character,
if __name__ == "__main__":
All we need to do is, create a
- fastai datablock
- fastai learner
- Predict function
- Gradio Interface function
- Launch the app
Lets focus on the last line in the above code, the rest is mostly self explanatory.
We are asking Gradio to make the app available in the local network and run it on port number
Jarvislabs.ai takes care of the rest and
provides you with an
url which you can share it with your friends/colleagues. You can access the
url by right clicking on your running instance.
If you do not want to run it on a GPU, simply pause and switch the instance to CPU only.
Would love to know what you build using this 😄.