Did I find the right examples for you? yes no

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)

src/s/i/simple-ocr-opencv-HEAD/tesseract_utils.py   simple-ocr-opencv(Download)
import numpy
 
from classification import classes_from_numpy, classes_to_numpy
from segmentation import segments_from_numpy, segments_to_numpy
 
def write_boxfile(path, classes, segments):
    classes, segments= classes_from_numpy(classes), segments_from_numpy(segments)
    with open(path, 'w') as f:
        for c,s in zip(classes, segments):
            f.write( c.encode('utf-8')+' '+ ' '.join(map(str, s))+" 0\n")