0
!apt install tesseract-ocr
!pip install pytesserac
import pytesseract
from PIL import Image

# Open image file
image = Image.open("/content/book.PNG")

# Recognize text
text = pytesseract.image_to_string(image)

print(text)

I wrote this code in google colab and getting an error "cannot identify image file '/content/book.PNG'"

I am expecting the code to run.

Robert
  • 7,394
  • 40
  • 45
  • 64
  • it prints, but, it's an *empty* string - if you copy/paste the result, you get a few line breaks with a character similar to this: `↑` Reading about tesseract, it seems is for get text from an image - not for identify the object – Marco Aurelio Fernandez Reyes Jan 18 '23 at 15:30

0 Answers0