{"id":20516382,"url":"https://github.com/nianticlabs/relpose-gnn","last_synced_at":"2025-10-06T16:59:25.846Z","repository":{"id":41305660,"uuid":"423766946","full_name":"nianticlabs/relpose-gnn","owner":"nianticlabs","description":"[3DV21] Visual Camera Re-Localization Using Graph Neural Networks and Relative Pose Supervision, M. Türkoǧlu et al.","archived":false,"fork":false,"pushed_at":"2023-04-21T12:48:03.000Z","size":75420,"stargazers_count":42,"open_issues_count":2,"forks_count":9,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-14T00:40:25.002Z","etag":null,"topics":["3dv2021","computer-vision","deep-learning","eth-zurich","gnn","gnns","graph-neural-networks","machine-learning","machine-vision","niantic","pose-estimation","relative-position","relocalisation","relocalization","ucl"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nianticlabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-02T08:43:53.000Z","updated_at":"2025-01-26T03:06:49.000Z","dependencies_parsed_at":"2024-11-15T21:28:42.785Z","dependency_job_id":"e4fc8b58-9d47-4960-b558-3795b7710cd1","html_url":"https://github.com/nianticlabs/relpose-gnn","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nianticlabs/relpose-gnn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nianticlabs%2Frelpose-gnn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nianticlabs%2Frelpose-gnn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nianticlabs%2Frelpose-gnn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nianticlabs%2Frelpose-gnn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nianticlabs","download_url":"https://codeload.github.com/nianticlabs/relpose-gnn/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nianticlabs%2Frelpose-gnn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278646773,"owners_count":26021511,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3dv2021","computer-vision","deep-learning","eth-zurich","gnn","gnns","graph-neural-networks","machine-learning","machine-vision","niantic","pose-estimation","relative-position","relocalisation","relocalization","ucl"],"created_at":"2024-11-15T21:28:34.606Z","updated_at":"2025-10-06T16:59:25.822Z","avatar_url":"https://github.com/nianticlabs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Visual Camera Re-Localization using Graph Neural Networks and Relative Pose Supervision\n\n\n[Mehmet Özgür Türkoǧlu](https://scholar.google.com/citations?user=rJpIyQUAAAAJ),\n[Eric Brachmann](https://scholar.google.de/citations?user=cAIshsYAAAAJ),\n[Konrad Schindler](https://igp.ethz.ch/personen/person-detail.html?persid=143986),\n[Gabriel J. Brostow](http://www0.cs.ucl.ac.uk/staff/G.Brostow/),\n[Áron Monszpart](http://aron.monszp.art) - **3DV 2021**.\n\n[ \\[Paper on ArXiv\\] ](https://arxiv.org/abs/2104.02538)\n[ \\[Paper on IEEE Explore\\] ](https://ieeexplore.ieee.org/abstract/document/9665967)\n[ \\[Presentation (long)\\] ](https://github.com/nianticlabs/relpose-gnn/raw/assets/assets/RelPoseGNN_3DV21_long.pdf)\n[ \\[Presentation (short)\\] ](https://github.com/nianticlabs/relpose-gnn/raw/assets/assets/RelPoseGNN_3DV21_short.pdf)\n[ \\[Poster\\] ](https://github.com/nianticlabs/relpose-gnn/raw/assets/assets/RelPoseGNN_3DV21_poster.pdf)\n\n\n## 🌌 Overview\n\n\u003cimg src=\"assets/method.png\" alt=\"Method overview\"\u003e\n\u003cb\u003eRelative pose regression.\u003c/b\u003e\nWe combine the efficiency of image retrieval methods and the ability of graph neural networks to selectively and \niteratively refine estimates to solve the challenging relative pose regression problem. Given a query image, we first \nfind similar images to it using a differentiable image retrieval method NetVLAD. We preserve the diversity of neighbors\nby strided subsampling before building a fully connected Graph Neural Network (GNN). Node representations x\u003csub\u003ei\u003c/sub\u003e are \ninitialized from ResNet34, and are combined using MLP-s into edge features e\u003csub\u003eij\u003c/sub\u003e. Finally, the relative pose\nregression layer maps the refined edge representations into relative poses between image pairs. Edge dropout is only \napplied at training time.\n\n\n## 📈 Results\n\n\u003ctable\u003e\n    \u003cthead\u003e\n      \u003ctr\u003e\n          \u003ctd\u003e\u003c/td\u003e\n          \u003ctd align=\"center\"\u003eTrained on 7 training sets\u003c/td\u003e\n      \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n    \u003ctr\u003e\n        \u003ctd\u003eChess\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\n            \u003ca href=\"https://storage.googleapis.com/niantic-lon-static/research/relpose-gnn/videos/chess_7scenes.mp4\"\u003e\n                \u003c!--\u003cimg src=\"assets/chess_7scenes_05s.046frames_56colors_1000ms.gif\" height=\"224\"/\u003e--\u003e\n                \u003cimg src=\"https://github.com/nianticlabs/relpose-gnn/raw/assets/assets/chess_7scenes_05s.046frames_56colors_1000ms.gif\" height=\"224\" /\u003e\n            \u003c/a\u003e\u003cbr /\u003e\n            pred. poses:\u003ca href=\"https://storage.googleapis.com/niantic-lon-static/research/relpose-gnn/predictions/relpose_gnn__multi_39_chess_0.09_2.9.npz\"\u003e\n              relpose_gnn__multi_39_chess_0.09_2.9.npz\n            \u003c/a\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003eFire\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\n            \u003ca href=\"https://storage.googleapis.com/niantic-lon-static/research/relpose-gnn/videos/fire_7scenes.mp4\"\u003e\n                \u003c!--\u003cimg src=\"assets/fire_7scenes_05s.050frames_56colors_1000ms.gif\" height=\"224\"/\u003e--\u003e\n                \u003cimg src=\"https://github.com/nianticlabs/relpose-gnn/raw/assets/assets/fire_7scenes_05s.050frames_56colors_1000ms.gif\" height=\"224\"/\u003e\n            \u003c/a\u003e\u003cbr /\u003e\n            pred. poses:\u003ca href=\"https://storage.googleapis.com/niantic-lon-static/research/relpose-gnn/predictions/relpose_gnn__multi_39_fire_0.23_7.4.npz\"\u003e\n              relpose_gnn__multi_39_fire_0.23_7.4.npz\n            \u003c/a\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003eHeads\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\n            \u003ca href=\"https://storage.googleapis.com/niantic-lon-static/research/relpose-gnn/videos/heads_7scenes.mp4\"\u003e\n                \u003c!--\u003cimg src=\"assets/heads_7scenes_05s.050frames_56colors_1000ms.gif\" height=\"224\"/\u003e--\u003e\n                \u003cimg src=\"https://github.com/nianticlabs/relpose-gnn/raw/assets/assets/heads_7scenes_05s.050frames_56colors_1000ms.gif\" height=\"224\"/\u003e                \n            \u003c/a\u003e\u003cbr /\u003e\n            pred. poses:\u003ca href=\"https://storage.googleapis.com/niantic-lon-static/research/relpose-gnn/predictions/relpose_gnn__multi_39_heads_0.13_8.5.npz\"\u003e\n              relpose_gnn__multi_39_heads_0.13_8.5.npz\n            \u003c/a\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003eOffice\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\n            \u003ca href=\"https://storage.googleapis.com/niantic-lon-static/research/relpose-gnn/videos/office_7scenes.mp4\"\u003e\n                \u003c!--\u003cimg src=\"assets/office_7scenes_05s.048frames_56colors_1000ms.gif\" height=\"224\"/\u003e--\u003e\n                \u003cimg src=\"https://github.com/nianticlabs/relpose-gnn/raw/assets/assets/office_7scenes_05s.048frames_56colors_1000ms.gif\" height=\"224\"/\u003e                \n            \u003c/a\u003e\u003cbr /\u003e\n            pred. poses:\u003ca href=\"https://storage.googleapis.com/niantic-lon-static/research/relpose-gnn/predictions/relpose_gnn__multi_39_office_0.15_4.1.npz\"\u003e\n              relpose_gnn__multi_39_office_0.15_4.1.npz\n            \u003c/a\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003ePumpkin\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\n            \u003ca href=\"https://storage.googleapis.com/niantic-lon-static/research/relpose-gnn/videos/pumpkin_7scenes.mp4\"\u003e\n                \u003c!--\u003cimg src=\"assets/pumpkin_7scenes_05s.050frames_56colors_1000ms.gif\" height=\"224\"/\u003e--\u003e\n                \u003cimg src=\"https://github.com/nianticlabs/relpose-gnn/raw/assets/assets/pumpkin_7scenes_05s.050frames_56colors_1000ms.gif\" height=\"224\"/\u003e\n            \u003c/a\u003e\u003cbr /\u003e\n            pred. poses:\u003ca href=\"https://storage.googleapis.com/niantic-lon-static/research/relpose-gnn/predictions/relpose_gnn__multi_39_pumpkin_0.17_3.3.npz\"\u003e\n              relpose_gnn__multi_39_pumpkin_0.17_3.3.npz\n            \u003c/a\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003eKitchen\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\n            \u003ca href=\"https://storage.googleapis.com/niantic-lon-static/research/relpose-gnn/videos/redkitchen_7scenes.mp4\"\u003e\n                \u003c!--\u003cimg src=\"assets/redkitchen_7scenes_05s.060frames_56colors_1000ms.gif\" height=\"224\"/\u003e--\u003e\n                \u003cimg src=\"https://github.com/nianticlabs/relpose-gnn/raw/assets/assets/redkitchen_7scenes_05s.060frames_56colors_1000ms.gif\" height=\"224\"/\u003e\n            \u003c/a\u003e\u003cbr /\u003e\n            pred. poses:\u003ca href=\"https://storage.googleapis.com/niantic-lon-static/research/relpose-gnn/predictions/relpose_gnn__multi_39_redkitchen_0.20_3.6.npz\"\u003e\n              relpose_gnn__multi_39_redkitchen_0.20_3.6.npz\n            \u003c/a\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003eStairs\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\n            \u003ca href=\"https://storage.googleapis.com/niantic-lon-static/research/relpose-gnn/videos/stairs_7scenes.mp4\"\u003e\n                \u003c!--\u003cimg src=\"assets/stairs_7scenes_05s.050frames_56colors_1000ms.gif\" height=\"224\"/\u003e--\u003e\n                \u003cimg src=\"https://github.com/nianticlabs/relpose-gnn/raw/assets/assets/stairs_7scenes_05s.050frames_56colors_1000ms.gif\" height=\"224\"/\u003e\n            \u003c/a\u003e\u003cbr /\u003e\n            pred. poses:\u003ca href=\"https://storage.googleapis.com/niantic-lon-static/research/relpose-gnn/predictions/relpose_gnn__multi_39_stairs_0.23_6.4.npz\"\u003e\n              relpose_gnn__multi_39_stairs_0.23_6.4.npz\n            \u003c/a\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\n\n## ✏️ 📄 Citation\n\nIf you find our work useful or interesting, please cite our paper:\n\n```latex\n@inproceedings{turkoglu2021visual,\n  title={{Visual Camera Re-Localization Using Graph Neural Networks and Relative Pose Supervision}},\n  author={T{\\\"{u}}rko\\u{g}lu, Mehmet {\\\"{O}}zg{\\\"{u}}r and \n          Brachmann, Eric and \n          Schindler, Konrad and \n          Brostow, Gabriel and \n          Monszpart, \\'{A}ron},\n  booktitle={International Conference on 3D Vision ({3DV})},\n  year={2021},\n  organization={IEEE}\n}\n```\n\n## Reproducing results: 7-Scenes\n\n### Source code\n\n```shell\nexport RELPOSEGNN=\"${HOME}/relpose_gnn\" \ngit clone --recurse-submodules --depth 1 https://github.com/nianticlabs/relpose-gnn.git ${RELPOSEGNN}\n```\n\n### Setup\n\nWe use a Conda environment that makes it easy to install all dependencies. Our code has been tested on Ubuntu 20.04 with PyTorch 1.8.2 and CUDA 11.1.\n\n1. Install [miniconda](https://docs.conda.io/en/latest/miniconda.html) with Python 3.8.\n2. Create the conda environment:\n   ```shell\n   conda env create -f environment-cu111.yml\n   ```\n3. Activate and verify the environment: \n   ```shell\n   conda activate relpose_gnn\n   python -c 'import torch; \\\n              print(f\"torch.version: {torch.__version__}\"); \\\n              print(f\"torch.cuda.is_available(): {torch.cuda.is_available()}\"); \\\n              import torch_scatter; \\\n              print(f\"torch_scatter: {torch_scatter.__version__}\")'\n   ```\n\n\n### Set more paths\n\n```shell\nexport SEVENSCENES=\"/mnt/disks/data-7scenes/7scenes\"\nexport DATADIR=\"/mnt/disks/data\"\nexport SEVENSCENESRW=\"${DATADIR}/7scenes-rw\"\nexport PYTHONPATH=\"${RELPOSEGNN}:${RELPOSEGNN}/python:${PYTHONPATH}\"\n```\n\n### I. Prepare the 7-Scenes dataset\n\n1. Download\n\n    ```shell\n    mkdir -p \"${SEVENSCENES}\" || (mkdir -p \"${SEVENSCENES}\" \u0026\u0026 chmod go+w -R \"${SEVENSCENES}\")\n    for SCENE in \"chess\" \"fire\" \"heads\" \"office\" \"pumpkin\" \"redkitchen\" \"stairs\"; do\n      test -f \"${SEVENSCENES}/${SCENE}.zip\" || \\\n        (wget -c \"http://download.microsoft.com/download/2/8/5/28564B23-0828-408F-8631-23B1EFF1DAC8/${SCENE}.zip\" -O \"$SEVENSCENES/$SCENE.zip\" \u0026)\n    done\n    ```\n\n2. Extract\n\n    ```shell\n    find \"${SEVENSCENES}\" -maxdepth 1 -name \"*.zip\" | xargs -P 7 -I fileName sh -c 'unzip -o -d \"$(dirname \"fileName\")\" \"fileName\"'\n    find \"${SEVENSCENES}\" -mindepth 2 -name \"*.zip\" | xargs -P 7 -I fileName sh -c 'unzip -o -d \"$(dirname \"fileName\")\" \"fileName\"'\n    ```\n\n### II. Image retrieval\n\nFor graph construction we incorporate the NetVLAD image retrieval CNN model.\nIt is based on this repository: https://github.com/sfu-gruvi-3dv/sanet_relocal_demo.\nYou'll need preprocessed `.bin` files (`train_frames.bin`, `test_frames.bin`) for each scene.\n\n#### Pre-processed\n\n   Coming soon...\n\n#### Generate yourself\n\n   ```shell\n   for SCENE in \"chess\" \"fire\" \"heads\" \"office\" \"pumpkin\" \"redkitchen\" \"stairs\"; do\n     python python/external/sanet_relocal_demo/seq_data/seven_scenes/scenes2seq.py \\\n       \"${SEVENSCENES}/${SCENE}\" \\\n       --dst-dir \"${SEVENSCENESRW}/${SCENE}\"\n   done\n   ```\n\n### III. Graph generation\n\nBefore starting to train the model, train and test graphs should be generated to speed up\nthe dataloaders, and not have to run NN search during training.\n\n#### III.A. Pre-processed\n\n1. Download\n \n    - Test\n       ```shell\n       mkdir -p \"${SEVENSCENESRW}\" || (mkdir -p \"${SEVENSCENESRW}\" \u0026\u0026 chmod go+w -R \"${SEVENSCENESRW}\")\n       for SCENE in \"chess\" \"fire\" \"heads\" \"office\" \"pumpkin\" \"redkitchen\" \"stairs\"; do\n         wget -c \"https://storage.googleapis.com/niantic-lon-static/research/relpose-gnn/data/${SCENE}_fc8_sp5_test.tar\" \\\n              -O \"${SEVENSCENESRW}/${SCENE}_fc8_sp5_test.tar\"\n       done\n       ```\n      \n   - Train\n      ```shell\n      for SCENE in \"chess\" \"fire\" \"heads\" \"office\" \"pumpkin\" \"redkitchen\" \"stairs\"; do\n        wget -c \"https://storage.googleapis.com/niantic-lon-static/research/relpose-gnn/data/${SCENE}_fc8_sp5_train.tar\" \\\n             -O \"${SEVENSCENESRW}/${SCENE}_fc8_sp5_train.tar\"\n      done\n      ```\n\n2. Extract\n\n    ```shell\n    (cd \"${SEVENSCENESRW}\"; \\\n     find \"${SEVENSCENESRW}\" -mindepth 1 -maxdepth 1 -name \"*.tar\" | xargs -P 7 -I fileName sh -c 'tar -I pigz -xvf \"fileName\"')\n    ````\n\n#### III.B. Generate yourself \n\n- For testing a model\n\n   ```shell\n   for SCENE in \"chess\" \"fire\" \"heads\" \"office\" \"pumpkin\" \"redkitchen\" \"stairs\"; do\n      python python/niantic/datasets/dataset_7Scenes_multi.py \\\n        \"${SCENE}\" \\\n        \"test\" \\\n        --data-path \"${SEVENSCENES}\" \\\n        --graph-data-path \"${SEVENSCENESRW}\" \\\n        --seq-len 8 \\\n        --sampling-period 5 \\\n        --gpu 0\n   done\n   ```\n\n- For training a multi-scene model (Table 1. in paper)\n\n   ```shell\n   python python/niantic/datasets/dataset_7Scenes_multi.py \\\n     multi \\\n     \"train\" \\\n     --data-path \"${SEVENSCENES}\" \\\n     --graph-data-path \"${SEVENSCENESRW}\" \\\n     --seq-len 8 \\\n     --sampling-period 5 \\\n     --gpu 0\n   ```\n\n- For training a single-scene model (Table 1. in supplementary)\n\n   ```shell\n   for SCENE in \"chess\" \"fire\" \"heads\" \"office\" \"pumpkin\" \"redkitchen\" \"stairs\"; do\n      python python/niantic/datasets/dataset_7Scenes_multi.py \\\n        \"${SCENE}\" \\\n        train \\\n        --data-path \"${SEVENSCENES}\" \\\n        --graph-data-path \"${SEVENSCENESRW}\" \\\n        --seq-len 8 \\\n        --sampling-period 5 \\\n        --gpu 0\n   done\n   ```\n   \n### Evaluation\n\n#### Pre-trained\n\n1. Download pre-trained model trained with entire 7-Scenes training scenes (Table 1 in the paper)\n   ```shell\n   wget \\\n    -c \"https://storage.googleapis.com/niantic-lon-static/research/relpose-gnn/models/relpose_gnn__multi_39.pth.tar\" \\\n    -O \"${DATADIR}/relpose_gnn__multi_39.pth.tar\"\n   ```\n2. Evaluate on each 7scenes test scene \n   ```shell\n   for SCENE in \"chess\" \"fire\" \"heads\" \"office\" \"pumpkin\" \"redkitchen\" \"stairs\"; do\n      python -u ${RELPOSEGNN}/python/niantic/testing/test.py \\\n        --dataset-dir \"${SEVENSCENES}\" \\\n        --test-data-dir \"${SEVENSCENESRW}\" \\\n        --weights \"${DATADIR}/relpose_gnn__multi_39.pth.tar\" \\\n        --save-dir \"${DATADIR}\" \\\n        --gpu 0 \\\n        --test-scene \"${SCENE}\"\n   done\n   ```\n\n3. Download pre-trained models trained with 7-Scenes' 6 training scenes (Table 2 in the paper)\n   \n   ```shell\n   wget \\\n    -c \"https://storage.googleapis.com/niantic-lon-static/research/relpose-gnn/models/6Scenes_${SCENE}_epoch_039.pth.tar\" \\\n    -O \"${DATADIR}/6Scenes_${SCENE}_epoch_039.pth.tar\"\n   ```\n\n4. Evaluate each model on a corresponding remaining scene\n   ```shell\n   for SCENE in \"chess\" \"fire\" \"heads\" \"office\" \"pumpkin\" \"redkitchen\" \"stairs\"; do\n      python -u ${RELPOSEGNN}/python/niantic/testing/test.py \\\n        --dataset-dir \"${SEVENSCENES}\" \\\n        --test-data-dir \"${SEVENSCENESRW}\" \\\n        --weights \"${DATADIR}/6Scenes_${SCENE}_epoch_039.pth.tar\" \\\n        --save-dir \"${DATADIR}\" \\\n        --gpu 0 \\\n        --test-scene \"${SCENE}\"\n   done\n   ```\n5. Download pre-trained models trained with 7-Scenes' single training scene (Table 1. in the supp.)\n   \n   ```shell\n   wget \\\n    -c \"https://storage.googleapis.com/niantic-lon-static/research/relpose-gnn/models/1Scenes_${SCENE}_epoch_039.pth.tar\" \\\n    -O \"${DATADIR}/1Scenes_${SCENE}_epoch_039.pth.tar\"\n   ```\n\n6. Evaluate each model on the same scene\n   ```shell\n   for SCENE in \"chess\" \"fire\" \"heads\" \"office\" \"pumpkin\" \"redkitchen\" \"stairs\"; do\n      python -u ${RELPOSEGNN}/python/niantic/testing/test.py \\\n        --dataset-dir \"${SEVENSCENES}\" \\\n        --test-data-dir \"${SEVENSCENESRW}\" \\\n        --weights \"${DATADIR}/1Scenes_${SCENE}_epoch_039.pth.tar\" \\\n        --save-dir \"${DATADIR}\" \\\n        --gpu 0 \\\n        --test-scene \"${SCENE}\"\n   done\n   ```\n\n### Train yourself\n1. 7 scenes training (Table 1. in the paper)\n    ```shell\n    python -u ${RELPOSEGNN}/python/niantic/training/train.py \\\n      --dataset-dir \"${SEVENSCENES}\" \\\n      --train-data-dir \"${SEVENSCENESRW}\" \\\n      --test-data-dir \"${SEVENSCENESRW}\" \\\n      --save-dir \"${DATADIR}\" \\\n      --gpu 0 \\\n      --experiment 0 \\\n      --test-scene multi\n    ````\n\n2. 6 scenes training (Table 2. in the paper)\n   ```shell\n   for SCENE in \"chess\" \"fire\" \"heads\" \"office\" \"pumpkin\" \"redkitchen\" \"stairs\"; do\n      python -u ${RELPOSEGNN}/python/niantic/training/train.py \\\n        --dataset-dir \"${SEVENSCENES}\" \\\n        --train-data-dir \"${SEVENSCENESRW}\" \\\n        --test-data-dir \"${SEVENSCENESRW}\" \\\n        --save-dir \"${DATADIR}\" \\\n        --gpu 0 \\\n        --experiment 1 \\\n        --test-scene \"${SCENE}\"\n   done\n\n3. Single scene training (Table 1. in the supp.)\n   ```shell\n   for SCENE in \"chess\" \"fire\" \"heads\" \"office\" \"pumpkin\" \"redkitchen\" \"stairs\"; do\n      python -u ${RELPOSEGNN}/python/niantic/training/train.py \\\n        --dataset-dir \"${SEVENSCENES}\" \\\n        --train-data-dir \"${SEVENSCENESRW}\" \\\n        --test-data-dir \"${SEVENSCENESRW}\" \\\n        --save-dir \"${DATADIR}\" \\\n        --gpu 0 \\\n        --experiment 2 \\\n        --train-scene \"${SCENE}\" \\\n        --test-scene \"${SCENE}\" \\\n        --max-epoch 100\n   done\n\n\n## Reproducing results: Cambridge Landmarks\n\n\n### Graph generation\n\nBefore starting to train the model, train and test graphs should be generated to speed up\nthe dataloaders, and not have to run NN search during training.\n\n#### A. Pre-processed\n\n1. Download\n \n    - Test\n       ```shell\n       mkdir -p \"${CAMBRIDGERW}\" || (mkdir -p \"${CAMBRIDGERW}\" \u0026\u0026 chmod go+w -R \"${CAMBRIDGERW}\")\n       for SCENE in \"KingsCollege\", \"OldHospital\", \"StMarysChurch\", \"ShopFacade\", \"GreatCourt\"; do\n         wget -c \"https://storage.googleapis.com/niantic-lon-static/research/relpose-gnn/data/${SCENE}_fc8_sp3_test.tar\" \\\n              -O \"${CAMBRIDGERW}/${SCENE}_fc8_sp3_test.tar\"\n       done\n       ```\n   - Train\n      ```shell\n      for SCENE in \"KingsCollege\", \"OldHospital\", \"StMarysChurch\", \"ShopFacade\", \"GreatCourt\"; do\n        wget -c \"https://storage.googleapis.com/niantic-lon-static/research/relpose-gnn/data/${SCENE}_fc8_sp3_train.tar\" \\\n             -O \"${CAMBRIDGERW}/${SCENE}_fc8_sp3_train.tar\"\n      done\n      ```\n\n2. Extract\n\n    ```shell\n    (cd \"${CAMBRIDGERW}\"; \\\n     find \"${CAMBRIDGERW}\" -mindepth 1 -maxdepth 1 -name \"*.tar\" | xargs -P 7 -I fileName sh -c 'tar -I pigz -xvf \"fileName\"')\n    ````\n    \n\n### Evaluation\n\n#### Pre-trained\n\n1. Download pre-trained model trained with entire Cambridge training scenes (Table 3 in the paper)\n   ```shell\n   wget \\\n    -c \"https://storage.googleapis.com/niantic-lon-static/research/relpose-gnn/models/relpose_gnn_cambridge_epoch_149.pth.tar\" \\\n    -O \"${DATADIR}/relpose_gnn_cambridge_epoch_149.pth.tar\"\n   ```\n2. Evaluate on each Cambridge test scene \n   ```shell\n   for SCENE in \"KingsCollege\", \"OldHospital\", \"StMarysChurch\", \"ShopFacade\", \"GreatCourt\"; do\n      python -u ${RELPOSEGNN}/python/niantic/testing/test.py \\\n        --dataset-dir \"${CAMBRIDGE}\" \\\n        --test-data-dir \"${CAMBRIDGERW}\" \\\n        --weights \"${DATADIR}/relpose_gnn_cambridge_epoch_149.pth.tar\" \\\n        --save-dir \"${DATADIR}\" \\\n        --gpu 0 \\\n        --test-scene \"${SCENE}\"\n   done\n   ```\n\n\n### Train yourself\n1. Cambridge training (Table 3 in the paper)\n    ```shell\n    python -u ${RELPOSEGNN}/python/niantic/training/train.py \\\n      --dataset-dir \"${CAMBRIDGE}\" \\\n      --train-data-dir \"${CAMBRIDGERW}\" \\\n      --test-data-dir \"${CAMBRIDGERW}\" \\\n      --save-dir \"${DATADIR}\" \\\n      --gpu 0 \\\n      --experiment 0 \\\n      --test-scene multi\n    ````\n    \n    \n    \n \n\n   \n   \n## 🤝 Acknowledgements\n\nWe would like to thank Galen Han for his extensive help with this project.  \nWe also thank Qunjie Zhou, Luwei Yang, Dominik Winkelbauer, Torsten Sattler, and Soham Saha\nfor their help and advice with baselines.\n\n## 👩‍⚖️ License\n\nCopyright © Niantic, Inc. 2021. Patent Pending. All rights reserved. Please see the [license](LICENSE) file for terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnianticlabs%2Frelpose-gnn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnianticlabs%2Frelpose-gnn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnianticlabs%2Frelpose-gnn/lists"}