def forward(self, rgbImg):
"""
Perform a forward network pass of an RGB image.
:param rgbImg: RGB image to process. Shape: (imgDim, imgDim, 3)
:type rgbImg: numpy.ndarray
:return: Vector of features extracted from the neural network.
:rtype: numpy.ndarray
"""
assert rgbImg is not None
t = '/tmp/openface-torchwrap-{}.png'.format(
binascii.b2a_hex(os.urandom(8)))
bgrImg = cv2.cvtColor(rgbImg, cv2.COLOR_RGB2BGR)
cv2.imwrite(t, bgrImg)
rep = self.forwardPath(t)
os.remove(t)
return rep
torch_neural_net.lutorpy.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录