MCPcopy Index your code
hub / github.com/nywang16/Pixel2Mesh / work

Method work

p2m/fetcher.py:41–57  ·  view source on GitHub ↗
(self, idx)

Source from the content-addressed store, hash-verified

39 np.random.shuffle(self.pkl_list)
40
41 def work(self, idx):
42 pkl_path = self.pkl_list[idx]
43 label = pickle.load(open(pkl_path, 'rb'))
44
45 img_path = pkl_path.replace('.dat', '.png')
46 '''
47 img = cv2.imread(img_path, cv2.IMREAD_UNCHANGED)
48 img[np.where(img[:,:,3]==0)] = 255
49 img = cv2.resize(img, (224,224))
50 img = img[:,:,:3]/255.
51 '''
52 img = io.imread(img_path)
53 img[np.where(img[:,:,3]==0)] = 255
54 img = transform.resize(img, (224,224))
55 img = img[:,:,:3].astype('float32')
56
57 return img, label, pkl_path.split('/')[-1]
58
59 def run(self):
60 while self.index < 90000000 and not self.stopped:

Callers 1

runMethod · 0.95

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected