Skip to content

spatial-intelligence-group/obfusloc

Repository files navigation

Privacy-Preserving Structureless Visual Localization via Image Obfuscation

arXiv

Basic implementation of the pipeline described in the paper presented at Image Matching CVPR 2026 Workshop.

Installation

git clone https://github.com/spatial-intelligence-group/obfusloc.git
git submodule update --init --depth 1

uv venv --python 3.12
source .venv/bin/activate
uv pip install <torch> <torchvision> [<xformers>] --index-url https://download.pytorch.org/whl/<cu>
CUDA_HOME=<cuda-path> PATH=<cuda-path>/bin:$PATH \
    uv pip install -r requirements.txt --override requirements_override.txt --no-build-isolation

Based on your CUDA version, you can pick the correct package version from the table:

CUDA <torch> <torchvision> <xformers> <cu> <cuda-path>
13.0 torch==2.9.0 torchvision==0.24.0 xformers==0.0.33 cu130 /usr/local/cuda-13.0
12.4 torch==2.6.0 torchvision==0.21.0 xformers==0.0.29.post3 cu124 /usr/local/cuda-12.4
11.8 torch==2.6.0 torchvision==0.21.0 xformers==0.0.29.post3 cu118 /usr/local/cuda-11.8

CUDA_HOME prefix: can be omitted if you have only single CUDA version installed in its default location.

Obfuscations from the paper

original blur pixelization easy-anon Mask2Former
Canny DiffusionEdge Metric3D --> Canny SAM borders SAM masks

All the obfuscation scripts are in scripts/obfuscation.

blur and pixelization

easy-anon

Canny

  • Extraction of edges using Canny edge detector. CLAHE is applied before edge extraction.
  • Implemented in canny_inference.py.
  • The results in the paper should be generated with the default parameters.

Metric3D --> Canny

  • Canny edges extracted from monocular depth maps generated by Metric3D.
  • First run metric3d_inference.py to produce depth maps, then run depth2edge.py on the generated depth maps.

DiffusionEdge

SAM1

  • Mask extraction using Segment Anything Model 1 (SAM1) automatic mask generator.
  • Use sam1_inference.py.
  • Also supports filtering the grid points by DB text detector (so the text is not visible in the SAM masks). Download and use the pretrained model listed in the documentation.

SAM2

  • Mask extraction using Segment Anything Model 2 (SAM2) automatic mask generator.
  • Use sam2_inference.py.
  • Same as SAM1, the script also supports filtering the grid points by DB text detector. Mask2Former
  • Mask extraction using Mask2Former semantic/panoptic segmentation.
  • Use mask2former_inference.py.

Localization

There are two localization pipelines:

Utility scripts for data preparation and evaluation are present in scripts/utils

Acknowledgements

We want to thank the authors and contributors of all the projects used in our work. Mainly, but not limited to:

Citation

@InProceedings{Panek_2026_ObfusLoc,
  title={Privacy-Preserving Structureless Visual Localization via Image Obfuscation},
  author={Panek, Vojtech and Beliansky, Patrik and Kukelova, Zuzana and Sattler, Torsten},
  booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops},
  month     = {June},
  year      = {2026},
  pages={117--128},
}

About

Privacy-Preserving Structureless Visual Localization via Image Obfuscation

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages