BladeSzaSza's picture
Upload folder using huggingface_hub
3d348c4 verified
Raw
History Blame Contribute Delete
898 Bytes
from abc import ABC, abstractmethod
from typing import Union
from ..motion import MotionClip
PersonSelector = Union[str, int]
class PoseBackend(ABC):
"""MotionBackend kind: video -> MotionClip (own skeleton); goes through resample+retarget+bake."""
name: str
kind: str = "motion"
@abstractmethod
def infer(self, video_path: str, fps=None, person: PersonSelector = "auto") -> MotionClip: ...
class DirectRetargetBackend(ABC):
"""Direct kind: (video, target rig + reference frame) -> rotations already on the target skeleton.
Returns a retarget.TargetAnimation; the pipeline sends it straight to bake (no MotionClip)."""
name: str
kind: str = "direct"
@abstractmethod
def infer(self, video_path: str, target_rig_glb: str, reference_frame=None,
fps=None, person: PersonSelector = "auto"): # -> retarget.retarget.TargetAnimation
...