<jupyter_start><jupyter_text>Initiate Function<jupyter_code>SUBJECT_IDS = [1,5,6,7,8,9,11]
this_file = os.path.dirname(os.path.realpath('__file__'))

#Load metadata.xml camera
rcams = cameras.load_cameras(os.path.join(this_file, FLAGS.cameras_path), SUBJECT_IDS)



# Joints in H3.6M -- data has 32 joints, but only 17 that move; these are the indices.
H36M_NAMES = ['']*32
H36M_NAMES[0]  = 'Hip'
H36M_NAMES[1]  = 'RHip'
H36M_NAMES[2]  = 'RKnee'
H36M_NAMES[3]  = 'RFoot'
H36M_NAMES[6]  = 'LHip'
H36M_NAMES[7]  = 'LKnee'
H36M_NAMES[8]  = 'LFoot'
H36M_NAMES[12] = 'Spine'
H36M_NAMES[13] = 'Thorax'
H36M_NAMES[14] = 'Neck/Nose'
H36M_NAMES[15] = 'Head'
H36M_NAMES[17] = 'LShoulder'
H36M_NAMES[18] = 'LElbow'
H36M_NAMES[19] = 'LWrist'
H36M_NAMES[25] = 'RShoulder'
H36M_NAMES[26] = 'RElbow'
H36M_NAMES[27] = 'RWrist'

index_alphapose={
    # Use 17 skeleton point
    "Nose": 0,
    "RShoulder": 6,
    "RElbow": 8,
    "RWrist": 10,
    "LShoulder": 5,
    "LElbow": 7,
    "LWrist": 9,
    "RHip": 12,
    "RKnee": 14,
    "RAnkle": 16,
    "LHip": 11,
    "LKnee": 13,
    "LAnkle": 15,
    "REye": 2,
    "LEye": 1,
    "REar": 4,
    "LEar": 3
}

index_mapping={
# Alpha Pose to Human 3.6M
"Hip": [20, 0],
"RHip": [12,1],
"RKnee": [14,2],
"RFoot": [16,3],
"LHip": [11,6],
"LKnee": [13,7],
"LFoot": [15,8],
"Spine": [19,12],
"Thorax": [18,13],
# "Nose": [14,0],
"Head": [17,15],
"LShoulder": [5,17],
"LElbow": [7,18],
"LWrist": [9,19],
"RShoulder": [6,25],
"RElbow": [8,26],
"RWrist": [10,27]
}



index_mapping_nose={
# Alpha Pose to Human 3.6M
"Hip": [20, 0],
"RHip": [12,1],
"RKnee": [14,2],
"RFoot": [16,3],
"LHip": [11,6],
"LKnee": [13,7],
"LFoot": [15,8],
"Spine": [19,12],
"Thorax": [18,13],
"Nose": [0,14],
"Head": [17,15],
"LShoulder": [5,17],
"LElbow": [7,18],
"LWrist": [9,19],
"RShoulder": [6,25],
"RElbow": [8,26],
"RWrist": [10,27]
}


def data_converter(data):
    data=data['keypoints']
    keypoints=[]
    kp_score=[]
    for a in range (0,len(data)):
        score=[]
        if ((a+3)%3==0):
            keypoints.append(data[a])
            keypoints.append(data[a+1])
        elif((a+1)%3==0):
            score=data[a]
            kp_score.append(score)

    return keypoints
    



stat_3D = torch.load('../data/stat_3d.pth.tar')
stat_2D = torch.load('../data/stat_2d.pth.tar')

data_mean_2d, data_std_2d, dim_to_ignore_2d, dim_to_use_2d = stat_2D['mean'],stat_2D['std'],stat_2D['dim_ignore'],stat_2D['dim_use']
data_mean_3d, data_std_3d, dim_to_ignore_3d, dim_to_use_3d = stat_3D['mean'],stat_3D['std'],stat_3D['dim_ignore'],stat_3D['dim_use']



def count_head(alpha_pose):
    x = (alpha_pose[index_alphapose['LEar']*2]+alpha_pose[index_alphapose['REar']*2])/2
    y = (alpha_pose[index_alphapose['LEar']*2+1]+alpha_pose[index_alphapose['REar']*2+1])/2
    return x,y


def count_thorax(alpha_pose):
    x = (alpha_pose[index_alphapose['LShoulder']*2]+alpha_pose[index_alphapose['RShoulder']*2])/2
    y = (alpha_pose[index_alphapose['LShoulder']*2+1]+alpha_pose[index_alphapose['RShoulder']*2+1])/2
    return x,y


def count_spine(alpha_pose):
    hip_x,hip_y=count_hip(alpha_pose)
    thorax_x,thorax_y=count_thorax(alpha_pose)
    x = (hip_x+thorax_x)/2
    y = (hip_y+thorax_y)/2
    return x,y

def count_hip(alpha_pose):
    x = (alpha_pose[index_alphapose['LHip']*2]+alpha_pose[index_alphapose['RHip']*2])/2
    y = (alpha_pose[index_alphapose['LHip']*2+1]+alpha_pose[index_alphapose['RHip']*2+1])/2
    return x,y

def add_features(alpha_pose):
    #Count Head
    head_x,head_y=count_head(alpha_pose)
    alpha_pose=np.append(alpha_pose,(head_x,head_y))
    
    #Count Thorax
    thorax_x,thorax_y=count_thorax(alpha_pose)
    alpha_pose=np.append(alpha_pose,(thorax_x,thorax_y))
 
    
    #Count Spine
    spine_x,spine_y=count_spine(alpha_pose)
    alpha_pose=np.append(alpha_pose,(spine_x,spine_y))
    
    #Count Hip
    hip_x,hip_y=count_hip(alpha_pose)
    alpha_pose=np.append(alpha_pose,(hip_x,hip_y))
    
    return alpha_pose



#This function is not includding nose for 2D to 3D
def map_alpha_to_human(alpha_pose):
    alpha_pose=add_features(alpha_pose)
    temp_list = [None] * 64
    for a,b in index_mapping.items():
        temp_list[b[1]*2]=alpha_pose[b[0]*2]
        temp_list[b[1]*2+1]=alpha_pose[b[0]*2+1]
    human36m=np.asarray(temp_list)
    return human36m

