ipvikas commited on
Commit
13f74ae
·
1 Parent(s): 40ab0bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -10
app.py CHANGED
@@ -27,20 +27,16 @@ feature_extractor = ViTFeatureExtractor.from_pretrained(repo_name)
27
  tokenizer = AutoTokenizer.from_pretrained(repo_name)
28
  model = VisionEncoderDecoderModel.from_pretrained(repo_name)
29
 
30
- def get_quote(url):
31
- #reader = easyocr.Reader(['en'])
32
- #image = Image.open(image_1,mode = 'r')
33
- #image = Image.open(image_1)
34
-
35
- #image_2 = Image.open(requests.get(image_1, stream=True).raw)
36
 
37
- #image = Image.open(image_path)
 
38
 
39
  #url = "http://images.cocodataset.org/val2017/000000039769.jpg"
40
- with Image.open(requests.get(url, stream=True).raw) as image:
41
 
42
- image.save("cats.png")
43
- #preds = predict(image)
44
 
45
  ##############
46
  pixel_values = feature_extractor(image, return_tensors="pt").pixel_values
 
27
  tokenizer = AutoTokenizer.from_pretrained(repo_name)
28
  model = VisionEncoderDecoderModel.from_pretrained(repo_name)
29
 
30
+ def get_quote(image_1):
 
 
 
 
 
31
 
32
+ image = Image.open(image_1).raw
33
+ #image = Image.open(image_1)
34
 
35
  #url = "http://images.cocodataset.org/val2017/000000039769.jpg"
36
+ #with Image.open(requests.get(url, stream=True).raw) as image:
37
 
38
+ image.save("cats.png")
39
+
40
 
41
  ##############
42
  pixel_values = feature_extractor(image, return_tensors="pt").pixel_values