Skip to content

Latest commit

 

History

History
 
 

demo

Demo and Quick Start for AnyLoc

Table of Contents

Contents

S. No File Name Description
1 anyloc_vlad_generate_colab.ipynb Jupyter notebook (for Google Colab) to generate global descriptors using AnyLoc-VALD-DINOv2.
2 anyloc_vlad_generate.py Python script to generate global descriptors using AnyLoc-VALD-DINOv2.
3 images_vlad_colab.ipynb WIP: Jupyter notebook (for Google Colab). Visualize cluster assignments.
4 hf_imgs_vlad_clusters.py WIP: HuggingFace app for visualizing the cluster assignments.

Before you start

You'll need the following before getting started. The Colab notebooks actually setup all this (as a part of the notebook), they're fully standalone.

  1. Cluster Centers: Download the cluster centers from the public data: Colab1 > cache.zip. Unzip the file in pwd with unzip cache.zip so that ./cache is created here. Vocabulary is stored in c_center.pt files in folders like ./cache/vocabulary/dinov2_vitg14/l31_value_c32/urban.

Included Demos

Demo 1: Global Descriptors

Open In Colab Local Python script

If you want to use the python script (after cloning the repo and setting up utilities).

python ./anyloc_vlad_generate.py
# Or if you have your own *.png images
python ./anyloc_vlad_generate.py --in-dir ./data/images --imgs-ext png --out-dir ./data/descriptors

Use --domain to specify the domain of the images (default is urban). Use --help to see all the options.

Tip: You can get an idea of which domain to use by using our HuggingFace Space app. Upload a representative sample of your images under GeM t-SNE Projection and see which group of images do your uploaded images come close to.

Demo 2: VLAD Cluster assignment visualization

Open In Colab: Cluster visualizations