Skip to content

Instantly share code, notes, and snippets.

View Z-Zheng's full-sized avatar
😎
Focusing

Zhuo Zheng Z-Zheng

😎
Focusing
View GitHub Profile
@Z-Zheng
Z-Zheng / todo_wjj.py
Created September 3, 2019 09:35
todo
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:
@Z-Zheng
Z-Zheng / sw.py
Created June 27, 2019 01:56
sliding window
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
@Z-Zheng
Z-Zheng / deepglobe_road.py
Created May 13, 2019 03:23
dataset class and transform class for lxy
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
@Z-Zheng
Z-Zheng / online_override.py
Created December 11, 2018 12:42
python online override class function
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)