Skip to content

Commit

Permalink
24/11
Browse files Browse the repository at this point in the history
  • Loading branch information
K4du84 committed Nov 25, 2022
1 parent c25ca9a commit 4ffaab6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
File renamed without changes
2 changes: 1 addition & 1 deletion hashpercent.py → hashpercent_FINAL.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
img_names = glob(os.path.join(os.getcwd(),'*.jpg'))
for fn in img_names:
print("Arquivo ", i + 1, " - ", img_names[i])
hashes[i] = imagehash.phash(Image.open(img_names[i]))
hashes[i] = imagehash.whash(Image.open(img_names[i]))
print("Wash Hash - ", hashes[i])
tamanho[i] = len(hashes[i])
print(tamanho[i])
Expand Down
6 changes: 3 additions & 3 deletions maissemelhante_FINAL.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
hashes = {}

# DEFINIÇÃO DAS INFORMAÇÕES DA IMAGEM MODELO, QUE QUEREMOS COMPARAR COM O BANCO DE DADOS.
modelo = "C:\\ImageBD\\unqlo\\WHITE-HORSE.jpg"
modelo = "C:\\ImageBD\\unqlo\\BLACK_HORSE.jpg"
hash_modelo = imagehash.whash(Image.open(modelo))
tamanho = len(hash_modelo)

Expand All @@ -31,7 +31,7 @@
mais_similar = 0
arquivo_similar = None

print("tamanho lista hash = ", len(hashes))
#print("tamanho lista hash = ", len(hashes))
for hs in hashes:
if hashes[j] > mais_similar:
mais_similar = hashes[j]
Expand All @@ -40,7 +40,7 @@
print("")
print("________________________")
print("")
print("A Imagem mais similar é a",arquivo_similar, ",com ", mais_similar, "% de similaridade.")
print("A Imagem mais similar é a", arquivo_similar, ",com ", mais_similar, "% de similaridade.")
print("")
print("________________________")
print("")
Expand Down
Empty file added testes
Empty file.
7 changes: 6 additions & 1 deletion validacaoExtensao.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import pathlib
from glob import glob
import os
import hashlib





i = 0
img_names = glob(os.path.join(os.getcwd(), '*.*'))
Expand All @@ -9,7 +14,7 @@
print("Arquivo ", i + 1, "- ", img_names[i])
print("File Extension: ", file_extension)

if file_extension == ".jpg" or ".jpeg":
if (file_extension == ".jpg") or (file_extension == ".jpeg"):
print("Arquivo válido!")
else:
print("Extensão inválida, por favor incluia arquivo com extensão .jpg")
Expand Down

0 comments on commit 4ffaab6

Please sign in to comment.