コード例 #1
0
ファイル: supervision.py プロジェクト: jimbozhang/lhotse
 def to_dict(self) -> dict:
     """
     We use the recursive conversion only if alignments are present, since it may
     potentially be slower due to type checking of member objects.
     """
     return asdict_nonull(
         self) if self.alignment is None else asdict_nonull_recursive(self)
コード例 #2
0
 def to_dict(self) -> dict:
     return asdict_nonull(self)
コード例 #3
0
 def to_dicts(self) -> List[dict]:
     return [asdict_nonull(s) for s in self]
コード例 #4
0
 def to_yaml(self, path: Pathlike):
     data = [asdict_nonull(s) for s in self]
     save_to_yaml(data, path)
コード例 #5
0
ファイル: cut.py プロジェクト: popcornell/lhotse
 def to_yaml(self, path: Pathlike):
     data = [{
         **asdict_nonull(cut), 'type': type(cut).__name__
     } for cut in self]
     save_to_yaml(data, path)
コード例 #6
0
 def to_dict(self) -> Dict[str, Any]:
     return asdict_nonull(self)