Ejemplo n.º 1
0
 def __init__(self, data_path, img_size=(128, 64), normalize=True):
     self.data_path = data_path
     self.img_size = img_size
     self.normalize = normalize
     self.resize = Resize(self.img_size)
     self.to_tensor = ToTensor(normalize=self.normalize)
     self.mask_to_tensor = ToTensor(normalize=False)
     self.data = []
     self.generate_index()
Ejemplo n.º 2
0
    def __init__(self, pkl_path=None, normalize=True, num_instance=4):

        self.normalize = normalize
        self.to_tensor = ToTensor(normalize=self.normalize)
        #self.data = []
        #self.generate_index()

        self.random_flip = RandomFlip(flip_prob=0.5)

        # 检查是否有该文件
        if not os.path.exists(pkl_path):
            raise ValueError('{} not exists!!'.format(pkl_path))
        # 打开pkl  pid:[_,image_id,camera_id]
        with open(pkl_path, 'rb') as fs:
            self.pkl = pickle.load(fs)

        self.sort_keys = list(sorted(self.pkl.keys()))

        self.len = len(self.pkl)

        # nori
        self.nf = nori.Fetcher()

        # 一次性一个人取多少张图片
        self.num_instance = num_instance
Ejemplo n.º 3
0
    def __init__(self,img_size=(128, 64), bbox_threshold=200, pkl_path = None,normalize=True,num_instance=4):
        
        self.img_size = img_size
        self.normalize = normalize
        self.to_tensor = ToTensor(normalize=self.normalize)
        
        self.bbox_threshold = bbox_threshold
        

        self.random_flip = RandomFlip(flip_prob=0.5)
        self.resize = Resize(output_size=self.img_size)
        
        # 检查是否有该文件
        if not os.path.exists(pkl_path):
            raise ValueError('{} not exists!!'.format(pkl_path))
        # 打开pkl  pid:[_,image_id,camera_id]
        with open(pkl_path, 'rb') as fs:
            self.pkl = pickle.load(fs)
            
            
        
        self.len = len(self.pkl)
        
        # nori
        self.nf = nori.Fetcher()
        
        # 一次性一个人取多少张图片
        self.num_instance = num_instance
Ejemplo n.º 4
0
 def __init__(self, dataset, transform=None):
     
     
     self.normalize = True
     self.to_tensor = ToTensor(normalize=self.normalize)
     
     self.dataset = dataset
     self.transform = transform
    def __init__(self, data_path_list, normalize=True):
        self.data_path_list = data_path_list
        self.normalize = normalize
        self.to_tensor = ToTensor(normalize=self.normalize)
        self.data = []
        self.generate_index()

        self.random_flip = RandomFlip(flip_prob=0.5)
Ejemplo n.º 6
0
    def __init__(self, data_path_list, img_size=224, normalize=True):
        self.data_path_list = data_path_list
        self.img_size = img_size
        self.normalize = normalize
        self.to_tensor = ToTensor(normalize=self.normalize)
        self.data = []
        self.generate_index()

        self.random_crop = RandomCrop(output_size=self.img_size)
        self.random_flip = RandomFlip(flip_prob=0.5)
        self.resize = Resize(output_size=int(self.img_size * 2))
Ejemplo n.º 7
0
 def __init__(self, dataset):
     self.dataset = dataset
     
     
     self.normalize = True
     self.to_tensor = ToTensor(normalize=self.normalize)