Open luisjose1996 opened 3 days ago
It's not clear what is a problem. Easyocr doesn't scan image, so you don't have image + bbox output? Or image is showed, but you're bothered with a message?
It's a default message if you don't use gpu. You can change gpu=False
-> gpu=True
to fix it, but you will need GPU for that.
import easyocr import cv2 import matplotlib.pyplot as plt
Create an EasyOCR reader instance
reader = easyocr.Reader(['en'], gpu=False) # Specify the languages you want to use
Function to extract text from an image
def extract_text_from_image(image_path):
Read the image using OpenCV
Example usage
if name == "main": image_path = "1.png" # Replace with your image path text, annotated_image = extract_text_from_image(image_path) print("Extracted Text:", text)
In this code, I got an issue like "Neither CUDA nor MPS are available - defaulting to CPU. Note: This module is much faster with a GPU. Illegal instruction". How should I solve this issue?