I’m writing Python code, needing to take a screenshot and recognize words. EasyOCR Neither CUDA nor MPS are available – defaulting to CPU. Note: This module is much faster with a GPU, but I’m unsure how to enable it.
code on EasyOCR:
reader = easyocr.Reader(['de'])
def recognize_text(take_screenshot):
result = reader.readtext(take_screenshot, detail=0)
recognized_text = ' '.join(result)
return recognized_text
def perform_action(coordinates):
x, y = coordinates
pyautogui.moveTo(x, y)
pyautogui.click()
os.remove("screenshot.png")```
I've checked the code but can't find the problem.
New contributor
Wrerity is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.