Browse Source

fix pylint

tags/v0.5.0-beta
yangyongjie 5 years ago
parent
commit
ee2efd3589
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      model_zoo/deeplabv3/src/backbone/__init__.py
  2. +2
    -2
      model_zoo/deeplabv3/src/miou_precision.py

+ 2
- 2
model_zoo/deeplabv3/src/backbone/__init__.py View File

@@ -14,8 +14,8 @@
# ============================================================================
"""Init backbone."""
from .resnet_deeplab import Subsample, DepthwiseConv2dNative, SpaceToBatch, BatchToSpace, ResNetV1, \
RootBlockBeta, resnet50_dl
RootBlockBeta, resnet50_dl

__all__ = [
"Subsample", "DepthwiseConv2dNative", "SpaceToBatch", "BatchToSpace", "ResNetV1", "RootBlockBeta", "resnet50_dl"
"Subsample", "DepthwiseConv2dNative", "SpaceToBatch", "BatchToSpace", "ResNetV1", "RootBlockBeta", "resnet50_dl"
]

+ 2
- 2
model_zoo/deeplabv3/src/miou_precision.py View File

@@ -24,7 +24,7 @@ def confuse_matrix(target, pred, n):

def iou(hist):
denominator = hist.sum(1) + hist.sum(0) - np.diag(hist)
res = np.diag(hist) / np.where(denominator > 0, denominator, 1)
res = np.diag(hist) / np.where(denominator > 0, denominator, 1)
res = np.sum(res) / np.count_nonzero(denominator)
return res

@@ -62,7 +62,7 @@ class MiouPrecision(Metric):
self._hist = confuse_matrix(label.flatten(), pred.flatten(), self._num_class)
mIoUs = iou(self._hist)
self._mIoU.append(mIoUs)
def eval(self):
"""
Computes the mIoU categorical accuracy.


Loading…
Cancel
Save