#This function is includding nose for classification
def map_alpha_to_human_classification(alpha_pose):
    alpha_pose=add_features(alpha_pose)
    temp_list = [None] * 64
    for a,b in index_mapping_nose.items():
        temp_list[b[1]*2]=alpha_pose[b[0]*2]
        temp_list[b[1]*2+1]=alpha_pose[b[0]*2+1]
    human36m=np.asarray(temp_list)
    return human36m


def map_alpha_to_human_classification_json(path):
    # Opening JSON file 
    f = open(path) 
    converted=[]
    # returns JSON object as  
    # a dictionary 
    data = json.load(f) 

    for dat in data:
        convert=np.asarray(data_converter(dat))
        human36m_alpha_example=map_alpha_to_human_classification(convert)
        human36m_alpha_example=human36m_alpha_example.astype('float')
        converted.append(human36m_alpha_example)

    converted=np.asarray(converted) 
        
    # Closing file 
    f.close() 
    
    return converted

def find_centroid(skeletons):
    centroids=[]
    for skeleton in skeletons:
        skeleton_test=skeleton.reshape(int(96/3),3)
        centroid=np.mean(skeleton_test, axis=0)
        centroids.append(centroid)
    centroids=np.asarray(centroids)
    return centroids

def rotate(origin, skeletons, angle):
    """
    Rotate a point counterclockwise by a given angle around a given origin.

    The angle should be given in radians.
    """
    rotated=[]
    for i,skeleton in enumerate(skeletons):
        joints=[]
        skeleton_test=skeleton.reshape(int(96/3),3)
        angle_xy,angle_xz,angle_yz=math.radians(angle[0]),math.radians(angle[1]),math.radians(angle[2])
        
        for j,join in enumerate(skeleton_test):
            ox, oy,oz = origin[i][0],origin[i][1],origin[i][2]
            px, py,pz = join[0],join[1],join[2]

            #Rotation XY
            qx = ox + math.cos(angle_xy) * (px - ox) - math.sin(angle_xy) * (py - oy)
            qy = oy + math.sin(angle_xy) * (px - ox) + math.cos(angle_xy) * (py - oy)
            px, py,pz=qx,qy,pz
            
            #Rotation XZ
            qx = ox + math.cos(angle_xz) * (px - ox) - math.sin(angle_xz) * (pz - oz)
            qz = oz + math.sin(angle_xz) * (px - ox) + math.cos(angle_xz) * (pz - oz)
            px, py,pz=qx,py,qz
            
            #Rotation YZ
            qy = oy + math.cos(angle_yz) * (py - oy) - math.sin(angle_yz) * (pz - oz)
            qz = oz + math.sin(angle_yz) * (py - oy) + math.cos(angle_yz) * (pz - oz)
            px, py,pz=px,qy,qz

            joints.append(px)
            joints.append(py)
            joints.append(pz)


        rotated.append(joints)
    rotated=np.asarray(rotated)
    return rotated<jupyter_output><empty_output><jupyter_text>Do 3D Prediction from Custom Video  Using Created Statistic Dictionary<jupyter_code>normalize=True
actions = data_utils.define_actions( FLAGS.action )
# Human3.6m IDs for training and testing
TRAIN_SUBJECTS = [1,5,6,7,8]
TEST_SUBJECTS  = [9,11]


stat_3D = torch.load('../data/stat_3d.pth.tar')
stat_2D = torch.load('../data/stat_2d.pth.tar')




data_mean_2d, data_std_2d, dim_to_ignore_2d, dim_to_use_2d = stat_2D['mean'],stat_2D['std'],stat_2D['dim_ignore'],stat_2D['dim_use']
data_mean_3d, data_std_3d, dim_to_ignore_3d, dim_to_use_3d = stat_3D['mean'],stat_3D['std'],stat_3D['dim_ignore'],stat_3D['dim_use']
#All the json data
#load json data using json,load(f)
#!/usr/bin/env python
# -*- coding: utf-8 -*-


class Human36M_testing(Dataset):
    def __init__(self, skeleton,many=False):
        """
        :param actions: list of actions to use
        :param data_path: path to dataset
        :param use_hg: use stacked hourglass detections
        :param is_train: load train/test dataset
        """

        self.test_inp, self.test_out = [], []

        # loading data
        # load test data
       
        if many:
            num_f= skeleton.shape
            for i in range(num_f[0]):
                self.test_inp.append(skeleton[i])
        else:
            self.test_inp.append(skeleton)


    def __getitem__(self, index):
        inputs = torch.from_numpy(self.test_inp[index]).float()

        return inputs

    def __len__(self):
        return len(self.test_inp)
    
def normalize_single_data(data, data_mean, data_std, dim_to_use ):
    """Normalizes a dictionary of poses

    Args
    data: dictionary where values are
    data_mean: np vector with the mean of the data
    data_std: np vector with the standard deviation of the data
    dim_to_use: list of dimensions to keep in the data
    Returns
    data_out: dictionary with same keys as data, but values have been normalized
    """

    data= data[dim_to_use]
    mu = data_mean[dim_to_use]
    stddev = data_std[dim_to_use]
    data_out= np.divide( (data - mu), stddev )

    return data_out
def create_datatest(data):
    converted=[]
    for dat in data:
        convert=np.asarray(data_converter(dat))
        human36m_alpha_example=map_alpha_to_human(convert)
        normalized=normalize_single_data(human36m_alpha_example,data_mean_2d,data_std_2d,dim_to_use_2d)
        normalized=normalized.astype('float')
        converted.append(normalized)

    converted=np.asarray(converted) 
    test_loader = DataLoader(
        dataset=Human36M_testing(converted,True),
        batch_size=1024,
        shuffle=False,
        num_workers=0,
        pin_memory=True)
    return test_loader<jupyter_output><empty_output><jupyter_text>Load Model<jupyter_code>import math

model_path='../checkpoint/optuna/ckpt_best_1.pth.tar'
# create model
print(">>> creating model")
#model = LinearModel()
model = OptunaModel()
model = model.cuda()
model.apply(weight_init)
print(">>> total params: {:.2f}M".format(sum(p.numel() for p in model.parameters()) / 1000000.0))
criterion = nn.MSELoss(size_average=True).cuda()
optimizer = torch.optim.Adam(model.parameters(), lr=1.0e-3)

