i use siamese network, right now i inser 2 image then will processing an show the answer
if answer is 1 its mean the picture is same, but if answer is 0 its mean the picture is different.
from PIL import Image x1 = Image.open('A.PNG') x2 = Image.open('X.PNG') # Transform x1 = transforms(x1) x2 = transforms(x2) x1 = torch.stack([x1]) x2 = torch.stack([x2]) model.eval() # Get prediction output = model(x1,x2) output = (torch.sigmoid(output) >= 0.5).float() print (output)
Both pictures are different, so tensor give this output
I want to ask, I have 26 types of image that I use for this siamese neural network.
Can I insert 1 type of picture and then the image will be compared to the 26 data that I have, if it has a value of 1 (the same picture) can I display which image is the same?
Or can it display the closest range to the image that I entered after comparing into 26 of my data?