-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from chairc/dev
Modify the get_dataset; Add check.py; Add classes_initializer function
- Loading branch information
Showing
6 changed files
with
87 additions
and
39 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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env python | ||
# -*- coding:utf-8 -*- | ||
""" | ||
@Date : 2024/4/14 17:31 | ||
@Author : chairc | ||
@Site : https://github.com/chairc | ||
""" | ||
import os | ||
import logging | ||
import coloredlogs | ||
|
||
import torch | ||
|
||
logger = logging.getLogger(__name__) | ||
coloredlogs.install(level="INFO") | ||
|
||
|
||
def check_and_create_dir(path): | ||
""" | ||
Check and create not exist folder | ||
:param path: Create path | ||
:return: None | ||
""" | ||
logger.info(msg=f"Check and create folder '{path}'.") | ||
os.makedirs(name=path, exist_ok=True) | ||
|
||
|
||
def check_path_is_exist(path): | ||
""" | ||
Check the path is existed | ||
:param path: Path | ||
:return: None | ||
""" | ||
if not os.path.exists(path=path): | ||
raise FileNotFoundError(f"The path '{path}' does not exist.") |
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