rlightning.humanoid.loader.base

class rlightning.humanoid.loader.base.LoaderCfg(**data: Any)[source]

Bases: Config

data_format: Literal['.bvh', '.npz'] = '.npz'

Indicating the acceptable file format

data_path: str = ''
formatter: FormatterCfg = <rlightning.humanoid.formatter.base.Formatter.FormatterCfg object>
motion_cls: str = ''
overwrite: bool = False

When overwrite is True, the loader ignores existing files

retargeter: RetargeterCfg = <rlightning.humanoid.retarget.base.Retargeter.RetargeterCfg object>
class rlightning.humanoid.loader.base.Mode(value)[source]

Bases: Enum

dir = 1
file = 0
class rlightning.humanoid.loader.base.MotionLoader(config: LoaderCfg)[source]

Bases: object

config: LoaderCfg
property files: List[str]

The list of motion file paths.

formatter_cls

alias of Formatter

load(data_path: str = None)[source]

Load raw motions from a given file/directory.

Parameters:

data_path (str) – File or directory path.

property num_motions: int

The amount of motions

prepare(data_path: str = None)[source]

Prepare retargeted motions

Parameters:

data_path (str, optional) – Raw motion path, chould be a directory. Defaults to None.

retarget(num_workers: int = None)[source]

Execute retargeting in multi-process.

If there are existing files and overwrite is set to True, we jump it.

Parameters:

num_workers (int, optional) – The parallel worker nums. Defaults to None.

retarget_single(target_path: str, frames: Sequence[Dict[str, Any]], extras: Dict[str, Any])[source]
retargeter_cls

alias of Retargeter

property retargted_motion_files: Sequence[Any]
sample(n: int = 1) List[Motion][source]

Random sample a motion