Pill_Identification / setup_models.py
Rushikesh-Sontakke
Complete project
4adc200
Raw
History Blame Contribute Delete
617 Bytes
# setup_models.py
import os
import urllib.request
os.makedirs("models", exist_ok=True)
urls = {
"openocr_det_model.onnx": "https://github.com/Topdu/OpenOCR/releases/download/develop0.0.1/openocr_det_model.onnx",
"openocr_rec_model.onnx": "https://github.com/Topdu/OpenOCR/releases/download/develop0.0.1/openocr_rec_model.onnx"
}
for filename, url in urls.items():
dest = os.path.join("models", filename)
if not os.path.exists(dest):
print(f"Downloading {filename} ...")
urllib.request.urlretrieve(url, dest)
else:
print(f"{filename} already exists, skipping download.")