-
Notifications
You must be signed in to change notification settings - Fork 65
add dup info #12
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 dup info #12
Conversation
dingo/model/rule/rule_image.py
Outdated
| duplicate_images_phash.update(values) | ||
| duplicates_cnn = cnn_encoder.find_duplicates(image_dir=image_dir, min_similarity_threshold=0.97) | ||
| common_duplicates = duplicate_images_phash.intersection(set(duplicates_cnn.keys())) | ||
| if len(os.listdir(image_dir)) == 0: |
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.
判断前置,要是空文件夹,前面就不用算重复了
dingo/model/rule/rule_image.py
Outdated
| res.name = cls.__name__ | ||
| res.reason = [f'{image} -> {duplicates_cnn[image]}' for image in common_duplicates] | ||
|
|
||
| res.reason.extend(duplicate_info) |
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.
逻辑错误,改成append
dingo/model/rule/rule_image.py
Outdated
| phasher = PHash() | ||
| cnn_encoder = CNN() | ||
|
|
||
| duplicate_info = dict() |
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.
变量已经很多了,没必要再额外搞一个出来,直接在reason里面加吧
No description provided.