Closed fizamurtaza closed 3 years ago
That's very interesting. Which version of deepface you are using? What is the exact content of untitled0.py?
The following file exists in your environment? HOME_FOLDER/.deepface/weights/facenet_weights.h5
here is the code: """ from IPython import get_ipython def reset(): get_ipython().magic('reset -sf')
from deepface import DeepFace import cv2 import matplotlib.pyplot as plt plt.close('all')
datapath = 'D:/Fiza_Murtaza/codes/deepface-master/tests/dataset' img1_path = datapath + "\Img68.jpeg" img2_path = datapath + '\Img69.jpeg'
img1 = cv2.imread(img1_path) img2 = cv2.imread(img2_path)
model1 = DeepFace.build_model('VGG-Face') models = ["VGG-Face", "Facenet", "Facenet512", "OpenFace", "DeepFace", "DeepID", "ArcFace", "Dlib"] result = DeepFace.verify(img1_path, img2_path, model_name = models[1], model=model1) print(result)
yes weights exist in the environment. I believe that I am passing my own image but these are in .jpeg extension. Whenever I try to very .jpeg images it gives me different results (verification and distance) but when I use .jpg images results are same on each run.
How to train the model on new images?
Could you share your .jpeg images. I need to re-create the conditions you have.
what was your tensorflow version btw?
when I tested verify function with .jpeg extension images, distance seems always same.
obj = DeepFace.verify("1.jpeg", "2.jpeg", model_name = 'Facenet')
this returns the following response
{'verified': False, 'distance': 1.036256273901735, 'max_threshold_to_verify': 0.4, 'model': 'Facenet', 'similarity_metric': 'cosine'}
it seems that your environment causes that trouble. If you share your image pair, I can test it. I'm closing this issue because it is an environmental issue.
thank you @serengil. I think it is the environment issue because when I tried the above two jpeg images (which you provided) i am facing same issue of different results whenever I run the code. How I can resolve the environment issue?
what was your deepface and tensorflow versions?
Thank you @serengil deepface = 0.0.65 tensorflow = 2.5.0
you are using the latest deepface.
could you downgrade your tf to 2.2.0?
ok let me do that.
I have downgraded tf to 2.2.0 and the problem is still same.
what about python version? I'm using python 3.8.3.
I am using 3.8.10
I re-open this issue because I don't know what to do. However, some people might face with this trouble and help us.
Could you delete this file: HOME_FOLDER/.deepface/weights/facenet_weights.h5
Let deepface to install the facenet weights again. BTW, you are still using facenet in your experiments?
yes thank you @serengil
I feel this is issue is with only .jpeg images not on .jpg images.
yes I am using facenet
what if deepface enforce you working with just jpg images?
yes this is the only solution I think I will use .jpg images now
what if deepface enforce you working with just jpg images?
closing this because of inactivity
Hello, Why I am getting different results every time I run with same input images and same settings?