keras-io
keras-io copied to clipboard
how to load custom dataset for siamese Network with a contrastive loss example?
Thanks for the example Image similarity estimation using a Siamese Network with a contrastive loss.
I am trying to adapt this example with a new dataset. I have a directory where I kept examples of positive and negative images.
So I have three directories of anchor, positive, and negative examples, i.e.:
anchor/
1.jpg
2.jpg
3.jpg
....
positive/
1.jpg
2.jpg
3.jpg
....
negative/
1.jpg
2.jpg
3.jpg
....
The given code snippet reads directly from keras.datasets.mnist.load_data(). How could I feed this dataset into this model?
For my case I have to get get embedding of the images before feeding into the model. Any idea is welcome.
@s-mrb do you have any feedback for me?
and
For my case I have to get get embedding of the images before feeding into the model. If you see here, the two tower networks are getting the embeddings and feeding it to main model, this always happens in Siamese Networks. Your requirements are either not so different or you haven't explained them well.
Hi @smith-co, thanks for reaching out. The issue backlog is not the best place for support requests. Can you repost this to one of the forums below? That way your question will have more visibility.
Thanks!