# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     name: python3
# ---

# + [markdown] id="view-in-github" colab_type="text"
# <a href="https://colab.research.google.com/github/PrathakGarg/User-Authentication-using-Voice-Recognition/blob/master/Keda.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>

# + colab={"base_uri": "https://localhost:8080/"} id="_RvEi4O4lcWn" outputId="249ee0d6-6bf9-460f-c0d3-807e26a74d19"
# !pip install keras-ocr

# + id="Ta6xEp70lZcW"
import matplotlib.pyplot as plt
import keras_ocr

# + colab={"base_uri": "https://localhost:8080/"} id="Ha_gOMN8ll01" outputId="f89f57a7-6680-4bbe-cb45-7c71600e626d"
pipeline = keras_ocr.pipeline.Pipeline()

# + id="4xjGGaJ9lofD"
images = [
    keras_ocr.tools.read(url) for url in [
        # 'https://upload.wikimedia.org/wikipedia/commons/b/bd/Army_Reserves_Recruitment_Banner_MOD_45156284.jpg',
        # 'https://upload.wikimedia.org/wikipedia/commons/e/e8/FseeG2QeLXo.jpg',
        # 'https://upload.wikimedia.org/wikipedia/commons/b/b4/EUBanana-500x112.jpg'
        'https://i.imgur.com/b0ihHdQ.png'
    ]
]

# + id="5c180gI_lqga"
prediction_groups = pipeline.recognize(images)

# + colab={"base_uri": "https://localhost:8080/"} id="trsucC8Hlsyc" outputId="e907fb7d-1ee5-4426-c5a4-e833f41d79f0"
print(prediction_groups)

# + colab={"base_uri": "https://localhost:8080/", "height": 1000} id="AzJUxtVtlzhq" outputId="9641d7d2-0afb-49bb-b87f-6944057e309e"
fig, axs = plt.subplots(nrows=len(images), figsize=(20, 20), squeeze=False)

# + id="HAQG5-DKl2P5"
for ax, image, predictions in zip(axs[0], images, prediction_groups):
    keras_ocr.tools.drawAnnotations(image=image, predictions=predictions, ax=ax)

StarcoderdataJupyterScriptsDedupFiltered