Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use for testing or evaluation purpose? #9

Open
arunjung1991 opened this issue Mar 6, 2024 · 1 comment
Open

How to use for testing or evaluation purpose? #9

arunjung1991 opened this issue Mar 6, 2024 · 1 comment

Comments

@arunjung1991
Copy link

if not self.training:
a, b = feat.chunk(2)
return a + b
else:
return self.loss(feat, t, partial_index)
how can it be used for testing or validation dataset?

@supertx
Copy link

supertx commented Mar 12, 2024

have u handle with this problem.I write some code to test for facial recognization but seem not work.
def compare(f1, f2):
return torch.cosine_similarity(f1, f2)

def main():
net = torch.load("/home/xxx/uniface/Models-LResNet50EIR/LResNet50EIR_28th_epoch.pth")
net.to(torch.device("cpu"))
net.eval()
net.training = False
img1 = openImg("xxx.png")
img2 = openImg("xxx.png")
re1 = net(img1.reshape(1, 3, 112, 112))
re2 = net(img2.reshape(1, 3, 112, 112))
result = compare(re1, re2)
return result

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

No branches or pull requests

2 participants