Basic implementation of the pipeline described in the paper presented at Image Matching CVPR 2026 Workshop.
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-isolationBased 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.
![]() |
![]() |
![]() |
![]() |
|
| 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
- Classic image obfuscations - blurring with Gaussian kernel and pixelization.
- Implemented in
blur_or_pixelize_inference.py.
easy-anon
- Anonymization by masking certain parts of the image based on semantic segmentation.
- Not present in this repository - implemented in github.com/spatial-intelligence-group/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.pyto produce depth maps, then rundepth2edge.pyon the generated depth maps.
DiffusionEdge
- Edge extraction using a diffusion model.
- Implemented in
diffusion_edge_inference.py. - We used the model pretrained on NYUD: https://github.com/GuHuangAI/DiffusionEdge/releases/download/v1.1/nyud.pt
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.
There are two localization pipelines:
- E5+1 pipeline:
loc_pipeline_gen_rel_pose.py - local triangulation pipeline:
loc_pipeline_local_triang.py
Utility scripts for data preparation and evaluation are present in scripts/utils
We want to thank the authors and contributors of all the projects used in our work. Mainly, but not limited to:
@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},
}







