first commit
This commit is contained in:
commit
54ccfb11fe
218 files changed
+19525
No files matched your search
Executable
+19
@@ -0,0 +1,19 @@
|
||||
from torch import nn
|
||||
|
||||
from ssd.modeling.backbone import build_backbone
|
||||
from ssd.modeling.box_head import build_box_head
|
||||
|
||||
|
||||
class SSDDetector(nn.Module):
|
||||
def __init__(self, cfg):
|
||||
super().__init__()
|
||||
self.cfg = cfg
|
||||
self.backbone = build_backbone(cfg) #vgg
|
||||
self.box_head = build_box_head(cfg) #SSDBoxHead
|
||||
|
||||
def forward(self, images, targets=None):
|
||||
features = self.backbone(images) #get feature map
|
||||
detections, detector_losses = self.box_head(features, targets)
|
||||
if self.training:
|
||||
return detector_losses
|
||||
return detections
|
||||
Reference in new issue
Block a user