diff --git a/mdata/ILSVRC.py b/mdata/ILSVRC.py index aefd55f..2146568 100644 --- a/mdata/ILSVRC.py +++ b/mdata/ILSVRC.py @@ -294,7 +294,7 @@ class DataILSVRC(DataDumperBase): # img = cv2.imread(image, cv2.CV_LOAD_IMAGE_UNCHANGED) # h, w = img.shape[:2] # if w < 300 or h < 300: - # continue + # continue # left, upper = random.randint(0, w - 300), random.randint(0, h - 300) # img_crop = img[upper:upper + 300, left:left + 300] # cv2.imwrite(os.path.join(base_dir, category + '_crop_cv', name), img_crop) @@ -457,6 +457,7 @@ class DataILSVRC(DataDumperBase): dict_dataset[hash] = (tag, im.getCoefMatrix(channel='Y')) for tag, feat in dict_dataset.values(): + feat.ravel()[[i*304+j for i in range(0,304,8) for j in range(0,304,8)]] = 0 X.append(feat.ravel()) Y.append(int(tag)) diff --git a/mdata/ILSVRC_S.py b/mdata/ILSVRC_S.py index 77da0da..edf4469 100644 --- a/mdata/ILSVRC_S.py +++ b/mdata/ILSVRC_S.py @@ -520,6 +520,7 @@ class DataILSVRC_S(DataDumperBase): dict_dataset[hash] = (tag, im.getCoefMatrix(channel='Y')) for tag, feat in dict_dataset.values(): + feat.ravel()[[i*304+j for i in range(0,304,8) for j in range(0,304,8)]] = 0 X.append(feat.tolist()) Y.append(int(tag)) -- libgit2 0.21.2