import gradio as gr from gradio.mix import Parallel, Series import torch # Images torch.hub.download_url_to_file('http://images.cocodataset.org/val2017/000000039769.jpg', 'cat.jpg') torch.hub.download_url_to_file('https://cdn.pixabay.com/photo/2015/06/08/15/02/pug-801826_1280.jpg', 'dog.jpg') io1 = gr.Interface.load("huggingface/google/vit-base-patch16-224") io2 = gr.Interface.load("huggingface/facebook/deit-base-distilled-patch16-224") title = "VIT and Deit Parallel Demo" description = "Demo for 2 Vision Transformers: Google VIT and Facebook Deit using Gradio Parallel and Huggingface Models. Upload an image or click an example image to use. Read more at the links below" article = "
VIT | Vision Transformer Github | Deit| Deit Github | Gradio Blog
" examples = [['cat.jpg'], ['dog.jpg']] Parallel(io1, io2, title=title, description=description, article=article, examples=examples).launch()