nielsr HF staff commited on
Commit
89bb5fe
1 Parent(s): f3e91bc

Add another example

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -3,6 +3,7 @@ from transformers import ImageClassificationPipeline, PerceiverForImageClassific
3
  import torch
4
 
5
  torch.hub.download_url_to_file('http://images.cocodataset.org/val2017/000000039769.jpg', 'cats.jpg')
 
6
 
7
  feature_extractor = PerceiverFeatureExtractor()
8
  model = PerceiverForImageClassificationConvProcessing.from_pretrained("deepmind/vision-perceiver-conv")
@@ -28,6 +29,6 @@ def classify_image(image):
28
 
29
  image = gr.inputs.Image(type="pil")
30
  label = gr.outputs.Label(num_top_classes=5)
31
- examples = [["cats.jpg"]]
32
 
33
  gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples, enable_queue=True).launch(debug=True)
 
3
  import torch
4
 
5
  torch.hub.download_url_to_file('http://images.cocodataset.org/val2017/000000039769.jpg', 'cats.jpg')
6
+ torch.hub.download_url_to_file('https://storage.googleapis.com/perceiver_io/dalmation.jpg', 'dog.jpg')
7
 
8
  feature_extractor = PerceiverFeatureExtractor()
9
  model = PerceiverForImageClassificationConvProcessing.from_pretrained("deepmind/vision-perceiver-conv")
 
29
 
30
  image = gr.inputs.Image(type="pil")
31
  label = gr.outputs.Label(num_top_classes=5)
32
+ examples = [["cats.jpg"], ["dog.jpg"]]
33
 
34
  gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples, enable_queue=True).launch(debug=True)