def predict_folder(self, img_paths, return_probs=False):
    texts = []
    if return_probs:
        probs = []
    for (i, img_path) in enumerate(img_paths):
        img = Image.open(img_path)
        if return_probs:
            (text, prob) = self(img, True)
            texts.append(text)
            probs.append(prob)
        else:
            text = self(img, False)
            texts.append(text)
    if return_probs:
        return (texts, probs)
    else:
        return texts
def predict_folder(self, img_paths, return_probs=False):
    texts = []
    if return_probs:
        probs = []
    for (i, img_path) in enumerate(img_paths):
        img = Image.open(img_path)
        if return_probs:
            (text, prob) = self(img, True)
            texts.append(text)
            probs.append(prob)
        else:
            text = self(img, False)
            texts.append(text)
    if return_probs:
        return (texts, probs)
    else:
        return texts