self.beta = beta
self.metric = metric
super(ExhaustNeighbor, self).__init__(cur_f, ref_f, blk_size)
- self.assign = np.zeros((self.num_row, self.num_col), dtype=np.bool)
+ self.assign = np.zeros((self.num_row, self.num_col), dtype=bool)
"""
estimate neighbor loss:
def __init__(self, cur_f, ref_f, blk_sz, gt_path, mf=None, mask=None):
self.name = 'ground truth'
super(GroundTruth, self).__init__(cur_f, ref_f, blk_sz)
- self.mask = np.zeros((self.num_row, self.num_col), dtype=np.bool)
+ self.mask = np.zeros((self.num_row, self.num_col), dtype=bool)
if gt_path:
with open(gt_path) as gt_file:
lines = gt_file.readlines()
self.mask[i, -j - 1] = True
continue
#the order of original file is flipped on the x axis
- self.mf[i, -j - 1] = np.array([float(y), -float(x)], dtype=np.int)
+ self.mf[i, -j - 1] = np.array([float(y), -float(x)], dtype=int)
else:
self.mf = mf
self.mask = mask
self.ref_f = ref_f
self.blk_sz = blk_sz
#convert RGB to YUV
- self.cur_yuv = np.array(self.cur_f.convert('YCbCr'), dtype=np.int)
- self.ref_yuv = np.array(self.ref_f.convert('YCbCr'), dtype=np.int)
+ self.cur_yuv = np.array(self.cur_f.convert('YCbCr'), dtype=int)
+ self.ref_yuv = np.array(self.ref_f.convert('YCbCr'), dtype=int)
#frame size
self.width = self.cur_f.size[0]
self.height = self.cur_f.size[1]
def MSE(blk1, blk2):
return np.mean(
LA.norm(
- np.array(blk1, dtype=np.int) - np.array(blk2, dtype=np.int), axis=2))
+ np.array(blk1, dtype=int) - np.array(blk2, dtype=int), axis=2))
def drawMF(img, blk_sz, mf):