Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -128,7 +128,7 @@ def gradio_predict(*images):
|
|
| 128 |
|
| 129 |
# Extract signs/number plates (OCR)
|
| 130 |
prompt_ocr = "<image> Extract all visible text in the image, such as road signs, license plates, or billboards, with exact wording."
|
| 131 |
-
inputs_ocr = processor
|
| 132 |
ocr_outputs = model.generate(**inputs_ocr, max_length=512)
|
| 133 |
signs_text = processor.decode(ocr_outputs[0], skip_special_tokens=True).replace(prompt_ocr, "").strip()
|
| 134 |
|
|
|
|
| 128 |
|
| 129 |
# Extract signs/number plates (OCR)
|
| 130 |
prompt_ocr = "<image> Extract all visible text in the image, such as road signs, license plates, or billboards, with exact wording."
|
| 131 |
+
inputs_ocr = processor(text=[prompt_ocr], images=[image], return_tensors="pt", padding=True)
|
| 132 |
ocr_outputs = model.generate(**inputs_ocr, max_length=512)
|
| 133 |
signs_text = processor.decode(ocr_outputs[0], skip_special_tokens=True).replace(prompt_ocr, "").strip()
|
| 134 |
|