Skip to content

Commit

Permalink
update Raw url
Browse files Browse the repository at this point in the history
  • Loading branch information
tunmx committed Feb 28, 2023
1 parent ea1d0b1 commit cf44359
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 17 deletions.
7 changes: 6 additions & 1 deletion .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions Prj-Python/hyperlpr3/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from .hyperlpr3 import LicensePlateCatcher
from .common.typedef import *
from .config.configuration import initialization

__version__ = "0.1.2"
__version__ = "0.1.3"

initialization()
29 changes: 17 additions & 12 deletions Prj-Python/hyperlpr3/config/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,22 @@ def down_model_zip(url, save_path, is_unzip=False):
os.remove(name)


# def initialization(re_download=False):
# models_dir = os.path.join(_DEFAULT_FOLDER_, _MODEL_VERSION_, "onnx")
# os.makedirs(models_dir, exist_ok=True)
# for model_key in onnx_model_maps:
# save_path = onnx_runtime_config[model_key]
# basename = os.path.basename(save_path)
# remote_url = os.path.join(_REMOTE_URL_, basename + "?raw=true")
# down_path = os.path.join(models_dir, basename)
# if not os.path.exists(down_path) or re_download:
# down_model_file(remote_url, down_path)

def initialization(re_download=False):
models_dir = os.path.join(_DEFAULT_FOLDER_, _MODEL_VERSION_, "onnx")
os.makedirs(models_dir, exist_ok=True)
for model_key in onnx_model_maps:
save_path = onnx_runtime_config[model_key]
basename = os.path.basename(save_path)
remote_url = os.path.join(_REMOTE_URL_, basename + "?raw=true")
down_path = os.path.join(models_dir, basename)
if not os.path.exists(down_path) or re_download:
down_model_file(remote_url, down_path)
os.makedirs(_DEFAULT_FOLDER_, exist_ok=True)
models_dir = os.path.join(_DEFAULT_FOLDER_, _MODEL_VERSION_)
# print(models_dir)
# if not os.path.exists(models_dir) or re_download:
# target_url = os.path.join(_ONLINE_URL_, _MODEL_VERSION_) + '.zip'
# down_model_zip(target_url, _DEFAULT_FOLDER_, True)
if not os.path.exists(models_dir) or re_download:
target_url = os.path.join(_ONLINE_URL_, _MODEL_VERSION_) + '.zip'
down_model_zip(target_url, _DEFAULT_FOLDER_, True)

2 changes: 1 addition & 1 deletion Prj-Python/hyperlpr3/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
else:
_DEFAULT_FOLDER_ = os.path.join(os.environ['HOME'], ".hyperlpr3")

_ONLINE_URL_ = "https://tunm.oss-cn-hangzhou.aliyuncs.com/hyperlpr3/"
_ONLINE_URL_ = "http://hyperlpr.tunm.top/raw/"

onnx_runtime_config = dict(
det_model_path_320x=os.path.join(_MODEL_VERSION_, "onnx", "y5fu_320x_sim.onnx"),
Expand Down
3 changes: 3 additions & 0 deletions Prj-Python/hyperlpr3/hyperlpr3.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
from .common.typedef import *
from os.path import join
from .config.settings import _DEFAULT_FOLDER_
from .config.configuration import initialization


initialization()

class LicensePlateCatcher(object):

def __init__(self,
Expand Down
Binary file removed resource/models/onnx/litemodel_cls_96x_r1.onnx
Binary file not shown.
Binary file removed resource/models/onnx/rpv3_mdict_160_r3.onnx
Binary file not shown.
Binary file removed resource/models/onnx/y5fu_320x_sim.onnx
Binary file not shown.
Binary file removed resource/models/onnx/y5fu_640x_sim.onnx
Binary file not shown.

0 comments on commit cf44359

Please sign in to comment.