Closed smith-co closed 2 years ago
Kindly have a look at below implementation I have used custom dataset with concept of Anchor, Positive and Negative images, Basic concept here is we are trying minimize the distance between Positive and Anchor image at the same time maximizing the distance between Negative & Anchor Link : https://github.com/anukash/Face_recognition_siamese_network
Note: Similar case implementation you can see at Keras example named as Triplet loss. Link : https://keras.io/examples/vision/siamese_network
@anukash I would be interested to apply contrastive learning
approach and not triplet based
technique. That is why I was trying to use this example.
I would follow the pre_process(file_path)
example from https://github.com/anukash/Face_recognition_siamese_network.
But would the rest of the code i.e. model would work as is?
Yes I guess, Change will come at loss function part and L1_dist layer, Rest of code might not work you have to change the codes accordingly one thing you can try is to take the data preparation path from one repo and model making and calling path from other, I hope that work.
I am trying to adapt this example with a new dataset.
I have a directory where I have kept
anchor
,positive
, andnegative
examples i.e.How could I feed this dataset into this model? The given code snippet takes the
keras.datasets.mnist.load_data()
.