autonomous019 commited on
Commit
2a965e1
1 Parent(s): 57b9cb8

replaced test image with dynamic image

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -48,9 +48,11 @@ model = VisionEncoderDecoderModel.from_pretrained("./vit-bert")
48
  def self_caption(image):
49
  repo_name = "ydshieh/vit-gpt2-coco-en"
50
  #test_image = "cats.jpg"
51
- url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
52
- test_image = Image.open(requests.get(url, stream=True).raw)
53
- test_image.save("cats.png")
 
 
54
  feature_extractor2 = ViTFeatureExtractor.from_pretrained(repo_name)
55
  tokenizer = AutoTokenizer.from_pretrained(repo_name)
56
  model2 = VisionEncoderDecoderModel.from_pretrained(repo_name)
 
48
  def self_caption(image):
49
  repo_name = "ydshieh/vit-gpt2-coco-en"
50
  #test_image = "cats.jpg"
51
+ test_image = image
52
+ #url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
53
+ #test_image = Image.open(requests.get(url, stream=True).raw)
54
+ #test_image.save("cats.png")
55
+
56
  feature_extractor2 = ViTFeatureExtractor.from_pretrained(repo_name)
57
  tokenizer = AutoTokenizer.from_pretrained(repo_name)
58
  model2 = VisionEncoderDecoderModel.from_pretrained(repo_name)