This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class mIoU(Node): | |
def __init__(self, num_classes, log_file=None): | |
self.num_classes = num_classes | |
self.log_file = None | |
self._total = sparse.coo_matrix((num_classes, num_classes), dtype=np.float32) | |
@staticmethod | |
def compute_iou_per_class(confusion_matrix): | |
""" | |
Args: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import math | |
class OverlapSlidingWindow(object): | |
def __init__(self, image_shape, kernel_shape, stride): | |
self.stride_ = stride | |
self.image_shape_ = image_shape | |
self.kernel_shape_ = kernel_shape |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from torch.utils.data import Dataset | |
import glob | |
import os | |
from skimage.io import imread | |
from PIL import Image | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from simplecv.util import tensor_util | |
from simplecv.interface import CVModule | |
from simplecv.data import preprocess |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import types | |
class A(): | |
def __init__(self): | |
self.a = 0 | |
def print(self, v): | |
print(self.a + v) | |
def override_print(self, fn): | |
self.print = types.MethodType(fn, self) |