print(">>> loading ckpt from '{}'".format('../checkpoint/optuna/ckpt_best_1.pth.tar'))
ckpt = torch.load(model_path)
start_epoch = ckpt['epoch']
err_best = ckpt['err']
glob_step = ckpt['step']
lr_now = ckpt['lr']
model.load_state_dict(ckpt['state_dict'])
optimizer.load_state_dict(ckpt['optimizer'])
print(">>> ckpt loaded (epoch: {} | err: {})".format(start_epoch, err_best))

new_stat_3d={}
new_stat_3d['mean']=data_mean_3d
new_stat_3d['std']=data_std_3d
new_stat_3d['dim_use']=dim_to_use_3d
new_stat_3d['dim_ignore']=dim_to_ignore_3d
    
def test(test_loader, model, criterion, stat_3d, procrustes=False):
    losses = utils.AverageMeter()
    model.eval()

    all_dist = []
    pred_result=[]
    start = time.time()
    batch_time = 0
    bar = Bar('>>>', fill='>', max=len(test_loader))

    for i, inps in enumerate(test_loader):
        inputs = Variable(inps.cuda())
        
        with torch.no_grad():
            outputs = model(inputs)

        # calculate erruracy
        print(outputs.shape)
        outputs_unnorm = data_process.unNormalizeData(outputs.data.cpu().numpy(), stat_3d['mean'], stat_3d['std'], stat_3d['dim_use'])

        # remove dim ignored
        dim_use = np.hstack((np.arange(3), stat_3d['dim_use']))

        outputs_use = outputs_unnorm[:, dim_use]
        pred_result.append(outputs_unnorm)
        
        # update summary
        if (i + 1) % 100 == 0:
            batch_time = time.time() - start
            start = time.time()

        bar.suffix = '({batch}/{size}) | batch: {batchtime:.4}ms | Total: {ttl} | ETA: {eta:} | loss: {loss:.6f}' \
            .format(batch=i + 1,
                    size=len(test_loader),
                    batchtime=batch_time * 10.0,
                    ttl=bar.elapsed_td,
                    eta=bar.eta_td,
                    loss=losses.avg)
        bar.next()
    bar.finish()
    return pred_result

# Combine prediction from each batch into one prediction
def combine_prediction(pred_result_all):
    prediction_list = []
    for pred in pred_result_all:
        for pre in pred:
            prediction_list.append(pre)
    prediction_list=np.asarray(prediction_list)
    return prediction_list


def correct_3D(poses3d_input,poses2d_normalized):
    _max = 0
    _min = 10000
    poses3d=np.copy(poses3d_input)
    
    spine_x = poses2d_normalized[0][24]
    spine_y = poses2d_normalized[0][25]
            
    
    for i in range(poses3d.shape[0]):

        for j in range(32):

            tmp = poses3d[i][j * 3 + 2]
            poses3d[i][j * 3 + 2] = poses3d[i][j * 3 + 1]
            poses3d[i][j * 3 + 1] = tmp
            if poses3d[i][j * 3 + 2] > _max:
                _max = poses3d[i][j * 3 + 2]
                print("_max: ",_max)
            if poses3d[i][j * 3 + 2] < _min:
                _min = poses3d[i][j * 3 + 2]
                print("_min: ",_min)

    for i in range(poses3d.shape[0]):
        for j in range(32):
            poses3d[i][j * 3 + 2] = _max - poses3d[i][j * 3 + 2] + _min
            poses3d[i][j * 3] += (spine_x - 630)
            poses3d[i][j * 3 + 2] += (500 - spine_y)

    return poses3d

def inferencealphaposeto3D(path,fixing=False,save_npy=False):
    # Opening JSON file 
    f = open(path) 

    # returns JSON object as  
    # a dictionary 
    data = json.load(f) 


    # Closing file 
    f.close() 
    
    #Create Datatest for 2D to 3D Inference
    all_test_data=create_datatest(data)
    
    #Doing Inference
    pred_result_all=test(all_test_data, model, criterion, new_stat_3d) #All
    
    #Combine Prediction Result
    prediction_list=combine_prediction(pred_result_all)
    
    if fixing:
        #Fixing for unity
        test_2d_normalized = np.asarray(all_test_data.dataset.test_inp) 
        fixed=correct_3D(prediction_list,test_2d_normalized)
    else:
        fixed=prediction_list
    
    centroids=find_centroid(fixed)
    angles=[0,0,260]
    rotated_skeletons=rotate(centroids,fixed, angles)  
    human3d = rotated_skeletons - np.tile( rotated_skeletons[:,:3], [1, len(H36M_NAMES)] )

    if save_npy:
        base=os.path.basename(path)
        base=os.path.splitext(base)[0]

        with open('../inference_result_npy/'+base+'.npy', 'wb') as f:
            np.save(f, human3d)
    

    return human3d

import h5py

def load_cameras(bpath='cameras.h5', subjects=None):
    """
    :param bpath: *.h5
    :param subjects:
    :return: (dict)
    """

    if subjects is None:
        subjects = [1, 5, 6, 7, 8, 9, 11]
    rcams = {}

    with h5py.File(bpath, 'r') as hf:
        for s in subjects:
            for c in range(4):  # There are 4 cameras in human3.6m
                a = load_camera_params(hf, 'subject%d/camera%d/{0}' % (s, c + 1))
                rcams[(s, c + 1)] = a

    return rcams


def map3dto2dcamera( poses_set, cams, ncams=4 ):
    """
    Project 3d poses using camera parameters

    cams: dictionary with camera parameters
    ncams: number of cameras per subject

    """

    for cam in range( ncams ):
        R, T, f, c, k, p, name = cams[ (11, cam+1) ]
        pts2d, _, _, _, _ = project_point_radial( np.reshape(poses_set, [-1, 3]), R, T, f, c, k, p )

        pts2d = np.reshape( pts2d, [-1, len(H36M_NAMES)*2] )

    return pts2d

