This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This script removes stray lines from images using image processing techniques with OpenCV library. | |
All credit where it's due - https://stackoverflow.com/a/45563349/4411757. Simon Mourier created a script in C# which I | |
have ported to python. Tested with python 3.5 and opencv-python==3.4.2.17. Shoot your suggestions/improvements in the | |
comments. Cheers! | |
""" | |
def clean_image(img): | |
height, width = img.shape[:2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.6.3 | |
# install Python modules needed by the Python app | |
COPY . /Captcha-Prediction | |
WORKDIR /Captcha-Prediction | |
RUN pip install --no-cache-dir -r requirements.txt | |
# tell the port number the container should expose | |
EXPOSE 5000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import necessary packages | |
import os | |
import pickle | |
from llama_index import GPTSimpleVectorIndex, download_loader | |
os.environ['OPENAI_API_KEY'] = '<openai_api_key>' | |
# Load custom data source. Here it is being loaded from the data directory. | |
SimpleDirectoryReader = download_loader("SimpleDirectoryReader") |