From 6e123ad6bf1a6fee70bcebdd844409d5318eeda0 Mon Sep 17 00:00:00 2001 From: Paul-Edouard Sarlin Date: Sun, 8 Oct 2023 21:03:16 +0200 Subject: [PATCH 1/5] Remove set_grad_enable --- gluefactory/eval/eth3d.py | 3 --- gluefactory/eval/hpatches.py | 3 --- gluefactory/eval/megadepth1500.py | 2 -- 3 files changed, 8 deletions(-) diff --git a/gluefactory/eval/eth3d.py b/gluefactory/eval/eth3d.py index 7ef59fbd..59b99dc5 100644 --- a/gluefactory/eval/eth3d.py +++ b/gluefactory/eval/eth3d.py @@ -1,4 +1,3 @@ -import torch from pathlib import Path from omegaconf import OmegaConf import matplotlib.pyplot as plt @@ -25,8 +24,6 @@ rlimit = resource.getrlimit(resource.RLIMIT_NOFILE) resource.setrlimit(resource.RLIMIT_NOFILE, (4096, rlimit[1])) -torch.set_grad_enabled(False) - def eval_dataset(loader, pred_file, suffix=""): results = defaultdict(list) diff --git a/gluefactory/eval/hpatches.py b/gluefactory/eval/hpatches.py index 3959c4cc..6bd51ede 100644 --- a/gluefactory/eval/hpatches.py +++ b/gluefactory/eval/hpatches.py @@ -1,4 +1,3 @@ -import torch from pathlib import Path from omegaconf import OmegaConf from pprint import pprint @@ -33,8 +32,6 @@ rlimit = resource.getrlimit(resource.RLIMIT_NOFILE) resource.setrlimit(resource.RLIMIT_NOFILE, (4096, rlimit[1])) -torch.set_grad_enabled(False) - class HPatchesPipeline(EvalPipeline): default_conf = { diff --git a/gluefactory/eval/megadepth1500.py b/gluefactory/eval/megadepth1500.py index df784445..77c2e860 100644 --- a/gluefactory/eval/megadepth1500.py +++ b/gluefactory/eval/megadepth1500.py @@ -26,8 +26,6 @@ rlimit = resource.getrlimit(resource.RLIMIT_NOFILE) resource.setrlimit(resource.RLIMIT_NOFILE, (4096, rlimit[1])) -torch.set_grad_enabled(False) - class MegaDepth1500Pipeline(EvalPipeline): default_conf = { From 7de9d9ab81591e521c52b1341b074d79b3dbcebd Mon Sep 17 00:00:00 2001 From: Paul-Edouard Sarlin Date: Sun, 8 Oct 2023 21:36:41 +0200 Subject: [PATCH 2/5] Remove unused resources --- gluefactory/eval/eth3d.py | 5 ----- gluefactory/eval/hpatches.py | 5 ----- gluefactory/eval/megadepth1500.py | 4 ---- 3 files changed, 14 deletions(-) diff --git a/gluefactory/eval/eth3d.py b/gluefactory/eval/eth3d.py index 59b99dc5..ef2b3a79 100644 --- a/gluefactory/eval/eth3d.py +++ b/gluefactory/eval/eth3d.py @@ -1,7 +1,6 @@ from pathlib import Path from omegaconf import OmegaConf import matplotlib.pyplot as plt -import resource from collections import defaultdict from tqdm import tqdm import numpy as np @@ -21,10 +20,6 @@ from ..datasets import get_dataset -rlimit = resource.getrlimit(resource.RLIMIT_NOFILE) -resource.setrlimit(resource.RLIMIT_NOFILE, (4096, rlimit[1])) - - def eval_dataset(loader, pred_file, suffix=""): results = defaultdict(list) results["num_pos" + suffix] = 0 diff --git a/gluefactory/eval/hpatches.py b/gluefactory/eval/hpatches.py index 6bd51ede..c714bf11 100644 --- a/gluefactory/eval/hpatches.py +++ b/gluefactory/eval/hpatches.py @@ -2,7 +2,6 @@ from omegaconf import OmegaConf from pprint import pprint import matplotlib.pyplot as plt -import resource from collections import defaultdict from collections.abc import Iterable from tqdm import tqdm @@ -29,10 +28,6 @@ from .eval_pipeline import EvalPipeline -rlimit = resource.getrlimit(resource.RLIMIT_NOFILE) -resource.setrlimit(resource.RLIMIT_NOFILE, (4096, rlimit[1])) - - class HPatchesPipeline(EvalPipeline): default_conf = { "data": { diff --git a/gluefactory/eval/megadepth1500.py b/gluefactory/eval/megadepth1500.py index 77c2e860..d9eb3377 100644 --- a/gluefactory/eval/megadepth1500.py +++ b/gluefactory/eval/megadepth1500.py @@ -3,7 +3,6 @@ from omegaconf import OmegaConf from pprint import pprint import matplotlib.pyplot as plt -import resource from collections import defaultdict from collections.abc import Iterable from tqdm import tqdm @@ -23,9 +22,6 @@ from .utils import eval_relative_pose_robust, eval_poses, eval_matches_epipolar -rlimit = resource.getrlimit(resource.RLIMIT_NOFILE) -resource.setrlimit(resource.RLIMIT_NOFILE, (4096, rlimit[1])) - class MegaDepth1500Pipeline(EvalPipeline): default_conf = { From 723eb2aea542dd4f25ddd4a5c49f0e4f18d09e90 Mon Sep 17 00:00:00 2001 From: Paul-Edouard Sarlin Date: Sun, 8 Oct 2023 21:37:13 +0200 Subject: [PATCH 3/5] Install sub-packages --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 024c8164..f213a321 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,8 +44,8 @@ extra = [ ] dev = ["black", "flake8", "jupyter"] -[tool.setuptools] -packages = ["gluefactory", "gluefactory_nonfree"] +[tool.setuptools.packages.find] +include = ["gluefactory*"] [tool.setuptools.package-data] gluefactory = ["datasets/megadepth_scene_lists/*.txt"] From a805aba2d3bd353c44423e4392eb61ae9f5dfea9 Mon Sep 17 00:00:00 2001 From: Paul-Edouard Sarlin Date: Sun, 8 Oct 2023 21:37:42 +0200 Subject: [PATCH 4/5] Import config files --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f213a321..35b0f2ee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,4 +48,4 @@ dev = ["black", "flake8", "jupyter"] include = ["gluefactory*"] [tool.setuptools.package-data] -gluefactory = ["datasets/megadepth_scene_lists/*.txt"] +gluefactory = ["datasets/megadepth_scene_lists/*.txt", "configs/*.yaml"] From 064ad76ee519c9c37bba1ec842bb3e78d8ed090d Mon Sep 17 00:00:00 2001 From: Paul-Edouard Sarlin Date: Sun, 8 Oct 2023 21:44:34 +0200 Subject: [PATCH 5/5] Add missing LightGlue dependency --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 35b0f2ee..b0cc6d78 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,6 +31,7 @@ dependencies = [ "kornia", "seaborn", "joblib", + "lightglue @ git+https://github.com/cvg/LightGlue.git", ] urls = {Repository = "https://github.com/cvg/glue-factory"}