Spaces:
Sleeping
Sleeping
Realcat
commited on
Commit
•
82ee2a0
1
Parent(s):
b0dddb4
fix: lib conflicts
Browse files
hloc/matchers/omniglue.py
CHANGED
@@ -7,9 +7,10 @@ from pathlib import Path
|
|
7 |
from .. import logger
|
8 |
from ..utils.base_model import BaseModel
|
9 |
|
10 |
-
|
11 |
-
sys.path.append(str(
|
12 |
-
from src import omniglue
|
|
|
13 |
|
14 |
|
15 |
class OmniGlue(BaseModel):
|
@@ -23,7 +24,7 @@ class OmniGlue(BaseModel):
|
|
23 |
}
|
24 |
|
25 |
def _init(self, conf):
|
26 |
-
logger.info(f"
|
27 |
og_model_path = omniglue_path / "models" / "omniglue.onnx"
|
28 |
sp_model_path = omniglue_path / "models" / "sp_v6.onnx"
|
29 |
dino_model_path = (
|
@@ -42,7 +43,7 @@ class OmniGlue(BaseModel):
|
|
42 |
og_export=str(og_model_path),
|
43 |
sp_export=str(sp_model_path),
|
44 |
dino_export=str(dino_model_path),
|
45 |
-
max_keypoints=self.conf["max_keypoints"]
|
46 |
)
|
47 |
logger.info(f"Loaded OmniGlue model done!")
|
48 |
|
|
|
7 |
from .. import logger
|
8 |
from ..utils.base_model import BaseModel
|
9 |
|
10 |
+
thirdparty_path = Path(__file__).parent / "../../third_party"
|
11 |
+
sys.path.append(str(thirdparty_path))
|
12 |
+
from omniglue.src import omniglue
|
13 |
+
omniglue_path = thirdparty_path / "omniglue"
|
14 |
|
15 |
|
16 |
class OmniGlue(BaseModel):
|
|
|
24 |
}
|
25 |
|
26 |
def _init(self, conf):
|
27 |
+
logger.info(f"Loading OmniGlue model")
|
28 |
og_model_path = omniglue_path / "models" / "omniglue.onnx"
|
29 |
sp_model_path = omniglue_path / "models" / "sp_v6.onnx"
|
30 |
dino_model_path = (
|
|
|
43 |
og_export=str(og_model_path),
|
44 |
sp_export=str(sp_model_path),
|
45 |
dino_export=str(dino_model_path),
|
46 |
+
max_keypoints=self.conf["max_keypoints"],
|
47 |
)
|
48 |
logger.info(f"Loaded OmniGlue model done!")
|
49 |
|
third_party/omniglue/.gitignore
CHANGED
@@ -25,4 +25,4 @@ poetry.lock
|
|
25 |
.idea
|
26 |
models/sp_v6/*
|
27 |
models/og_export*
|
28 |
-
models/dinov2_vitb14_pretrain.pth
|
|
|
25 |
.idea
|
26 |
models/sp_v6/*
|
27 |
models/og_export*
|
28 |
+
# models/dinov2_vitb14_pretrain.pth
|
third_party/omniglue/src/__init__.py
ADDED
File without changes
|
third_party/omniglue/src/omniglue/dino_extract.py
CHANGED
@@ -15,8 +15,11 @@
|
|
15 |
"""Wrapper for performing DINOv2 inference."""
|
16 |
|
17 |
import cv2
|
|
|
18 |
import numpy as np
|
19 |
-
from
|
|
|
|
|
20 |
|
21 |
from . import utils
|
22 |
import torch
|
|
|
15 |
"""Wrapper for performing DINOv2 inference."""
|
16 |
|
17 |
import cv2
|
18 |
+
import sys
|
19 |
import numpy as np
|
20 |
+
from pathlib import Path
|
21 |
+
sys.path.append(str(Path(__file__).parent.parent.parent / "third_party"))
|
22 |
+
from dinov2 import dino
|
23 |
|
24 |
from . import utils
|
25 |
import torch
|
third_party/omniglue/third_party/dinov2/dino.py
CHANGED
@@ -12,7 +12,7 @@ from functools import partial
|
|
12 |
import math
|
13 |
from typing import Callable, Sequence, Tuple, Union
|
14 |
|
15 |
-
from
|
16 |
import torch
|
17 |
from torch import nn
|
18 |
from torch.nn.init import trunc_normal_
|
|
|
12 |
import math
|
13 |
from typing import Callable, Sequence, Tuple, Union
|
14 |
|
15 |
+
from . import dino_utils
|
16 |
import torch
|
17 |
from torch import nn
|
18 |
from torch.nn.init import trunc_normal_
|