def project_point_radial(P, R, T, f, c, k, p):
    """
    Args
    P: Nx3 points in world coordinates
    R: 3x3 Camera rotation matrix
    T: 3x1 Camera translation parameters
    f: 2x1 (scalar) Camera focal length
    c: 2x1 Camera center
    k: 3x1 Camera radial distortion coefficients
    p: 2x1 Camera tangential distortion coefficients
    Returns
    Proj: Nx2 points in pixel space
    D: 1xN depth of each point in camera space
    radial: 1xN radial distortion per point
    tan: 1xN tangential distortion per point
    r2: 1xN squared radius of the projected points before distortion
    """

    # P is a matrix of 3-dimensional points
    assert len(P.shape) == 2
    assert P.shape[1] == 3

    N = P.shape[0]
    X = R.dot(P.T - T)  # rotate and translate
    XX = X[:2, :] / X[2, :]  # 2x16
    r2 = XX[0, :] ** 2 + XX[1, :] ** 2  # 16,

    radial = 1 + np.einsum('ij,ij->j', np.tile(k, (1, N)), np.array([r2, r2 ** 2, r2 ** 3]))  # 16,
    tan = p[0] * XX[1, :] + p[1] * XX[0, :]  # 16,

    tm = np.outer(np.array([p[1], p[0]]).reshape(-1), r2)  # 2x16

    XXX = XX * np.tile(radial + tan, (2, 1)) + tm  # 2x16

    Proj = (f * XXX) + c  # 2x16
    Proj = Proj.T

    D = X[2, ]

    return Proj, D, radial, tan, r2


def mapto2D(skeletons,rcams):
    """

    """
    skeleton2D=[]
    for i,skeleton in enumerate(skeletons):
        mapped=map3dto2dcamera(skeleton,rcams,4)
        skeleton2D.append(mapped)
    skeleton2D=np.asarray(skeleton2D)
    skeleton2D=skeleton2D.reshape(skeleton2D.shape[0],64)
    return skeleton2D

SUBJECT_IDS = [1,5,6,7,8,9,11]
this_file = os.path.dirname(os.path.realpath('__file__'))
rcams = cameras.load_cameras(os.path.join(this_file, "../data/h36m/metadata.xml"), SUBJECT_IDS)



def find_transformation_3D(skeleton_a,skeleton_b,fullskeleton):
    
    # remove dim ignored
    dim_use = np.hstack((np.arange(3), new_stat_3d['dim_use']))

    gt = skeleton_a[dim_use]
    out = skeleton_b[dim_use]
    gt = gt.reshape(-1, 3)
    out = out.reshape(-1, 3)
    _, Z, T, b, c = get_transformation(gt, out, True)
    transformation_value={"T":T,"b":b,"c":c}
    
    skeleton3D=[]
    for i,skeleton in enumerate(fullskeleton):
        skeleton = skeleton.reshape(-1, 3)
        skeleton = (b * skeleton.dot(T)) + c
        skeleton3D.append(skeleton)
    skeleton3D=np.asarray(skeleton3D)
    skeleton3D=skeleton3D.reshape(skeleton3D.shape[0],96)

    return  skeleton3D,transformation_value
    
def find_pair_transformation(path_1,pose_class_1,image_id_1,path_2,pose_class_2,image_id_2):
    with open(path_1, 'rb') as f:
        angle1 = json.load(f)
    with open(path_2, 'rb') as f:
        angle2 = json.load(f)
    
    angle1_temp=[]
    angle1_all=[]

    for a in angle1:
        if (a['pose_class']==pose_class_1) and (a['image_id']==image_id_1):
            angle1_temp.append(a)
    

    angle2_before=[]
    angle2_all=[]
    for a in angle2:
        if (a['pose_class']==pose_class_2) and (a['image_id']==image_id_2):
            angle2_before.append(a)
        angle2_all.append(a['visualize'])
    
    angle2_transformed_3D,transformation_value=find_transformation_3D(np.asarray(angle1_temp[0]['visualize']),
                                             np.asarray(angle2_before[0]['visualize']),
                                             np.asarray(angle2_all))
    

    return angle2_transformed_3D,transformation_value

def get_transformation(X, Y, compute_optimal_scale=True):
    muX = X.mean(0)
    muY = Y.mean(0)

    X0 = X - muX
    Y0 = Y - muY

    ssX = (X0 ** 2.).sum()
    ssY = (Y0 ** 2.).sum()

    # centred Frobenius norm
    normX = np.sqrt(ssX)
    normY = np.sqrt(ssY)

    # scale to equal (unit) norm
    X0 = X0 / normX
    Y0 = Y0 / normY

    # optimum rotation matrix of Y
    A = np.dot(X0.T, Y0)
    U, s, Vt = np.linalg.svd(A, full_matrices=False)
    V = Vt.T
    T = np.dot(V, U.T)

    # Make sure we have a rotation
    detT = np.linalg.det(T)
    V[:, -1] *= np.sign(detT)
    s[-1] *= np.sign(detT)
    T = np.dot(V, U.T)

    traceTA = s.sum()

    if compute_optimal_scale:  # Compute optimum scaling of Y.
        b = traceTA * normX / normY
        d = 1 - traceTA ** 2
        Z = normX * traceTA * np.dot(Y0, T) + muX
    else:  # If no scaling allowed
        b = 1
        d = 1 + ssY / ssX - 2 * traceTA * normY / normX
        Z = normY * np.dot(Y0, T) + muX

    c = muX - b * np.dot(muY, T)

    return d, Z, T, b, c

def save_transformation(transformed_value,output_path,path_1,pose_class_1,image_id_1,path_2,pose_class_2,image_id_2):
    base_1= os.path.splitext(os.path.basename(path_1))[0]
    base_2= os.path.splitext(os.path.basename(path_2))[0]
    transformed_value['Reference_Path']=base_1
    transformed_value['Reference_Pose_Class']=pose_class_1
    transformed_value['Reference_Image_ID']=image_id_1
    transformed_value['Transformed_Path']=base_2
    transformed_value['Transformed_Pose_Class']=pose_class_2
    transformed_value['Transformed_Image_ID']=image_id_2
    
    
    try:
        import cPickle as pickle
    except ImportError:  # Python 3.x
        import pickle
        
    with open(output_path, 'wb') as fp:
        pickle.dump(transformed_value, fp, protocol=pickle.HIGHEST_PROTOCOL)

def save_to_json(result_3D, input_path, output_path):
    f = open(input_path) 
    dim_use = np.hstack((np.arange(3), dim_to_use_3d))

    # returns JSON object as  
    # a dictionary 
    data = json.load(f) 
    
    for a,b in zip(data,result_3D):
        a['keypoints']=b[dim_use].tolist()
        a['visualize']=b.tolist()
        
    with open(output_path, 'w') as fp:
        fp.write(json.dumps(data))
    
