trying to get basic model working
This commit is contained in:
+11
-2
@@ -3,15 +3,24 @@ import sys
|
||||
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
from torch.nn import functional as F
|
||||
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/..')
|
||||
from models.convnext import ConvNeXt
|
||||
|
||||
|
||||
class DepthEstimation(nn.Module):
|
||||
def __init__(self, device='cuda'):
|
||||
super().__init__()
|
||||
|
||||
self.layer_1 = nn.Conv2d(in_channels=3, out_channels=1, kernel_size=3, device=device, padding='same')
|
||||
self.convnext = ConvNeXt()
|
||||
self.flatten = nn.Flatten()
|
||||
self.decoder = ConvNeXt(reversed=True)
|
||||
|
||||
|
||||
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
||||
x = self.layer_1(x)
|
||||
x = self.convnext(x)
|
||||
# x = self.flatten(x)
|
||||
x = self.decoder(x)
|
||||
|
||||
return x
|
||||
|
||||
Reference in New Issue
Block a user