-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vpr bench error #8
Comments
Hey @YznMur Thanks for taking an interest in our work. I think you're trying to use our codebase on your (custom) dataset. There are two ways for this, and I'll align my response on both. I (hopefully) answer your question more directly in the end, I start with what I recommend. Method 1: Global Descriptors (Preferred)Here, you use our method to extract global descriptors. This is preferred since it can be a drop-in replacement for many existing pipelines (that do image retrieval based on global descriptors). Once you have global descriptors, you can use any method to do retrievals for a particular query. It's common to use faiss for such things. Method 2: Full NN Search Pipiline using our codebaseThis is using the same nearest-neighbor search method that we use. There are two ways to do this Way 1: Use function (suggested)I'd suggest using the Way 2: Use full codebaseYou could use our full codebase (files like dino_v2_global_vpr.py). I guess this is what you're trying to do. The
Using this way for this method is not suggested since this leads to many Also, datasets originally from dvgl_benchmark don't need this file (like Pitts30k and St. Lucia); their ground truth is calculated on the fly using knn retrieval from file names. We add a modification that reads ground truth from a Numpy Array for VPR-Bench datasetsFor a dataset from VPR-Bench, like 17places, the file reads as follows # Assuming you're in the dataset directory
import numpy as np
gt = np.load("ground_truth_new.npy", allow_pickle=True)
# Need allow_pickle=True since it has objects
print(gt.shape) # (406, 2)
# Here's how a random row (say 15) in this should look like
print(gt[15]) # [15 list([10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20])]
print(gt[1]) # [1 list([0, 1, 2, 3, 4, 5, 6])] Note that each row (signifying a query) has two columns. First column is the row number itself (we don't use this 🙈). The second column is the list of indices of database images that correspond to this query. We use this for getting positives (negatives are anything outside). This is like example 2 above, with localization radius of 5 images (clipped to the limits of database images, that's why Note that 17places has the following directory structure ./17places
├── [ 14K] ground_truth_new.npy
├── [ 13K] my_ground_truth_new.npy
├── [ 12K] query [406 entries exceeds filelimit, not opening dir]
├── [ 514] ReadMe.txt
└── [ 12K] ref [406 entries exceeds filelimit, not opening dir] The image names in the Numpy array for other datasetsIf you want to use a custom dataset and define a numpy array for it (I suggest not doing this for quick testing), you can look at how datasets are structured in custom_datasets. For example, the Eiffel (Sub-Atlantic Ridge) dataset is in eiffel_dataloader.py. A similar loading method can be found in this file as well AnyLoc/custom_datasets/eiffel_dataloader.py Lines 118 to 120 in 063c75d
You'll have to create a Python file along similar lines if you want to use this method and way (method 2, way 2). |
Closing due to inactivity. Avneesh has addressed the concern. |
Hi, thanks for your great work.
I am trying to run
dino_v2_global_vpr.py
from scripts with my own dataset (database + queries ). but faced error withgenerate_positives_and_utms
function fromdatasets_ws.py
.it asks forground_truth_new.npy
.AnyLoc/dvgl_benchmark/datasets_ws.py
Line 113 in 063c75d
Would u plz, tell me how to get/generate this file from my dataset and what it should contain?
The text was updated successfully, but these errors were encountered: