-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://github.com/Parskatt/DeDoDe/issues/30
- Loading branch information
Showing
3 changed files
with
98 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from .dedode_models import dedode_detector_B, dedode_detector_L, dedode_descriptor_B, dedode_descriptor_G | ||
from .dedode_models import dedode_detector_S, dedode_detector_B, dedode_detector_L, dedode_descriptor_B, dedode_descriptor_G | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import os | ||
from argparse import ArgumentParser | ||
|
||
import torch | ||
from torch.optim import AdamW | ||
from torch.optim.lr_scheduler import CosineAnnealingLR | ||
from torch.utils.data import ConcatDataset | ||
import torch.nn as nn | ||
|
||
from DeDoDe.train import train_k_steps | ||
from DeDoDe.datasets.megadepth import MegadepthBuilder | ||
from DeDoDe.descriptors.descriptor_loss import DescriptorLoss | ||
from DeDoDe.checkpoint import CheckPoint | ||
from DeDoDe.descriptors.dedode_descriptor import DeDoDeDescriptor | ||
from DeDoDe.encoder import VGG | ||
from DeDoDe.decoder import ConvRefiner, Decoder | ||
from DeDoDe import dedode_detector_S, dedode_descriptor_B | ||
from DeDoDe.benchmarks import MegaDepthPoseMNNBenchmark | ||
#from DeDoDe import dedode_detector_L, dedode_descriptor_B | ||
from DeDoDe.matchers.dual_softmax_matcher import DualSoftMaxMatcher | ||
#from DeDoDe.matchers.soft_dual_softmax_matcher import SoftDualSoftMaxMatcher | ||
|
||
|
||
from DeDoDe.utils import * | ||
from PIL import Image | ||
import cv2 | ||
import numpy as np | ||
|
||
|
||
if __name__ == "__main__": | ||
device = get_best_device() | ||
detector = dedode_detector_S(weights = torch.load("dedode_detector_S_v2.pth", map_location = device)) | ||
descriptor = dedode_descriptor_B(weights = torch.load("dedode_descriptor_B.pth", map_location = device)) | ||
matcher = DualSoftMaxMatcher() | ||
|
||
mega_1500 = MegaDepthPoseMNNBenchmark() | ||
mega_1500.benchmark( | ||
detector_model = detector, | ||
descriptor_model = descriptor, | ||
matcher_model = matcher) |