Vincentqyw commited on
Commit
86d1c07
1 Parent(s): b984b50

update: r2d2

Browse files
app.py CHANGED
@@ -234,7 +234,7 @@ def run(config):
234
  inputs=inputs,
235
  outputs=[],
236
  fn=run_matching,
237
- cache_examples=False,
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
- sys.path.append(str(r2d2_path))
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 tools.transforms import instanciate_transformation
13
- from tools.transforms_tools import persp_apply
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]