body-pose-animation/optimizer.py
2021-01-15 22:47:15 +01:00

15 lines
334 B
Python

import torch
import torch.nn as nn
class CameraLoss(nn.Module):
def __init__(self):
print("CameraLoss init")
def forward(self, keypoints, joints, transform):
# simple stupid implementation
# compute 2d distance between model and openpose joints
# ignoring Z axis
joints * transform