akarshzingade / image-similarity-deep-ranking

369 stars 103 forks source link

How to construct triplets.txt file correctly? #36

Open angelo93109 opened 4 years ago

angelo93109 commented 4 years ago

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!

copernicu commented 4 years ago

did u solve it?I have the same question

hxtruong6 commented 1 year ago

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