add v0.7.3, move model storage to github release

This commit is contained in:
Jia Guo
2023-04-02 16:04:03 +08:00
parent f091989568
commit 668e8d4742
3 changed files with 370 additions and 179 deletions

View File

@@ -11,7 +11,7 @@ except ImportError:
"Unable to import dependency onnxruntime. "
)
__version__ = '0.7.2'
__version__ = '0.7.3'
from . import model_zoo
from . import utils

View File

@@ -4,9 +4,7 @@ import os.path as osp
import zipfile
from .download import download_file
#BASE_REPO_URL='http://storage.insightface.ai/files'
#BASE_REPO_URL='http://insightface.cn-sh2.ufileos.com'
BASE_REPO_URL='http://d1gsb2o3ihr2l5.cloudfront.net'
BASE_REPO_URL = 'https://github.com/deepinsight/insightface/releases/download/v0.7'
def download(sub_dir, name, force=False, root='~/.insightface'):
_root = os.path.expanduser(root)
@@ -15,8 +13,7 @@ def download(sub_dir, name, force=False, root='~/.insightface'):
return dir_path
print('download_path:', dir_path)
zip_file_path = os.path.join(_root, sub_dir, name + '.zip')
model_url = "%s/%s/%s.zip"%(BASE_REPO_URL, sub_dir, name)
#model_url = "%s/%s.zip"%(BASE_REPO_URL, name)
model_url = "%s/%s.zip"%(BASE_REPO_URL, name)
download_file(model_url,
path=zip_file_path,
overwrite=True)
@@ -40,12 +37,12 @@ def download_onnx(sub_dir, model_file, force=False, root='~/.insightface', downl
os.makedirs(model_root)
print('download_path:', new_model_file)
if not download_zip:
model_url = "%s/%s/%s"%(BASE_REPO_URL, sub_dir, model_file)
model_url = "%s/%s"%(BASE_REPO_URL, model_file)
download_file(model_url,
path=new_model_file,
overwrite=True)
else:
model_url = "%s/%s/%s.zip"%(BASE_REPO_URL, sub_dir, model_file)
model_url = "%s/%s.zip"%(BASE_REPO_URL, model_file)
zip_file_path = new_model_file+".zip"
download_file(model_url,
path=zip_file_path,