MCPcopy Index your code
hub / github.com/ai4ce/NYU-VPR

github.com/ai4ce/NYU-VPR @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
2,624 symbols 7,735 edges 362 files 743 documented · 28%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

NYU-VPR

This repository provides the experiment code for the paper Long-Term Visual Place Recognition Benchmark with View Direction and Data Anonymization Influences.

Here is a graphical user interface (GUI) for using VPR methods on custom datasets: https://github.com/ai4ce/VPR-GUI-Tool

Requirements

To install requirements:

pip install -r requirements.txt

Data Processing

1. Image Anonymization

To install mseg-api:

cd segmentation
cd mseg-api
pip install -e .

Make sure that you can run python -c "import mseg" in python.

To install mseg-semantic:

cd segmentation
cd apex
pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./

cd ../mseg-semantic
pip install -e .

Make sure that you can run python -c "import mseg_semantic" in python.

Finally:

input_file=/path/to/my/directory
model_name=mseg-3m
model_path=mseg_semantic/mseg-3m.pth
config=mseg_semantic/config/test/default_config_360_ms.yaml
python -u mseg_semantic/tool/universal_demo.py --config=${config} model_name {model_name} model_path ${model_path} input_file ${input_file}

2. Image Filtration

Inside the process folder, use whiteFilter.py to filter images with white pixel percentage.

Methods

1. VLAD+SURF

Modify vlad_codebook_generation.py line 157 - 170 to fit the dataset.

cd test/vlad
python vlad_codebook_generation.py
python query_image_closest_image_generation.py

*Notice: the processing may take a few hours.

2. VLAD+SuperPoint

cd test/vlad_SP
python main.py
python find_closest.py

*Notice: the processing may take a few hours.

3. NetVLAD

4. PoseNet

Copy the train_image_paths.txt and test_image_paths.txt to test/posenet.

Obtain the latitude and longtitude of training images and convert them to normalized Universal Transverse Mercator (UTM) coordinates.

cd test/posenet
python getGPS.py
python mean.py

Start training. This may take several hours. Suggestion: use slurm to run the process.

python train.py --image_path path_to_train_images/ --metadata_path trainNorm.txt

Generate the input file for testing from test_image_paths.txt.

python gen_test_txt.py

Start testing.

python single_test.py --image_path path_to_test_images/ --metadata_path test.txt --weights_path models_trainNorm/best_net.pth

The predicted normalized UTM coordinates of test images is in the image_name.txt. Match the test images with the training images based on their location.

python match.py

The matching result is in the match.txt.

5. DBoW

Copy the train_image_paths.txt and test_image_paths.txt to test/DBow3/utils. Copy and paste the content of test_image_paths.txt at the end of train_image_paths.txt and save the text file as total_images_paths.txt.

Open test/DBow3/utils/demo_general.cpp file. Change the for loop range at line 117 and line 123. Both ranges are the range of lines in total_images_paths.txt. The first for loop range is the range of test images and the second range is the range of training images. To run with multi-thread, you may run the code multiple times with small ranges of test images where the sum of ranges equals to the number of lines in test_image_paths.txt.

Compile and run the code.

cd test/DBow3
cmake .
cd utils
make
./demo_general a b

The result of each test image and its top-5 matched training images is in the output.txt.

Core symbols most depended-on inside this repo

backward
called by 99
segmentation/apex/apex/mlp/mlp.py
end
called by 89
test/DBow3/src/timers.h
filter
called by 48
process/whiteFilter.py
zero_array
called by 46
segmentation/apex/apex/contrib/csrc/groupbn/nhwc_batch_norm_kernel.h
typeToBytes
called by 45
segmentation/apex/apex/pyprof/prof/utility.py
close
called by 42
segmentation/apex/apex/pyprof/parse/db.py
load
called by 38
test/DBow3/src/Database.cpp
scale_loss
called by 34
segmentation/apex/apex/amp/opt.py

Shape

Method 1,467
Function 856
Class 294
Enum 6
Route 1

Languages

Python80%
C++19%
C1%

Modules by API surface

test/DBow3/tests/nanoflann.hpp108 symbols
segmentation/apex/tests/L0/run_pyprof_nvtx/test_pyprof_nvtx.py95 symbols
segmentation/apex/apex/pyprof/prof/index_slice_join_mutate.py56 symbols
segmentation/mseg-api/tests/test_mask_utils.py44 symbols
segmentation/apex/apex/contrib/csrc/groupbn/nhwc_batch_norm_kernel.h44 symbols
segmentation/apex/apex/pyprof/prof/misc.py42 symbols
segmentation/mseg-semantic/mseg_semantic/utils/transform.py39 symbols
segmentation/mseg-api/mseg/utils/mask_utils.py36 symbols
segmentation/apex/apex/contrib/csrc/multihead_attn/softmax.h34 symbols
segmentation/mseg-api/mseg/utils/mask_utils_detectron2.py33 symbols
segmentation/apex/apex/pyprof/prof/blas.py32 symbols
segmentation/apex/tests/L0/run_optimizers/test_fused_optimizer.py31 symbols

For agents

$ claude mcp add NYU-VPR \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact