Example #1
0
try:
    step = int(sys.argv[4])
except:
    step = 10

sys.path.append(
    os.path.join(os.path.dirname(os.path.realpath(__file__)), "../../.."))
from mvn.datasets.human36m import Human36MMultiViewDataset

dataset = Human36MMultiViewDataset(h36m_root,
                                   labels_path,
                                   train=True,
                                   test=True,
                                   image_shape=(512, 512),
                                   retain_every_n_frames_in_test=1,
                                   with_damaged_actions=True,
                                   scale_bbox=1.0,
                                   kind='human36m',
                                   norm_image=False,
                                   undistort_images=False,
                                   ignore_cameras=[])
print(len(dataset))

prev_action = None
patience = 0

sample_idx = 0  # number of sample to start from
step = 10  # in frames

while True:
    sample = dataset[sample_idx]
import os, sys

sys.path.append(
    os.path.join(os.path.dirname(os.path.realpath(__file__)), "../../.."))
from mvn.datasets.human36m import Human36MMultiViewDataset

h36m_root = os.path.join(sys.argv[1], "processed")
labels_multiview_npy_path = sys.argv[2]
number_of_processes = int(sys.argv[3])

dataset = Human36MMultiViewDataset(
    h36m_root,
    labels_multiview_npy_path,
    train=True,  # include all possible data
    test=True,
    image_shape=None,  # don't resize
    retain_every_n_frames_in_test=1,  # yes actually ALL possible data
    with_damaged_actions=True,  # I said ALL DATA
    kind="mpii",
    norm_image=False,  # don't do unnecessary image processing
    crop=False)  # don't crop
print("Dataset length:", len(dataset))

n_subjects = len(dataset.labels['subject_names'])
n_cameras = len(dataset.labels['camera_names'])

# First, prepare: compute distorted meshgrids
print("Computing distorted meshgrids")
meshgrids = np.empty((n_subjects, n_cameras), dtype=object)

for sample_idx in tqdm(range(len(dataset))):
import os, sys

sys.path.append(
    os.path.join(os.path.dirname(os.path.realpath(__file__)), "../../.."))
from mvn.datasets.human36m import Human36MMultiViewDataset

h36m_root = sys.argv[1]
labels_multiview_npy_path = sys.argv[2]
number_of_processes = int(sys.argv[3])

dataset = Human36MMultiViewDataset(h36m_root,
                                   labels_multiview_npy_path,
                                   train=True,
                                   test=True,
                                   image_shape=None,
                                   retain_every_n_frames_in_test=1,
                                   with_damaged_actions=True,
                                   scale_bbox=1.0,
                                   kind="mpii",
                                   norm_image=False)
print("Dataset length:", len(dataset))

n_subjects = len(dataset.labels['subject_names'])
n_cameras = len(dataset.labels['camera_names'])

# First, prepare: compute distorted meshgrids
print("Computing distorted meshgrids")
meshgrids = np.empty((n_subjects, n_cameras), dtype=object)

for sample_idx in tqdm(range(len(dataset))):
    subject_idx = dataset.labels['table']['subject_idx'][sample_idx]