Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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(
|
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 |
-
|
|
|
38 |
|
39 |
#url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
40 |
-
with Image.open(requests.get(url, stream=True).raw) as image:
|
41 |
|
42 |
-
|
43 |
-
|
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
|