File size: 473 Bytes
03484ca
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
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)