Download utils/util.py from InPeerReview/RemoteSensingChangeDetection-RSCD.CTTF: direct link, hf CLI and curl.
- Browser
- Download file 367 Bytes
-
https://huggingface.co/InPeerReview/RemoteSensingChangeDetection-RSCD.CTTF/resolve/main/utils/util.py
- Command line
-
hf download hf://InPeerReview/RemoteSensingChangeDetection-RSCD.CTTF/utils/util.py
-
curl -L -o util.py https://huggingface.co/InPeerReview/RemoteSensingChangeDetection-RSCD.CTTF/resolve/main/utils/util.py
367 Bytes
| import os | |
| import os.path as osp | |
| def check_file_exist(filename, msg_tmpl='file "{}" does not exist'): | |
| if not osp.isfile(filename): | |
| raise FileNotFoundError(msg_tmpl.format(filename)) | |
| def mkdir_or_exist(dir_name, mode=0o777): | |
| if dir_name == '': | |
| return | |
| dir_name = osp.expanduser(dir_name) | |
| os.makedirs(dir_name, mode=mode, exist_ok=True) |