def __init__(self, df, img_path='/home/rliu/TDD-Net/data/', window_size=50, pad_size=50, mask=create_circular_mask(224, 224), transforms=None): """ Args: df: dataframes of training data transform: pytorch transforms for transforms and tensor conversion """ self.data = df self.img_path = img_path self.transforms = transforms self.window_size = window_size self.pad_size = pad_size self.mask = mask
def __init__( self, csv_path='/home/rliu/yolo2/v2_pytorch_yolo2/data/an_data/VOCdevkit/VOC2007/csv_labels/train.csv', img_path='/home/rliu/TDD-Net/data/', window_size=50, pad_size=50, mask=create_circular_mask(224, 224), transforms=None): """ Args: csv_path (string): path to csv file transform: pytorch transforms for transforms and tensor conversion """ self.data = pd.read_csv(csv_path, sep=" ") self.img_path = img_path self.transforms = transforms self.window_size = window_size self.pad_size = pad_size self.mask = mask
def __init__(self, image_index=6501, img_path='/home/rliu/TDD-Net/data/', window_size=45, mask=create_circular_mask(224, 224), stride=2, transforms=None): """ Args: image_index: index of image being processed window_size: size of sliding window transform: pytorch transforms for transforms and tensor conversion """ self.image = Image.open(img_path + '%06.0f.jpg' % image_index).convert('L') coord_list = np.empty([0, 2], dtype=int) for i in np.arange(0, self.image.size[0], stride): for j in np.arange(0, self.image.size[1], stride): coord_list = np.append(coord_list, [[i, j]], axis=0) self.coords = coord_list self.mask = mask self.window_size = window_size self.transforms = transforms