Unverified Commit 972dabe5 authored by yukang's avatar yukang Committed by GitHub
Browse files

Update sem_deeplabv3.py

parent da1f5b12
......@@ -111,7 +111,9 @@ class SegTemplate(nn.Module):
"""
# Preprocess images
x = self.preprocess(images)
if self.pretrained:
images = normalize(images, mean=self.norm_mean, std=self.norm_std)
x = images.cuda()
# Extract features
result = OrderedDict()
......@@ -140,20 +142,6 @@ class SegTemplate(nn.Module):
return result
def preprocess(self, images):
"""
Preprocess images
Args:
images: (N, 3, H, W), Input images
Return
x: (N, 3, H, W), Preprocessed images
"""
x = images
if self.pretrained:
# Match ResNet pretrained preprocessing
x = normalize(x, mean=self.norm_mean, std=self.norm_std)
return x.cuda()
class SemDeepLabV3(SegTemplate):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment