Spaces:
Running
Running
Vincentqyw
commited on
Commit
•
548c5db
1
Parent(s):
5c61c95
update: r2d2
Browse files- app.py +1 -1
- hloc/extractors/r2d2.py +3 -2
- third_party/r2d2/extract.py +3 -3
- third_party/r2d2/tools/__init__.py +0 -0
- third_party/r2d2/tools/dataloader.py +2 -2
app.py
CHANGED
@@ -234,7 +234,7 @@ def run(config):
|
|
234 |
inputs=inputs,
|
235 |
outputs=[],
|
236 |
fn=run_matching,
|
237 |
-
cache_examples=
|
238 |
label="Examples (click one of the images below to Run Match)",
|
239 |
)
|
240 |
|
|
|
234 |
inputs=inputs,
|
235 |
outputs=[],
|
236 |
fn=run_matching,
|
237 |
+
cache_examples=True,
|
238 |
label="Examples (click one of the images below to Run Match)",
|
239 |
)
|
240 |
|
hloc/extractors/r2d2.py
CHANGED
@@ -4,9 +4,10 @@ import torchvision.transforms as tvf
|
|
4 |
|
5 |
from ..utils.base_model import BaseModel
|
6 |
|
|
|
|
|
7 |
r2d2_path = Path(__file__).parent / "../../third_party/r2d2"
|
8 |
-
|
9 |
-
from extract import load_network, NonMaxSuppression, extract_multiscale
|
10 |
|
11 |
|
12 |
class R2D2(BaseModel):
|
|
|
4 |
|
5 |
from ..utils.base_model import BaseModel
|
6 |
|
7 |
+
base_path = Path(__file__).parent / "../../third_party"
|
8 |
+
sys.path.append(str(base_path))
|
9 |
r2d2_path = Path(__file__).parent / "../../third_party/r2d2"
|
10 |
+
from r2d2.extract import load_network, NonMaxSuppression, extract_multiscale
|
|
|
11 |
|
12 |
|
13 |
class R2D2(BaseModel):
|
third_party/r2d2/extract.py
CHANGED
@@ -8,9 +8,9 @@ from PIL import Image
|
|
8 |
import numpy as np
|
9 |
import torch
|
10 |
|
11 |
-
from tools import common
|
12 |
-
from tools.dataloader import norm_RGB
|
13 |
-
from nets.patchnet import *
|
14 |
|
15 |
|
16 |
def load_network(model_fn):
|
|
|
8 |
import numpy as np
|
9 |
import torch
|
10 |
|
11 |
+
from .tools import common
|
12 |
+
from .tools.dataloader import norm_RGB
|
13 |
+
from .nets.patchnet import *
|
14 |
|
15 |
|
16 |
def load_network(model_fn):
|
third_party/r2d2/tools/__init__.py
ADDED
File without changes
|
third_party/r2d2/tools/dataloader.py
CHANGED
@@ -9,8 +9,8 @@ import numpy as np
|
|
9 |
import torch
|
10 |
import torchvision.transforms as tvf
|
11 |
|
12 |
-
from
|
13 |
-
from
|
14 |
|
15 |
|
16 |
RGB_mean = [0.485, 0.456, 0.406]
|
|
|
9 |
import torch
|
10 |
import torchvision.transforms as tvf
|
11 |
|
12 |
+
from .transforms import instanciate_transformation
|
13 |
+
from .transforms_tools import persp_apply
|
14 |
|
15 |
|
16 |
RGB_mean = [0.485, 0.456, 0.406]
|