From b5a576b8602ebd26c47b7b1a4e81d90f9eeac017 Mon Sep 17 00:00:00 2001 From: "rujiao.lrj" Date: Thu, 17 Nov 2022 15:57:55 +0800 Subject: [PATCH] revise format --- modelscope/pipelines/cv/ocr_utils/model_dla34.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modelscope/pipelines/cv/ocr_utils/model_dla34.py b/modelscope/pipelines/cv/ocr_utils/model_dla34.py index 37cbd4fe..584e92d0 100644 --- a/modelscope/pipelines/cv/ocr_utils/model_dla34.py +++ b/modelscope/pipelines/cv/ocr_utils/model_dla34.py @@ -643,8 +643,8 @@ class DLAUp(nn.Module): assert len(layers) > 1 for i in range(len(layers) - 1): ida = getattr(self, "ida_{}".format(i)) - x, y = ida(layers[-i - 2 :]) - layers[-i - 1 :] = y + x, y = ida(layers[-i - 2:]) + layers[-i - 1:] = y return x @@ -668,8 +668,8 @@ class DLASeg(nn.Module): self.first_level = int(np.log2(down_ratio)) self.base = globals()[base_name](pretrained=pretrained, return_levels=True) channels = self.base.channels - scales = [2**i for i in range(len(channels[self.first_level :]))] - self.dla_up = DLAUp(channels[self.first_level :], scales=scales) + scales = [2**i for i in range(len(channels[self.first_level:]))] + self.dla_up = DLAUp(channels[self.first_level:], scales=scales) for head in self.heads: classes = self.heads[head] @@ -713,7 +713,7 @@ class DLASeg(nn.Module): def forward(self, x): x = self.base(x) - x = self.dla_up(x[self.first_level :]) + x = self.dla_up(x[self.first_level:]) ret = {} for head in self.heads: ret[head] = self.__getattr__(head)(x)