Spaces:
Paused
Paused
File size: 604 Bytes
8a32844 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import torch
import torch.nn as nn
from mono.utils.comm import get_func
class DensePredModel(nn.Module):
def __init__(self, cfg) -> None:
super(DensePredModel, self).__init__()
self.encoder = get_func('mono.model.' + cfg.model.backbone.prefix + cfg.model.backbone.type)(**cfg.model.backbone)
self.decoder = get_func('mono.model.' + cfg.model.decode_head.prefix + cfg.model.decode_head.type)(cfg)
def forward(self, input, **kwargs):
# [f_32, f_16, f_8, f_4]
features = self.encoder(input)
out = self.decoder(features, **kwargs)
return out |