From 1709021473f9290922a150435b565b2971cf8c42 Mon Sep 17 00:00:00 2001 From: Paul-Edouard Sarlin <15985472+sarlinpe@users.noreply.github.com> Date: Sun, 8 Oct 2023 21:50:23 +0200 Subject: [PATCH] Cleanup install and dependencies (#5) * Remove set_grad_enable * Remove unused resources * Install sub-packages * Import config files * Add missing LightGlue dependency --- gluefactory/eval/eth3d.py | 8 -------- gluefactory/eval/hpatches.py | 8 -------- gluefactory/eval/megadepth1500.py | 6 ------ pyproject.toml | 7 ++++--- 4 files changed, 4 insertions(+), 25 deletions(-) diff --git a/gluefactory/eval/eth3d.py b/gluefactory/eval/eth3d.py index 7ef59fbd..ef2b3a79 100644 --- a/gluefactory/eval/eth3d.py +++ b/gluefactory/eval/eth3d.py @@ -1,8 +1,6 @@ -import torch 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 @@ -22,12 +20,6 @@ from ..datasets import get_dataset -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) results["num_pos" + suffix] = 0 diff --git a/gluefactory/eval/hpatches.py b/gluefactory/eval/hpatches.py index 3959c4cc..c714bf11 100644 --- a/gluefactory/eval/hpatches.py +++ b/gluefactory/eval/hpatches.py @@ -1,9 +1,7 @@ -import torch from pathlib import Path 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 @@ -30,12 +28,6 @@ from .eval_pipeline import EvalPipeline -rlimit = resource.getrlimit(resource.RLIMIT_NOFILE) -resource.setrlimit(resource.RLIMIT_NOFILE, (4096, rlimit[1])) - -torch.set_grad_enabled(False) - - class HPatchesPipeline(EvalPipeline): default_conf = { "data": { diff --git a/gluefactory/eval/megadepth1500.py b/gluefactory/eval/megadepth1500.py index df784445..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,11 +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])) - -torch.set_grad_enabled(False) - class MegaDepth1500Pipeline(EvalPipeline): default_conf = { diff --git a/pyproject.toml b/pyproject.toml index 024c8164..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"} @@ -44,8 +45,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"] +gluefactory = ["datasets/megadepth_scene_lists/*.txt", "configs/*.yaml"]