vietnamese-ocr / src /setup.py
truong-xuan-linh's picture
inmit:
03484ca
raw
history blame
473 Bytes
import os
import yaml
class Setup():
def __init__(self) -> None:
self.config = yaml.load(open("./config/config.yml"), yaml.loader.SafeLoader)
self.ocr_model = self.config["ocr_model"]
def ocr_model_downloader(self) -> None:
os.system("python -m pip install gdown --upgrade")
import gdown
if "ocr_model.pth" not in os.listdir(("./storage")):
gdown.download(self.ocr_model, "./storage/ocr_model.pth", quiet=False)