def save_to_json_2D(result_2D, input_path, output_path):
    f = open(input_path) 

    # returns JSON object as  
    # a dictionary 
    data = json.load(f) 
    
    a=dim_to_use_2d.tolist()
    a.insert(18,28)
    a.insert(19,29)
    dim_to_use_2d_nose=np.asarray(a)

    for a,b in zip(data,result_2D):
        a['keypoints']=b[dim_to_use_2d_nose].tolist()
        
    with open(output_path, 'w') as fp:
        fp.write(json.dumps(data))<jupyter_output>>>> creating model
>>> total params: 10.60M
>>> loading ckpt from '../checkpoint/optuna/ckpt_best_1.pth.tar'
>>> ckpt loaded (epoch: 29 | err: 40.643307541837174)<jupyter_text>Inference to json to three kinds:1. Original 3D Baseline2. 3D After doing proscrutes to another angle3. 2D Mapping after doing proscrutes to another angle4. Eucledian normalization of 2D Mapping after doing proscrutes  Original 3D Baseline<jupyter_code>path='../json_test/cam8.json'
base= os.path.splitext(os.path.basename(path))[0]

%%time
inference_result=inferencealphaposeto3D(path,fixing=False,save_npy=True)

output_path='../inference_result_npy/'+base+'_3D_Original.json'
save_to_json(inference_result, path, output_path)<jupyter_output><empty_output><jupyter_text>Original 2D Human3.6m This will save alpha pose in human3.6m format that have nose inside<jupyter_code>output_path='../inference_result_npy/'+base+'_2D_Original.json'
mapping_result=map_alpha_to_human_classification_json(path)
save_to_json_2D(mapping_result, path, output_path)<jupyter_output><empty_output><jupyter_text>2D Map from Original 3DHuman3.6m<jupyter_code>skeleton2d_original=mapto2D(inference_result,rcams)

output_path='../inference_result_npy/'+base+'_2D_from3DOriginal.json'
save_to_json_2D(skeleton2d_original, path, output_path)<jupyter_output><empty_output><jupyter_text>3D After doing proscrutes to another angle<jupyter_code>#Reference
path_1='../inference_result_npy/cam7_3D_Original.json'
pose_class_1="Standing"
image_id_1= '00076.jpg'

#Want to transform
path_2='../inference_result_npy/cam8_3D_Original.json'
pose_class_2="Standing"
image_id_2= '00076.jpg'

base_1= os.path.splitext(os.path.basename(path_1))[0]
base_2= os.path.splitext(os.path.basename(path_2))[0]

# Save transformation only

transformed1,transformation_value1=find_pair_transformation(path_1,pose_class_1,image_id_1,path_2,pose_class_2,image_id_2)
output_path='../inference_result_npy/'+base_2+" to "+base_1+'_transformationvalue.pickle'
save_transformation(transformation_value1, output_path,path_1,pose_class_1,image_id_1,path_2,pose_class_2,image_id_2)
# Save Full Skeleton

output_path='../inference_result_npy/'+base_2+" to "+base_1+'_proscrustes.json'
save_to_json(transformed1, path, output_path)
# Save transformation for augmented 

transformed2,transformation_value2=find_pair_transformation(path_2,pose_class_2,image_id_2,path_1,pose_class_1,image_id_1)
output_path='../inference_result_npy/'+base_1+" to "+base_2+'_transformationvalue_augmentdataset.pickle'
save_transformation(transformation_value2, output_path,path_2,pose_class_2,image_id_2,path_1,pose_class_1,image_id_1)
# Save Full Skeleton

output_path='../inference_result_npy/'+base_1+" to "+base_2+'_proscrustes.json'
save_to_json(transformed2, path, output_path)<jupyter_output><empty_output><jupyter_text>2D Mapping after doing proscrutes to another angle<jupyter_code>%%time
skeleton2d=mapto2D(transformed,rcams)

output_path='../inference_result_npy/'+base+'_2D_Proscrutes.json'
save_to_json_2D(skeleton2d, path, output_path)<jupyter_output><empty_output><jupyter_text>Normalize using Eucledian Distances<jupyter_code>index_human36m={
    # Use 16 skeleton point
    "Pelvis": 0,
    "Head": 15,
    "Thorax":13,
    "RShoulder": 25,
    "RElbow": 26,
    "RWrist": 27,
    "LShoulder": 17,
    "LElbow": 18,
    "LWrist": 19,
    "RHip": 1,
    "RKnee": 2,
    "RAnkle": 3,
    "LHip": 6,
    "LKnee": 7,
    "LAnkle": 8,
    "Spine" : 12
}

def euclidean_dist(a, b):
    # This function calculates the euclidean distance between 2 point in 2-D coordinates
    # if one of two points is (0,0), dist = 0
    # a, b: input array with dimension: m, 2
    # m: number of samples
    # 2: x and y coordinate
    try:
        if (a.shape[1] == 2 and a.shape == b.shape):
            # check if element of a and b is (0,0)
            bol_a = (a[:,0] != 0).astype(int)
            bol_b = (b[:,0] != 0).astype(int)
            dist = np.linalg.norm(a-b, axis=1)
            return((dist*bol_a*bol_b).reshape(a.shape[0],1))
    except:
        print("[Error]: Check dimension of input vector")
        return 0


def norm_human36m(X):
    num_sample = X.shape[0]
    # Keypoints
    Pelvis = X[:,index_human36m['Pelvis']*2:index_human36m['Pelvis']*2+2]
    Head = X[:,index_human36m['Head']*2:index_human36m['Head']*2+2]
    Thorax = X[:,index_human36m['Thorax']*2:index_human36m['Thorax']*2+2]
    RShoulder = X[:,index_human36m['RShoulder']*2:index_human36m['RShoulder']*2+2]
    RElbow = X[:,index_human36m['RElbow']*2:index_human36m['RElbow']*2+2]
    RWrist = X[:,index_human36m['RWrist']*2:index_human36m['RWrist']*2+2]
    LShoulder = X[:,index_human36m['LShoulder']*2:index_human36m['LShoulder']*2+2]
    LElbow = X[:,index_human36m['LElbow']*2:index_human36m['LElbow']*2+2]
    LWrist = X[:,index_human36m['LWrist']*2:index_human36m['LWrist']*2+2]
    RHip = X[:,index_human36m['RHip']*2:index_human36m['RHip']*2+2]
    RKnee = X[:,index_human36m['RKnee']*2:index_human36m['RKnee']*2+2]
    RAnkle = X[:,index_human36m['RAnkle']*2:index_human36m['RAnkle']*2+2]
    LHip = X[:,index_human36m['LHip']*2:index_human36m['LHip']*2+2]
    LKnee = X[:,index_human36m['LKnee']*2:index_human36m['LKnee']*2+2]
    LAnkle = X[:,index_human36m['LAnkle']*2:index_human36m['LAnkle']*2+2]


    # Length of head
    length_Head_Thorax = euclidean_dist(Head, Thorax)
    length_head      = np.maximum.reduce([length_Head_Thorax])

    # Length of torso
    length_Thorax_LHip = euclidean_dist(Thorax, LHip)
    length_Thorax_RHip = euclidean_dist(Thorax, RHip)
    length_torso     = np.maximum(length_Thorax_LHip, length_Thorax_RHip)

    # Length of right leg
    length_leg_right = euclidean_dist(RHip, RKnee) + euclidean_dist(RKnee, RAnkle)
  
    # Length of left leg
    length_leg_left = euclidean_dist(LHip, LKnee) + euclidean_dist(LKnee, LAnkle)


    # Length of leg
    length_leg = np.maximum(length_leg_right, length_leg_left)

    # Length of body
    length_body = length_head + length_torso + length_leg
    
    # Check all samples have length_body of 0
    length_chk = (length_body > 0).astype(int)
    
    # Check keypoints at origin
    keypoints_chk = (X > 0).astype(int)
    
    chk = length_chk * keypoints_chk
    
    # Set all length_body of 0 to 1 (to avoid division by 0)
    length_body[length_body == 0] = 1
    
    # The center of gravity
    num_pts = (X[:, 0::2] > 0).sum(1).reshape(num_sample,1)

    centr_x = X[:, 0::2].sum(1).reshape(num_sample,1) / num_pts
    centr_y = X[:, 1::2].sum(1).reshape(num_sample,1) / num_pts

    # The  coordinates  are  normalized relative to the length of the body and the center of gravity
    X_norm_x = (X[:, 0::2] - centr_x) / length_body
    X_norm_y = (X[:, 1::2] - centr_y) / length_body
    
    # Stack 1st element x and y together
    X_norm = np.column_stack((X_norm_x[:,:1], X_norm_y[:,:1]))
        
    for i in range(1, X.shape[1]//2):
        X_norm = np.column_stack((X_norm, X_norm_x[:,i:i+1], X_norm_y[:,i:i+1]))
    
    # Set all samples have length_body of 0 to origin (0, 0)
    X_norm = X_norm * chk
    
    return X_norm

def euclidean_dist_3D(a, b):

    try:
        if (a.shape[1] == 3 and a.shape == b.shape):
            # check if element of a and b is (0,0)
            bol_a = (a[:,0] != 0).astype(int)
            bol_b = (b[:,0] != 0).astype(int)
            dist = np.linalg.norm(a-b, axis=1)
            return((dist*bol_a*bol_b).reshape(a.shape[0],1))
    except:
        print("[Error]: Check dimension of input vector")
        return 0


def norm_human36m_3D(X):
    num_sample = X.shape[0]
    # Keypoints
    Pelvis = X[:,index_human36m['Pelvis']*3:index_human36m['Pelvis']*3+3]
    Head = X[:,index_human36m['Head']*3:index_human36m['Head']*3+3]
    Thorax = X[:,index_human36m['Thorax']*3:index_human36m['Thorax']*3+3]
    RShoulder = X[:,index_human36m['RShoulder']*3:index_human36m['RShoulder']*3+3]
    RElbow = X[:,index_human36m['RElbow']*3:index_human36m['RElbow']*3+3]
    RWrist = X[:,index_human36m['RWrist']*3:index_human36m['RWrist']*3+3]
    LShoulder = X[:,index_human36m['LShoulder']*3:index_human36m['LShoulder']*3+3]
    LElbow = X[:,index_human36m['LElbow']*3:index_human36m['LElbow']*3+3]
    LWrist = X[:,index_human36m['LWrist']*3:index_human36m['LWrist']*3+3]
    RHip = X[:,index_human36m['RHip']*3:index_human36m['RHip']*3+3]
    RKnee = X[:,index_human36m['RKnee']*3:index_human36m['RKnee']*3+3]
    RAnkle = X[:,index_human36m['RAnkle']*3:index_human36m['RAnkle']*3+3]
    LHip = X[:,index_human36m['LHip']*3:index_human36m['LHip']*3+3]
    LKnee = X[:,index_human36m['LKnee']*3:index_human36m['LKnee']*3+3]
    LAnkle = X[:,index_human36m['LAnkle']*3:index_human36m['LAnkle']*3+3]


    # Length of head
    length_Head_Thorax = euclidean_dist_3D(Head, Thorax)
    length_head      = np.maximum.reduce([length_Head_Thorax])

    # Length of torso
    length_Thorax_LHip = euclidean_dist_3D(Thorax, LHip)
    length_Thorax_RHip = euclidean_dist_3D(Thorax, RHip)
    length_torso     = np.maximum(length_Thorax_LHip, length_Thorax_RHip)

    # Length of right leg
    length_leg_right = euclidean_dist_3D(RHip, RKnee) + euclidean_dist_3D(RKnee, RAnkle)
  
    # Length of left leg
    length_leg_left = euclidean_dist_3D(LHip, LKnee) + euclidean_dist_3D(LKnee, LAnkle)


    # Length of leg
    length_leg = np.maximum(length_leg_right, length_leg_left)

    # Length of body
    length_body = length_head + length_torso + length_leg
    
    # Check all samples have length_body of 0
    length_chk = (length_body > 0).astype(int)
    
    # Check keypoints at origin
    keypoints_chk = (X > 0).astype(int)
    
    chk = length_chk * keypoints_chk
    
    # Set all length_body of 0 to 1 (to avoid division by 0)
    length_body[length_body == 0] = 1
    
    # The center of gravity
    num_pts = np.full((num_sample, 1), 32)
    print(num_pts)
    centr_x = X[:, 0::3].sum(1).reshape(num_sample,1) / num_pts
    centr_y = X[:, 1::3].sum(1).reshape(num_sample,1) / num_pts
    centr_z = X[:, 2::3].sum(1).reshape(num_sample,1) / num_pts

    # The  coordinates  are  normalized relative to the length of the body and the center of gravity
    X_norm_x = (X[:, 0::3] - centr_x) / length_body
    X_norm_y = (X[:, 1::3] - centr_y) / length_body
    X_norm_z = (X[:, 2::3] - centr_z) / length_body

    # Stack 1st element x and y together
    X_norm = np.column_stack((X_norm_x[:,:1], X_norm_y[:,:1], X_norm_z[:,:1]))
        
    for i in range(1, X.shape[1]//3):
        X_norm = np.column_stack((X_norm, X_norm_x[:,i:i+1], X_norm_y[:,i:i+1], X_norm_z[:,i:i+1]))
    
    # Set all samples have length_body of 0 to origin (0, 0)
    X_norm = X_norm * chk
    
    return X_norm
%%time
normalized_eucledianhuman36m=norm_human36m(skeleton2d)
normalized_eucledianhuman36m.shape
output_path='../inference_result_npy/'+base+'_2D_Proscrutes_Normalized.json'
save_to_json_2D(normalized_eucledianhuman36m, path, output_path)<jupyter_output><empty_output><jupyter_text>Inference Code (Convert only 1 Skeleton)  2D to 3D<jupyter_code>def inferencealphaposeto3d_one(alpha2d, input_type="json"):
    converted = []
    # human2d=alpha2d.copy()
    # human3d=alpha2d.copy()

    if (input_type == "json"):
        convert = np.asarray(data_converter(alpha2d))
    else:
        convert = alpha2d

    a = dim_to_use_2d.tolist()
    a.insert(18, 28)
    a.insert(19, 29)
    dim_to_use_2d_nose = np.asarray(a)

    human36m_output = map_alpha_to_human_classification(convert)
    human36m_output = human36m_output.astype('float')
    human2d = human36m_output[dim_to_use_2d_nose]

    human36m_alpha_example = map_alpha_to_human(convert)
    normalized = normalize_single_data(human36m_alpha_example, data_mean_2d, data_std_2d, dim_to_use_2d)
    normalized = normalized.astype('float')
    converted.append(normalized)
    converted = np.asarray(converted)

    test_loader = DataLoader(
        dataset=Human36M_testing(converted, True),
        batch_size=1,
        shuffle=False,
        num_workers=0,
        pin_memory=True)

    #Doing Inference
    pred_result_all=test(test_loader, model, criterion, new_stat_3d) #All
    dim_use = np.hstack((np.arange(3), dim_to_use_3d))
    prediction=pred_result_all[0][0][dim_use]
    centroids = find_centroid_single(prediction)
    angles = [0, 0, 260]
    human3d = rotate_single(centroids, prediction, angles)
    
    human3d=human3d-np.tile(human3d[:3],[17])

    return human3d, human2d

def mapalphaposetohuman_one(alpha2d,input_type="json"):
    
    # Input type should be in json format
    if (input_type=="json"):
        convert=np.asarray(data_converter(alpha2d))
        skeletonhuman=alpha2d.copy()
        
    # Input type should be in array has shape (34,)
    elif (input_type=="array"):
        convert=alpha2d
     
    a=dim_to_use_2d.tolist()
    a.insert(18,28)
    a.insert(19,29)
    dim_to_use_2d_nose=np.asarray(a)
    
    human36m_alpha=map_alpha_to_human_classification(convert)
    human36m_alpha=human36m_alpha.astype('float')

    if (input_type=="json"):
        skeletonhuman['keypoints']=human36m_alpha[dim_to_use_2d_nose].tolist()
    elif (input_type=="array"):
        skeletonhuman=human36m_alpha[dim_to_use_2d_nose]
        
    return skeletonhuman
        

      
def find_centroid_single(skeletons):
    skeleton_test=skeletons.reshape(int(51/3),3)
    centroid=np.mean(skeleton_test, axis=0)
    return centroid

def rotate_single(origin, skeletons, angle):
    """
    Rotate a point counterclockwise by a given angle around a given origin.

    The angle should be given in radians.
    """
    joints = []
    skeleton_test=skeletons.reshape(int(51/3),3)
    angle_xy,angle_xz,angle_yz=math.radians(angle[0]),math.radians(angle[1]),math.radians(angle[2])

    for j,join in enumerate(skeleton_test):
        ox, oy,oz = origin[0],origin[1],origin[2]
        px, py,pz = join[0],join[1],join[2]

        #Rotation XY
        qx = ox + math.cos(angle_xy) * (px - ox) - math.sin(angle_xy) * (py - oy)
        qy = oy + math.sin(angle_xy) * (px - ox) + math.cos(angle_xy) * (py - oy)
        px, py,pz=qx,qy,pz

        #Rotation XZ
        qx = ox + math.cos(angle_xz) * (px - ox) - math.sin(angle_xz) * (pz - oz)
        qz = oz + math.sin(angle_xz) * (px - ox) + math.cos(angle_xz) * (pz - oz)
        px, py,pz=qx,py,qz

        #Rotation YZ
        qy = oy + math.cos(angle_yz) * (py - oy) - math.sin(angle_yz) * (pz - oz)
        qz = oz + math.sin(angle_yz) * (py - oy) + math.cos(angle_yz) * (pz - oz)
        px, py,pz=px,qy,qz

        joints.append(px)
        joints.append(py)
        joints.append(pz)

    rotated=np.asarray(joints)
    return rotated  

path='../json_test/taoyuan_angle2.json'
f = open(path) 
data = json.load(f) 
# input_to=np.asarray(data_converter(data[0]))

# How to use function
# output_3d=inferencealphaposeto3d_one(data[0])
# output_2d=mapalphaposetohuman_one(data[0])

pose2d_size = 34
pose3d_size= 51    
_pose =data_converter(data[0])
_pose=np.asarray(_pose).reshape(pose2d_size,)
human3d,human2d = inferencealphaposeto3d_one(_pose, input_type="array")

# Output is array of 3D Pose baseline with shape (51,)
human3d<jupyter_output><empty_output><jupyter_text>Transformation<jupyter_code>trans_path='../inference_result_npy/taoyuan_angle2_3D_Original to taoyuan_angle1_3D_Original_transformationvalue.pickle'

with open(trans_path, 'rb') as fp:
    trans = pickle.load(fp)
def map3dto2dcamera_single( poses_set, cams, ncams=4 ):
    """
    Project 3d poses using camera parameters

    cams: dictionary with camera parameters
    ncams: number of cameras per subject

    """

    for cam in range( ncams ):
        R, T, f, c, k, p, name = cams[ (11, cam+1) ]
        pts2d, _, _, _, _ = project_point_radial( np.reshape(poses_set, [-1, 3]), R, T, f, c, k, p )

        pts2d = np.reshape( pts2d, [17*2] )

    return pts2d


def find_transformation_single(trans,skeleton3d):
    
    T=trans['T']
    b=trans['b']
    c=trans['c']
    
    skeleton3d = skeleton3d.reshape(-1, 3)
    skeleton3d = (b * skeleton3d.dot(T)) + c
    skeleton3d=skeleton3d.reshape(51,)
    
    #Recenter the skeleton and put hip to coordinate 0,0,0
    poses3d=skeleton3d-np.tile(skeleton3d[:3],[17])
    poses2d=map3dto2dcamera_single(poses3d,rcams,4)
    
    return  poses3d,poses2d
human3d_trans,human2d_trans=find_transformation_single(trans,human3d)
human3d_trans.shape
human2d_trans.shape<jupyter_output><empty_output><jupyter_text>Dataset Augmentation using 3D Transformation<jupyter_code>def combine_allTransform(path):
    trans_file=sorted(glob.glob(path+"/*.pickle"))
    all_transf={}
    index=0
    for file in trans_file:
        with open(file, 'rb') as f:
            transformation_value = pickle.load(f)
        all_transf[index]=transformation_value
        index=index+1
    return all_transf

def augment_usingtransvalue(transvalue,skeleton_b):
     # remove dim ignored
    dim_use = np.hstack((np.arange(3), new_stat_3d['dim_use']))


    new_transformed=[]
    index_=0
    new_transformed.append(skeleton_b.reshape(-1, 3))
    for key in transvalue:
        transformation_value=transvalue[key]
        T = transformation_value['T']
        b = transformation_value['b']
        c = transformation_value['c']

        skeleton_b = skeleton_b.reshape(-1, 3)
        transformed = (b * skeleton_b.dot(T)) + c
        transformed = skeleton_b.dot(T)
        new_transformed.append(transformed)
        index_=index_+1
        
            
    try:
        skeleton3D=np.asarray(new_transformed)
        skeleton3D=skeleton3D.reshape(skeleton3D.shape[0],96)
        #Recenter the hip after transformation
        poses=skeleton3D-np.tile(skeleton3D[:,:3],[1,32])
    except:
        skeleton3D=np.asarray(new_transformed)
        skeleton3D=skeleton3D.reshape(skeleton3D.shape[0],51)
        #Recenter the hip after transformation
        poses=skeleton3D-np.tile(skeleton3D[:,:3],[1,17])

    return  poses

def augment_jsonfile(json_path,transf_folder_path):
    all_transf=combine_allTransform(transf_folder_path)
    
    with open(json_path, 'rb') as f:
        angle1 = json.load(f)
        
    new_augmented=[]
    for skeleton in angle1:
        tmp_dict=skeleton.copy()
        augmented=augment_usingtransvalue(all_transf,np.asarray(skeleton['keypoints']).reshape(1,51))
        augmented_2=augment_usingtransvalue(all_transf,np.asarray(skeleton['visualize']).reshape(1,96))

        for augmented_skeleton,augmented_viz in zip(augmented,augmented_2):
            tmp_dict['keypoints']=augmented_skeleton.tolist()
            tmp_dict['visualize']=augmented_viz.tolist()
            new_augmented.append(tmp_dict)
            
    
    return new_augmented


json_path='../inference_result_npy/taoyuan_angle1_3D_Original.json'
transf_folder_path="../augmented_transformation"

new_augmented=augment_jsonfile(json_path,transf_folder_path)

filename= os.path.splitext(os.path.basename(json_path))[0]+"_augmented.json"
json_path_augmented=os.path.dirname(json_path)+"/"+filename

with open(json_path_augmented, 'w') as fp:
    fp.write(json.dumps(new_augmented))<jupyter_output><empty_output><jupyter_text>Map the augmented dataset to 2D<jupyter_code>base= os.path.splitext(os.path.basename(json_path_augmented))[0]
with open(json_path_augmented, 'rb') as f:
    angle1 = json.load(f)
keypoint=[]
count=0
for a in angle1:
    keypoint.append(a['visualize'])
    count=count+1
keypoint=np.asarray(keypoint)
skeleton2d_original=mapto2D(keypoint,rcams)
output_path='../inference_result_npy/'+base+'_2D_from3DOriginal.json'
save_to_json_2D(skeleton2d_original, json_path_augmented, output_path)
with open(output_path, 'rb') as f:
    angle2d = json.load(f)
len(angle2d)<jupyter_output><empty_output><jupyter_text>Don't run (just experiment and random code) !<jupyter_code>unique_class=set([])
for a in new:
    unique_class.add(a['pose_class'])
    
unique_class
import json
f = open("../../../Falling Dataset/Thesis Experiment/data/taoyuan.json") 

# returns JSON object as  
# a dictionary 
data = json.load(f) 
taoyuan_angle1=[]
taoyuan_angle2=[]

for a in data:
    if ((a['pose_class']=="FallingDown_01") or (a['pose_class']=="Standing_01")):
        taoyuan_angle1.append(a)
    else:
        taoyuan_angle2.append(a)

with open("../../../Falling Dataset/Thesis Experiment/data/taoyuan_angle1.json", 'w') as fp:
    fp.write(json.dumps(taoyuan_angle1))
with open("../../../Falling Dataset/Thesis Experiment/data/taoyuan_angle2.json", 'w') as fp:
    fp.write(json.dumps(taoyuan_angle2))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13855421686746988, 'fraction_numerical': 0.0358599753344085, 'mean_word_length': 3.50866124893071, 'pattern_counts': {'":': 69, '<': 57, '<?xml version=': 0, '>': 91, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '14', 'dir': 'jupyter-structured-clean-dedup', 'id': '198096', 'license': 'MIT', 'n_tokens_mistral': 17417, 'n_tokens_neox': 16472, 'n_words': 2861, 'path': 'src/Full Pipeline 2D to 3D npy from Alpha Pose.ipynb', 'repo_name': 'alexivaner/3d_pose_baseline_pytorch_Alpha_Pose', 'size': '42164'}