流式传输

This commit is contained in:
yinsx
2025-12-25 15:36:35 +08:00
parent e56f47076c
commit 14bfdcbf51
19 changed files with 1191 additions and 65 deletions

View File

@ -17,9 +17,11 @@ class BlendShapeParser:
@staticmethod
def csv_to_blend_shapes(csv_path: str):
frames = []
return list(BlendShapeParser.iter_csv_to_blend_shapes(csv_path))
@staticmethod
def iter_csv_to_blend_shapes(csv_path: str):
with open(csv_path, 'r') as f:
reader = csv.DictReader(f)
for row in reader:
frame = {'timeCode': float(row['timeCode']), 'blendShapes': {}}
@ -27,5 +29,4 @@ class BlendShapeParser:
col_name = f'blendShapes.{key}'
if col_name in row:
frame['blendShapes'][key] = float(row[col_name])
frames.append(frame)
return frames
yield frame