Spaces:
Running
Running
vat
Browse files
app.py
CHANGED
@@ -39,9 +39,9 @@ def read_root(image_file: bytes = File(...)):
|
|
39 |
image = Image.open(BytesIO(image_file))
|
40 |
|
41 |
question_1 = "What is the Total amount?"
|
42 |
-
question_2 = "What is
|
43 |
question_3 = "What is the Date?"
|
44 |
-
question_4 = "What is the
|
45 |
output_1 = pipe(image, question_1)
|
46 |
output_2 = pipe(image, question_2)
|
47 |
output_3 = pipe(image, question_3)
|
@@ -49,7 +49,7 @@ def read_root(image_file: bytes = File(...)):
|
|
49 |
|
50 |
response = {}
|
51 |
response['total amount'] = output_1[0]['answer']
|
52 |
-
response['
|
53 |
response['date'] = output_3[0]['answer']
|
54 |
-
response['
|
55 |
return response
|
|
|
39 |
image = Image.open(BytesIO(image_file))
|
40 |
|
41 |
question_1 = "What is the Total amount?"
|
42 |
+
question_2 = "What is the VAT amount?"
|
43 |
question_3 = "What is the Date?"
|
44 |
+
question_4 = "What is the tax amount"
|
45 |
output_1 = pipe(image, question_1)
|
46 |
output_2 = pipe(image, question_2)
|
47 |
output_3 = pipe(image, question_3)
|
|
|
49 |
|
50 |
response = {}
|
51 |
response['total amount'] = output_1[0]['answer']
|
52 |
+
response['total vat'] = output_2[0]['answer']
|
53 |
response['date'] = output_3[0]['answer']
|
54 |
+
response['vat'] = output_4[0]['answer']
|
55 |
return response
|