autonomous019 commited on
Commit
2979393
1 Parent(s): f08c73b

test_image code calling url

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -43,7 +43,10 @@ model = VisionEncoderDecoderModel.from_pretrained("./vit-bert")
43
  '''
44
 
45
  repo_name = "ydshieh/vit-gpt2-coco-en"
46
- test_image = "cats.jpg"
 
 
 
47
  feature_extractor2 = ViTFeatureExtractor.from_pretrained(repo_name)
48
  tokenizer = AutoTokenizer.from_pretrained(repo_name)
49
  model2 = VisionEncoderDecoderModel.from_pretrained(repo_name)
 
43
  '''
44
 
45
  repo_name = "ydshieh/vit-gpt2-coco-en"
46
+ #test_image = "cats.jpg"
47
+ url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
48
+ test_image = Image.open(requests.get(url, stream=True).raw)
49
+ test_image.save("cats.png")
50
  feature_extractor2 = ViTFeatureExtractor.from_pretrained(repo_name)
51
  tokenizer = AutoTokenizer.from_pretrained(repo_name)
52
  model2 = VisionEncoderDecoderModel.from_pretrained(repo_name)