Exemplo n.º 1
0
def display_results(in_image, data_2d, joint_visibility, data_3d):
    """Plot 2D and 3D poses for each of the people in the image."""
    plt.figure()
    draw_limbs(in_image, data_2d, joint_visibility)
    plt.imshow(in_image)
    plt.axis('off')

    # Show 3D poses
    for single_3D in data_3d:
        # or plot_pose(Prob3dPose.centre_all(single_3D))
        plot_pose(single_3D)

    plt.show()
def display_results(in_image, data_2d, joint_visibility, data_3d, frame):
    """Plot 2D and 3D poses for each of the people in the image."""
    plt.figure()
    draw_limbs(in_image, data_2d, joint_visibility)
    # plt.imshow(in_image)
    plt.axis('off')

    # Show 3D poses
    for single_3D in data_3d:
        # or plot_pose(Prob3dPose.centre_all(single_3D))
        plot_pose(single_3D)

    pngName = 'png/test_{0}.jpg'.format(str(frame).zfill(12))
    plt.savefig(pngName)
Exemplo n.º 3
0
def display_results(in_image, data_2d, joint_visibility, data_3d):
    """
      FOR VISUALIZATION OF 'LIFTING FROM THE DEEP' OUTPUT FOR ONE FRAME
      Plot 2D and 3D poses for each of the people in the image.
    """
    plt.figure()
    draw_limbs(in_image, data_2d, joint_visibility)
    plt.imshow(in_image)
    plt.axis('off')

    # Show 3D poses
    for single_3D in data_3d:
        # or plot_pose(Prob3dPose.centre_all(single_3D))
        plot_pose(single_3D)

    plt.show()
Exemplo n.º 4
0
def display_results(mode, in_image, data_2d, visibilities, data_3d):
    """Plot 2D and 3D poses for each of the people in the image."""
    n_poses = len(data_3d)
    if mode == 'openpose':
        color_im = OpPoseEstimator.draw_humans(in_image,
                                               data_2d,
                                               imgcopy=False)
    else:
        draw_limbs(in_image, data_2d, visibilities)

    plt.subplot(1, n_poses + 1, 1)
    plt.imshow(in_image)
    plt.axis('off')

    # Show 3D poses
    for idx, single_3D in enumerate(data_3d):
        plot_pose(Prob3dPose.centre_all(single_3D),
                  visibility_to_3d(visibilities[idx]), n_poses + 1, idx + 2)
Exemplo n.º 5
0
def display_results(in_image, data_2d, joint_visibility, data_3d, i):
    """
    Plot 2D and 3D poses for each of the people in the image;
    :param in_image:
    :param data_2d:
    :param joint_visibility:
    :param data_3d:
    :param i:
    :return:
    """

    plt.figure(i)
    draw_limbs(in_image, data_2d, joint_visibility, i)
    plt.imshow(in_image)
    # plt.axis('off')

    # Show 3D poses
    for single_3D in data_3d:
        # or plot_pose(Prob3dPose.centre_all(single_3D))
        plot_pose(single_3D)
    plt.show()
import scipy.io
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

from lifting import utils

mats = scipy.io.loadmat('data/saved_sessions/prob_model/prob_model_params.mat')
e = mats['e']
mu = mats['mu']
sigma = mats['sigma']

mu = np.reshape(mu, (mu.shape[0], 3, -1))
e = np.reshape(e, (e.shape[0], e.shape[1], 3, -1))

sh = np.shape(e)

for i in range(sh[0]):
    for j in range(sh[1]):
        #pose0 = mu[i, :, :]
        pose0 = e[i, j, :, :]
        utils.plot_pose(pose0)

plt.show()