Skip to content

Conversation

@dt-yy
Copy link
Contributor

@dt-yy dt-yy commented Jan 8, 2025

No description provided.

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:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

判断前置,要是空文件夹,前面就不用算重复了

res.name = cls.__name__
res.reason = [f'{image} -> {duplicates_cnn[image]}' for image in common_duplicates]

res.reason.extend(duplicate_info)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

逻辑错误,改成append

phasher = PHash()
cnn_encoder = CNN()

duplicate_info = dict()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

变量已经很多了,没必要再额外搞一个出来,直接在reason里面加吧

@shijinpjlab shijinpjlab merged commit e9c0b98 into MigoXLab:dev Jan 9, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants