예제 #1
0
    rand_mse = np.linalg.norm(random_vectors, axis=2)

    factor = mse / rand_mse
    random_vectors *= factor[:, :, np.newaxis]

    rotated_generated_vectors = reference_data - random_vectors
    mse2 = np.linalg.norm(reference_data - rotated_generated_vectors, axis=2)

    shuffled_rotated_reference, shuffled_and_rotated_generated = shuffle(
        reference_data, rotated_generated_vectors, random_state=42)

    joint_names = list(np_file['joint_names'])
    activity = np_file['activity'].item().split("/")[-1]
    delta_t = np_file['delta_t'].item()

    fh.create_folder(normal_path)
    fh.create_folder(shuffled_path)
    fh.create_folder(rotated_path)
    fh.create_folder(shuffled_and_rotated_path)

    sp.print_stats(generated_data,
                   reference_data,
                   joint_names,
                   activity,
                   delta_t,
                   loss_test_wrapper,
                   save_matrices=False,
                   target_path=normal_path)
    sp.print_stats(rotated_generated_vectors,
                   reference_data,
                   joint_names,
예제 #2
0
from Helpers import DataPreprocessor
from Helpers import ModelWrappers
from Helpers import Models
import torch
import sys
import time

from Helpers import FileHelpers

og_folder = "TEMP_REMOVE"

FileHelpers.create_folder(og_folder)
FileHelpers.create_folder(og_folder + "/unity_motion_export")
FileHelpers.create_folder(og_folder + "/stats")
FileHelpers.create_folder(og_folder + "/videos_out")


def test_folder_func(folder_name, FF_BATCH_SIZE):
    STACKCOUNT = 15
    TARGET_FPS = 20
    take_last = lambda x: og_folder + "/" + x.split('/')[-1].split('.')[
        0] + "_trained_on_" + folder_name.split("/")[-2]

    # eval_files = [  "E:/Master/Converted Mocap/Eyes_Japan_Dataset/hamada/greeting-01-hello-hamada_poses.npz",
    #                 "E:/Master/Converted Mocap/Eyes_Japan_Dataset/kudo/jump-12-boxer step-kudo_poses.npz",
    #                 "E:/Master/Converted Mocap/KIT/576/MarcusS_AdrianM11_poses.npz",
    #                 "E:/Master/Converted Mocap/KIT/513/balance_on_beam06_poses.npz",
    #                 "E:/Master/Converted Mocap/Eyes_Japan_Dataset/hamada/gesture_etc-14-apologize-hamada_poses.npz",
    #                 "E:/Master/Converted Mocap/Eyes_Japan_Dataset/kanno/walk-01-normal-kanno_poses.npz",
    #                 "E:/Master/Converted Mocap/Eyes_Japan_Dataset/takiguchi/pose-10-recall blackmagic-takiguchi_poses.npz",
    #                 "E:/Master/Converted Mocap/TotalCapture/s1/freestyle2_poses.npz",
        if idx == 0:
            pass
        else:
            colorclip = ColorClip(size=(clip1.w, clip1.h), color=[1, 1, 1], duration=1)
            clip = concatenate_videoclips([colorclip, clip])
        clips.append(clip)


    final_clip = concatenate_videoclips(clips)    # Overlay the text clip on the first video clip
    final_clip.write_videofile(target, codec='libx264')


file_path = "E:\\Systemordner\\Dokumente\\Pycharm\\Master\\sparse_body_pose_prediction\\moglow_dropout\\unity_motion_export\\UNTITYEXPORT\\"
image_folder = ""
numbers = [45, 720, 734,  # bwd
           338, 1148, 2112,  # circle
           650, 763, 2308,  # diagonal
           976, 1514, 2016,  # fwd
           12, 13, 772  # sideways
           ]
methods = ["RNN2", "REF", "GLOW", "IK"]

for number in numbers:
    file_names = [file_path + "WALKING_" + method + "_" + str(number) + "_trained_on_WALKING.mp4" for method in methods]
    out_file_path = "shuffled_videos\\"
    FileHelpers.create_folder(out_file_path)
    concatenate_animations([file_names[0],file_names[1],file_names[2],file_names[3]], image_folder, out_file_path + str(number) + "_A.mp4")
    concatenate_animations([file_names[3],file_names[2],file_names[1],file_names[0]], image_folder, out_file_path + str(number) + "_B.mp4")
    concatenate_animations([file_names[2],file_names[3],file_names[0],file_names[1]], image_folder, out_file_path + str(number) + "_C.mp4")
    concatenate_animations([file_names[1],file_names[0],file_names[3],file_names[2]], image_folder, out_file_path + str(number) + "_D.mp4")
from matplotlib.ticker import FuncFormatter
import matplotlib.pyplot as plt
import numpy as np

from Helpers import FileHelpers, ModelWrappers
from Helpers import DataPreprocessor
from Helpers import StatsPrinter
target_folder = "stats/"
training_prep_folder = "E:/Master/Sorted Mocap/WALKING/"
from sklearn.utils import shuffle

FileHelpers.create_folder(target_folder)
numbers = [
    45,
    720,
    734,  # bwd
    338,
    1148,
    2112,  # circle
    650,
    763,
    2308,  # diagonal
    976,
    1514,
    2016,  # fwd
    12,
    13,
    772  # sideways
]
motiondict = {
    45: "bwd",