def Get_guide(self):
"""Generate guide image feature"""
guide = np.float32(imresize(PIL.Image.open(self.guide_path),224))
h,w = guide.shape[:2]
src, dst = self.net.blobs['data'], self.net.blobs[self.end]
src.reshape(1,3,h,w)
src.data[0] = self.Preprocess(guide)
self.net.forward(end=self.end)
self.guide_features = dst.data[0].copy()
self.flag = 1
评论列表
文章目录