-
Notifications
You must be signed in to change notification settings - Fork 690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Add hash check to data download #284
Conversation
anomalib/data/mvtec.py
Outdated
@@ -384,6 +384,8 @@ def prepare_data(self) -> None: | |||
filename=self.root / dataset_name, | |||
reporthook=progress_bar.update_to, | |||
) | |||
logger.info("Checking hash") | |||
hash_check(self.root / dataset_name, "eefca59f2cede9c3fc5b6befbfec275e") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quite minor, but btech has zip_filename
, would be good if the two has consistent implementation, (ie., both has zip_filename
or path)
anomalib/data/utils/download.py
Outdated
with open(file_path, "rb") as hash_file: | ||
assert ( | ||
hashlib.md5(hash_file.read()).hexdigest() == expected_hash | ||
), f"Downloaded file {file_path} does match the required hash." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be "does not match"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙃
Description
Check hash for files downloaded from remote location.
Fixes Check hash of downloaded MVTec and BTech datasets #253
Changes
Checklist