高效码农

如何使用命令行或 Python 在 Mac 上免费使用 OCR

操作步骤如下:

shortcuts run ocr-text -i <A PATH TO SOME IMAGE>

从 python,您可以执行以下操作

import subprocess

file_path = '... some file path ...'
ocr_out = subprocess.check_output(
    f'shortcuts run ocr-text -i "{file_path}"', shell=True
)
print(ocr_out)

当前页面是本站的「Google AMP」版。查看和发表评论请点击:完整版 »