Skip to content

Commit

Permalink
feat(transformers): Add depth estimation pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
wcrzlh committed Jan 22, 2025
1 parent 3b5e316 commit 8d6e09a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ def __init__(self, config, channels, factor):

# up/down sampling depending on factor
if factor > 1:
self.resize = nn.ConvTranspose2d(channels, channels, kernel_size=factor, stride=factor, padding=0)
self.resize = nn.Conv2dTranspose(channels, channels, kernel_size=factor, stride=factor, padding=0)
elif factor == 1:
self.resize = nn.Identity()
elif factor < 1:
# so should downsample
self.resize = nn.Conv2d(channels, channels, kernel_size=3, stride=int(1 / factor), padding=1)
self.resize = nn.Conv2d(channels, channels, kernel_size=3, stride=int(1 / factor), padding=1, pad_mode="pad")

# Copied from transformers.models.dpt.modeling_dpt.DPTReassembleLayer.forward
def construct(self, hidden_state):
Expand Down

0 comments on commit 8d6e09a

Please sign in to comment.