Closed wpumain closed 1 year ago
I will as soon as I have time add some comments to the dataset class to make everything clearer. Anyway, the images_paths list, as you can see, contains in the first NUM_DB positions, the db paths. From the indexes NUM_DB to the end of the list, it contains query paths.
However, among all the q_paths, there are some queries that have no positive matches. For this reason, there exist the qIdx matrix, that contains the indexes of queries that have at least one positive in the db.
For these reason, in the getitem, if the index is > DB_NUM, it means that this is a query, and so in this code:
by subtracting DB_NUM I get the index in terms of number of queries, and I use it to look up into qIdx the actual query index inside images_paths. The old_index, at line 164 that you mentioned, is not really needed, and I return it for completeness/debug purposes
Think you for your help!
https://github.com/vandal-vpr/vg-transformers/blob/c57fca9085a8dfcfd74e21ddea8f6722940de5dd/tvg/datasets/dataset.py#L164
What is the role of variables 【old_index】?
Why not use 【index】 directly to get value from [images_paths] In the【def getitem(self, index):】function? I think it can be taken directly in this way https://github.com/vandal-vpr/vg-transformers/blob/c57fca9085a8dfcfd74e21ddea8f6722940de5dd/tvg/datasets/dataset.py#L59 https://github.com/vandal-vpr/vg-transformers/blob/c57fca9085a8dfcfd74e21ddea8f6722940de5dd/tvg/datasets/dataset.py#L174