| 2044 | |
| 2045 | |
| 2046 | class FLAMELayer(FLAME): |
| 2047 | def __init__(self, *args, **kwargs) -> None: |
| 2048 | """FLAME as a layer model constructor.""" |
| 2049 | super(FLAMELayer, self).__init__(create_betas=False, |
| 2050 | create_expression=False, |
| 2051 | create_global_orient=False, |
| 2052 | create_neck_pose=False, |
| 2053 | create_jaw_pose=False, |
| 2054 | create_leye_pose=False, |
| 2055 | create_reye_pose=False, |
| 2056 | *args, |
| 2057 | **kwargs) |
| 2058 | |
| 2059 | def forward(self, |
| 2060 | betas: Optional[Tensor] = None, |
| 2061 | global_orient: Optional[Tensor] = None, |
| 2062 | neck_pose: Optional[Tensor] = None, |
| 2063 | transl: Optional[Tensor] = None, |
| 2064 | expression: Optional[Tensor] = None, |
| 2065 | jaw_pose: Optional[Tensor] = None, |
| 2066 | leye_pose: Optional[Tensor] = None, |
| 2067 | reye_pose: Optional[Tensor] = None, |
| 2068 | return_verts: bool = True, |
| 2069 | return_full_pose: bool = False, |
| 2070 | pose2rot: bool = True, |
| 2071 | **kwargs) -> FLAMEOutput: |
| 2072 | """Forward pass for the SMPLX model. |
| 2073 | |
| 2074 | Parameters |
| 2075 | ---------- |
| 2076 | global_orient: torch.tensor, optional, shape Bx3 |
| 2077 | If given, ignore the member variable and use it as the global |
| 2078 | rotation of the body. Useful if someone wishes to predicts this |
| 2079 | with an external model. (default=None) |
| 2080 | betas: torch.tensor, optional, shape Bx10 |
| 2081 | If given, ignore the member variable `betas` and use it |
| 2082 | instead. For example, it can used if shape parameters |
| 2083 | `betas` are predicted from some external model. |
| 2084 | (default=None) |
| 2085 | expression: torch.tensor, optional, shape Bx10 |
| 2086 | If given, ignore the member variable `expression` and use it |
| 2087 | instead. For example, it can used if expression parameters |
| 2088 | `expression` are predicted from some external model. |
| 2089 | jaw_pose: torch.tensor, optional, shape Bx3 |
| 2090 | If given, ignore the member variable `jaw_pose` and |
| 2091 | use this instead. It should either joint rotations in |
| 2092 | axis-angle format. |
| 2093 | jaw_pose: torch.tensor, optional, shape Bx3 |
| 2094 | If given, ignore the member variable `jaw_pose` and |
| 2095 | use this instead. It should either joint rotations in |
| 2096 | axis-angle format. |
| 2097 | transl: torch.tensor, optional, shape Bx3 |
| 2098 | If given, ignore the member variable `transl` and use it |
| 2099 | instead. For example, it can used if the translation |
| 2100 | `transl` is predicted from some external model. |
| 2101 | (default=None) |
| 2102 | return_verts: bool, optional |
| 2103 | Return the vertices. (default=True) |