image-similarity-deep-ranking icon indicating copy to clipboard operation
image-similarity-deep-ranking copied to clipboard

How to construct triplets.txt file correctly?

Open angelo93109 opened this issue 4 years ago • 2 comments

Hello! Thank you for sharing such a useful method of comparing image similarity.

I encountered a problem when I tried to implement the code tripletSampler.py. I executed the program by input [python tripletSampler.py --input_directory ~/Desktop/image-similarity-deep-ranking-master/dataset --output_directory ~/Desktop/image-similarity-deep-ranking-master --num_pos_images 1 --num_neg_images 1].

And here is my dataset.

Folder [dataset] --------Folder[SimilarityClass1] ---------------Image[GT.png] --------Folder[SimilarityClass2] ---------------Image[neg.png]

After I run the code. The triplets.txt was created but it was totally empty.

It let me get an error when I executed deepRanking.py. It showed "Found 0 images belonging to 0 classes. ZeroDivisionError: integer division or modulo by zero"

Can you tell me which step did I mess up?

Thank you very much for your help!

angelo93109 avatar Mar 06 '20 21:03 angelo93109

did u solve it?I have the same question

copernicu avatar Jul 03 '20 13:07 copernicu

In the code, the author set hard code for the triplet folder. You could change in deepRanking.py file

hxtruong6 avatar Mar 06 '23 05:03 hxtruong6