MCPcopy Create free account
hub / github.com/ByteDance-Seed/Depth-Anything-3 / VPRModel

Class VPRModel

da3_streaming/loop_utils/loop_detector.py:35–71  ·  view source on GitHub ↗

This is the main model for Visual Place Recognition we use Pytorch Lightning for modularity purposes. Args: pl (_type_): _description_

Source from the content-addressed store, hash-verified

33
34
35class VPRModel(nn.Module):
36 """This is the main model for Visual Place Recognition
37 we use Pytorch Lightning for modularity purposes.
38
39 Args:
40 pl (_type_): _description_
41 """
42
43 def __init__(
44 self,
45 # ---- Backbone
46 backbone_arch="resnet50",
47 backbone_config={},
48 # ---- Aggregator
49 agg_arch="ConvAP",
50 agg_config={},
51 ):
52 super().__init__()
53
54 # Backbone
55 self.encoder_arch = backbone_arch
56 self.backbone_config = backbone_config
57
58 # Aggregator
59 self.agg_arch = agg_arch
60 self.agg_config = agg_config
61
62 # ----------------------------------
63 # get the backbone and the aggregator
64 self.backbone = helper.get_backbone(backbone_arch, backbone_config)
65 self.aggregator = helper.get_aggregator(agg_arch, agg_config)
66
67 # the forward pass of the lightning model
68 def forward(self, x):
69 x = self.backbone(x)
70 x = self.aggregator(x)
71 return x
72
73
74class LoopDetector:

Callers 1

load_modelMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected