Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
@@ -74,6 +74,13 @@ def remove_low_size_images(data_path):
|
|
74 |
for one_image in low_size_photo_list[1:]:
|
75 |
os.remove(os.path.join(data_path, one_image))
|
76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
def remove_duplicate_images(data_path) :
|
78 |
image_files = os.listdir(data_path)
|
79 |
only_images = []
|
|
|
74 |
for one_image in low_size_photo_list[1:]:
|
75 |
os.remove(os.path.join(data_path, one_image))
|
76 |
|
77 |
+
def calc_diff(img1 , img2) :
|
78 |
+
i1 = Image.open(img1)
|
79 |
+
i2 = Image.open(img2)
|
80 |
+
h1 = imagehash.phash(i1)
|
81 |
+
h2 = imagehash.phash(i2)
|
82 |
+
return h1 - h2
|
83 |
+
|
84 |
def remove_duplicate_images(data_path) :
|
85 |
image_files = os.listdir(data_path)
|
86 |
only_images = []
|