Compare commits
No commits in common. "7361dc6f1f96d11642a9fe0505844d97298239b7" and "e5086bf0af0861ef43574b857b0a4702146e257e" have entirely different histories.
7361dc6f1f
...
e5086bf0af
@ -3,7 +3,6 @@ import imagehash
|
||||
import os
|
||||
import numpy as np
|
||||
import csv
|
||||
import requests
|
||||
|
||||
def writeCSV(i1, i2):
|
||||
with open("duplicates.csv", "a") as file:
|
||||
@ -16,7 +15,7 @@ class DuplicateRemover:
|
||||
self.dirname = dirname
|
||||
self.hash_size = hash_size
|
||||
|
||||
def find_duplicates(self, verbose=True, exportCSV=False, exportAPI=True):
|
||||
def find_duplicates(self, verbose=True, exportCSV=True):
|
||||
"""
|
||||
Find and Delete Duplicates
|
||||
"""
|
||||
@ -37,8 +36,6 @@ class DuplicateRemover:
|
||||
print("Duplicate {} \nfound for Image {}!\n".format(os.path.join(path,image),os.path.join(path,hashes[temp_hash])))
|
||||
if exportCSV:
|
||||
writeCSV(os.path.join(path,image), os.path.join(path,hashes[temp_hash]))
|
||||
if exportAPI:
|
||||
requests.post('http://your-server.domain/duplicate_api.php?insertDuplicate', json={"file1":os.path.join(path,image),"file2":os.path.join(path,hashes[temp_hash])})
|
||||
duplicates.append(os.path.join(path,image))
|
||||
else:
|
||||
hashes[temp_hash] = os.path.join(path,image)
|
||||
|
2
main.py
2
main.py
@ -1,6 +1,6 @@
|
||||
from DuplicateRemover import DuplicateRemover
|
||||
|
||||
dirname = "/image/path/"
|
||||
dirname = "images"
|
||||
|
||||
# Remove Duplicates
|
||||
dr = DuplicateRemover(dirname)
|
||||
|
@ -3,5 +3,4 @@ numpy==1.20.2
|
||||
Pillow==8.1.2
|
||||
PyWavelets==1.1.1
|
||||
scipy==1.6.2
|
||||
six==1.15.0
|
||||
requests
|
||||
six==1.15.0
|
Loading…
Reference in New Issue
Block a user