def setUp(self, m, m_lsp, m_lspet):
# prepare mock.
joints = np.array([[[50, 80, 0], [50, 80, 1], [150, 260, 1], [150, 260, 0]],
[[100, 200, 1], [100, 200, 0], [120, 280, 0], [120, 280, 1]],
[[40, 10, 0], [40, 10, 1], [120, 290, 1], [120, 290, 0]]])
m_lsp_instance = m_lsp.return_value
m_lsp_instance.name = 'lsp_dataset'
m_lsp_instance.__len__.return_value = 2
lsp_joints = joints.copy()
lsp_joints[:, :, 2] = np.logical_not(joints[:, :, 2]).astype(int)
m_lsp_instance.get_data = lambda i: ('train', lsp_joints[i], 'im{0:04d}.jpg'.format(i + 1), np.zeros((300, 200, 3)))
m_lspet_instance = m_lspet.return_value
m_lspet_instance.name = 'lspet_dataset'
m_lspet_instance.__len__.return_value = 2
lspet_joints = joints.copy()
m_lspet_instance.get_data = lambda i: ('train', lspet_joints[i], 'im{0:05d}.jpg'.format(i + 1), np.zeros((300, 200, 3)))
# initialize.
self.path = 'test_orig_data'
self.output = 'test_data'
self.generator = DatasetGenerator(path=self.path, output=self.output)
评论列表
文章目录