-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: jormal <jormal@naver.com>
- Loading branch information
Showing
4 changed files
with
165 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,7 +141,7 @@ lib64/ | |
parts/ | ||
sdist/ | ||
var/ | ||
tmp/ | ||
tmp_*/ | ||
wheels/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,35 @@ | ||
from typing import Type | ||
|
||
from libraries.models.asset import Asset | ||
from libraries.models.network import Network | ||
from libraries.models.protocol import Protocol | ||
from libraries.preprocess.enum_info import update_id_enum | ||
from libraries.preprocess.image import get_base_image_list, create_downscaled_image | ||
from libraries.utils.file import PWD | ||
from libraries.utils.file import get_model_dir_path | ||
|
||
|
||
def run_image_preprocess[T](model_type: Type[T]) -> None: | ||
"""Create downscaled images in all subdirectories of asset, network and protocol. | ||
|
||
def __run_image_preprocess() -> None: | ||
"""Create downscaled images in all subdirectories of asset, network and protocol.""" | ||
image_path_list = ( | ||
get_base_image_list(PWD.joinpath("assets")) | ||
+ get_base_image_list(PWD.joinpath("networks")) | ||
+ get_base_image_list(PWD.joinpath("protocols")) | ||
) | ||
Args: | ||
model_type: The type of the model. | ||
""" | ||
image_path_list = get_base_image_list(get_model_dir_path(model_type)) | ||
for image_path in image_path_list: | ||
create_downscaled_image(image_path.path) | ||
|
||
|
||
def __run_enum_preprocess() -> None: | ||
"""Update enum information from the information of asset, network and protocol.""" | ||
for model_type in [Asset, Network, Protocol]: | ||
update_id_enum(model_type) | ||
def run_enum_preprocess[T](model_type: Type[T]) -> None: | ||
"""Update enum information from the information of asset, network and protocol. | ||
|
||
Args: | ||
model_type: The type of the model. | ||
""" | ||
update_id_enum(model_type) | ||
|
||
|
||
def run_preprocess() -> None: | ||
"""Run a preprocessing list.""" | ||
__run_image_preprocess() | ||
__run_enum_preprocess() | ||
for model_type in [Asset, Network, Protocol]: | ||
run_image_preprocess(model_type) | ||
run_enum_preprocess(model_type) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters