Update app.py
Browse files
app.py
CHANGED
@@ -13,12 +13,8 @@ def perform_ocr(image):
|
|
13 |
if image.mode != "RGB":
|
14 |
image = image.convert("RGB")
|
15 |
|
16 |
-
# Save the image to a temporary path
|
17 |
-
image_file_path = 'temp_image.jpg'
|
18 |
-
image.save(image_file_path)
|
19 |
-
|
20 |
# Perform OCR using the model
|
21 |
-
res = model.chat(tokenizer,
|
22 |
|
23 |
return res
|
24 |
|
@@ -32,4 +28,4 @@ interface = gr.Interface(
|
|
32 |
)
|
33 |
|
34 |
# Launch the Gradio app
|
35 |
-
interface.launch()
|
|
|
13 |
if image.mode != "RGB":
|
14 |
image = image.convert("RGB")
|
15 |
|
|
|
|
|
|
|
|
|
16 |
# Perform OCR using the model
|
17 |
+
res = model.chat(tokenizer, image, ocr_type='ocr')
|
18 |
|
19 |
return res
|
20 |
|
|
|
28 |
)
|
29 |
|
30 |
# Launch the Gradio app
|
31 |
+
interface.launch()
|