Spaces:
Sleeping
Sleeping
fix: extractors
Browse files
hloc/extractors/d2net.py
CHANGED
|
@@ -9,6 +9,7 @@ d2net_path = Path(__file__).parent / "../../third_party"
|
|
| 9 |
sys.path.append(str(d2net_path))
|
| 10 |
from d2net.lib.model_test import D2Net as _D2Net
|
| 11 |
from d2net.lib.pyramid import process_multiscale
|
|
|
|
| 12 |
|
| 13 |
class D2Net(BaseModel):
|
| 14 |
default_conf = {
|
|
|
|
| 9 |
sys.path.append(str(d2net_path))
|
| 10 |
from d2net.lib.model_test import D2Net as _D2Net
|
| 11 |
from d2net.lib.pyramid import process_multiscale
|
| 12 |
+
d2net_path = Path(__file__).parent / "../../third_party/d2net"
|
| 13 |
|
| 14 |
class D2Net(BaseModel):
|
| 15 |
default_conf = {
|
hloc/extractors/lanet.py
CHANGED
|
@@ -5,9 +5,9 @@ import torch
|
|
| 5 |
|
| 6 |
from ..utils.base_model import BaseModel
|
| 7 |
|
| 8 |
-
lanet_path = Path(__file__).parent / "../../third_party"
|
| 9 |
sys.path.append(str(lanet_path))
|
| 10 |
-
from
|
| 11 |
|
| 12 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 13 |
|
|
|
|
| 5 |
|
| 6 |
from ..utils.base_model import BaseModel
|
| 7 |
|
| 8 |
+
lanet_path = Path(__file__).parent / "../../third_party/lanet"
|
| 9 |
sys.path.append(str(lanet_path))
|
| 10 |
+
from network_v0.model import PointModel
|
| 11 |
|
| 12 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 13 |
|
hloc/extractors/rord.py
CHANGED
|
@@ -6,15 +6,15 @@ import torch
|
|
| 6 |
from ..utils.base_model import BaseModel
|
| 7 |
from .. import logger
|
| 8 |
|
| 9 |
-
rord_path = Path(__file__).parent / "../../third_party
|
| 10 |
sys.path.append(str(rord_path))
|
| 11 |
-
from lib.model_test import D2Net as _RoRD
|
| 12 |
-
from lib.pyramid import process_multiscale
|
| 13 |
|
| 14 |
class RoRD(BaseModel):
|
| 15 |
default_conf = {
|
| 16 |
"model_name": "rord.pth",
|
| 17 |
-
"checkpoint_dir": rord_path / "models",
|
| 18 |
"use_relu": True,
|
| 19 |
"multiscale": False,
|
| 20 |
"max_keypoints": 1024,
|
|
|
|
| 6 |
from ..utils.base_model import BaseModel
|
| 7 |
from .. import logger
|
| 8 |
|
| 9 |
+
rord_path = Path(__file__).parent / "../../third_party"
|
| 10 |
sys.path.append(str(rord_path))
|
| 11 |
+
from RoRD.lib.model_test import D2Net as _RoRD
|
| 12 |
+
from RoRD.lib.pyramid import process_multiscale
|
| 13 |
|
| 14 |
class RoRD(BaseModel):
|
| 15 |
default_conf = {
|
| 16 |
"model_name": "rord.pth",
|
| 17 |
+
"checkpoint_dir": rord_path / "RoRD" / "models",
|
| 18 |
"use_relu": True,
|
| 19 |
"multiscale": False,
|
| 20 |
"max_keypoints": 1024,
|
third_party/RoRD/lib/pyramid.py
CHANGED
|
@@ -2,8 +2,8 @@ import torch
|
|
| 2 |
import torch.nn as nn
|
| 3 |
import torch.nn.functional as F
|
| 4 |
|
| 5 |
-
from
|
| 6 |
-
from
|
| 7 |
|
| 8 |
|
| 9 |
def process_multiscale(image, model, scales=[.5, 1, 2]):
|
|
|
|
| 2 |
import torch.nn as nn
|
| 3 |
import torch.nn.functional as F
|
| 4 |
|
| 5 |
+
from .exceptions import EmptyTensorError
|
| 6 |
+
from .utils import interpolate_dense_features, upscale_positions
|
| 7 |
|
| 8 |
|
| 9 |
def process_multiscale(image, model, scales=[.5, 1, 2]):
|
third_party/RoRD/lib/utils.py
CHANGED
|
@@ -4,7 +4,7 @@ import numpy as np
|
|
| 4 |
|
| 5 |
import torch
|
| 6 |
|
| 7 |
-
from
|
| 8 |
|
| 9 |
|
| 10 |
def preprocess_image(image, preprocessing=None):
|
|
|
|
| 4 |
|
| 5 |
import torch
|
| 6 |
|
| 7 |
+
from .exceptions import EmptyTensorError
|
| 8 |
|
| 9 |
|
| 10 |
def preprocess_image(image, preprocessing=None):
|
third_party/d2net/lib/pyramid.py
CHANGED
|
@@ -2,8 +2,8 @@ import torch
|
|
| 2 |
import torch.nn as nn
|
| 3 |
import torch.nn.functional as F
|
| 4 |
|
| 5 |
-
from
|
| 6 |
-
from
|
| 7 |
|
| 8 |
|
| 9 |
def process_multiscale(image, model, scales=[.5, 1, 2]):
|
|
|
|
| 2 |
import torch.nn as nn
|
| 3 |
import torch.nn.functional as F
|
| 4 |
|
| 5 |
+
from .exceptions import EmptyTensorError
|
| 6 |
+
from .utils import interpolate_dense_features, upscale_positions
|
| 7 |
|
| 8 |
|
| 9 |
def process_multiscale(image, model, scales=[.5, 1, 2]):
|
third_party/d2net/lib/utils.py
CHANGED
|
@@ -4,7 +4,7 @@ import numpy as np
|
|
| 4 |
|
| 5 |
import torch
|
| 6 |
|
| 7 |
-
from
|
| 8 |
|
| 9 |
|
| 10 |
def preprocess_image(image, preprocessing=None):
|
|
|
|
| 4 |
|
| 5 |
import torch
|
| 6 |
|
| 7 |
+
from .exceptions import EmptyTensorError
|
| 8 |
|
| 9 |
|
| 10 |
def preprocess_image(image, preprocessing=None):
|