Skip to content

Instantly share code, notes, and snippets.

@scottpanton
scottpanton / googleocr.py
Created December 27, 2020 03:44
Use Google Vision API to OCR subtitles from https://sourceforge.net/p/videosubfinder
import io,os,glob
from google.cloud import vision
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = 'creds.json'
path = '/some/place/'
srcdir = 'TXTImages'
frames = glob.glob(path + srcdir + '/*.jpeg')
client = vision.ImageAnnotatorClient()