本文整理汇总了Python中PoseTools.createLabelImages方法的典型用法代码示例。如果您正苦于以下问题:Python PoseTools.createLabelImages方法的具体用法?Python PoseTools.createLabelImages怎么用?Python PoseTools.createLabelImages使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PoseTools
的用法示例。
在下文中一共展示了PoseTools.createLabelImages方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: range
# 需要导入模块: import PoseTools [as 别名]
# 或者: from PoseTools import createLabelImages [as 别名]
sel_ndx = np.where((xx == (cur_l[1])) & (yy == (cur_l[0])))[0]
diff_m = all_m[sel, sel_ndx, sel_cls, :] * 4 - all_l[sel, sel_cls, :]
mdn_pred_out = np.zeros([128, 128])
cur_m = all_m[sel, :, sel_cls, :]
cur_s = all_s[sel, :, sel_cls, :]
cur_w = all_w[sel, :, sel_cls]
for ndx in range(256):
osz = 128
if cur_w[ndx] < 0.02:
continue
cur_locs = cur_m[ndx:ndx + 1, :].astype('int')[np.newaxis, :, :]
cur_scale = cur_s[ndx, :].mean().astype('int')
cur_limg = (PoseTools.createLabelImages(cur_locs, [osz, osz], 1, cur_scale) + 1) / 2
mdn_pred_out += cur_w[ndx] * cur_limg[0, ..., 0]
maxndx = np.argmax(mdn_pred_out)
curloc = np.array(np.unravel_index(maxndx,mdn_pred_out.shape))
f = plt.figure(figsize=[30,12])
# f, ax = plt.subplots(1, 3)
ax = []
for ndx in range(3):
ax.append(f.add_subplot(1,3,ndx+1))
c_im = (m_test_data[d_ndx][0][i_ndx, :, :, sel_cls] + 1) / 2
c_im = np.clip(c_im, 0, 1)
i_im = m_test_data[d_ndx][3][i_ndx, 0, :, :]
ax[0].imshow(c_im, interpolation='nearest')
ax[0].scatter(all_l[sel, sel_cls, 0] / 4, all_l[sel, sel_cls, 1] / 4)
ax[0].scatter(all_m[sel, sel_ndx, sel_cls, 0], all_m[sel, sel_ndx, sel_cls, 1], c='r')