feat(新功能): pose transform 部署
fix(修复bug): docs(文档变更): refactor(重构): test(增加测试):
This commit is contained in:
@@ -52,9 +52,10 @@ def upload_video(frames, user_id, category, file_name):
|
||||
try:
|
||||
object_name = f'{user_id}/{category}/{file_name}'
|
||||
# 创建视频写入器
|
||||
fps = 24 # 帧率
|
||||
fourcc = cv2.VideoWriter_fourcc(*'mp4v')
|
||||
video_writer = cv2.VideoWriter(file_name, fourcc, fps, (768, 512))
|
||||
fps = 1 # 帧率
|
||||
|
||||
fourcc = cv2.VideoWriter.fourcc(*'mp4v')
|
||||
video_writer = cv2.VideoWriter(file_name, fourcc, fps, (512, 768))
|
||||
|
||||
# 逐帧写入
|
||||
for frame in frames:
|
||||
@@ -67,6 +68,7 @@ def upload_video(frames, user_id, category, file_name):
|
||||
file_name,
|
||||
content_type="video/mp4" # 指定MIME类型确保可在线播放[9](@ref)
|
||||
)
|
||||
print(file_name)
|
||||
return f"aida-users/{object_name}"
|
||||
|
||||
# # 生成内存中的视频字节流
|
||||
@@ -92,5 +94,5 @@ def upload_video(frames, user_id, category, file_name):
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
images = np.random.randint(0, 256, size=(4, 512, 512, 3), dtype=np.uint8)
|
||||
print(upload_video(images, user_id=89, category='test', file_name="1.mp4"))
|
||||
images = np.random.randint(0, 256, size=(10, 768, 512, 3), dtype=np.uint8)
|
||||
print(upload_video(images, user_id=89, category='test', file_name="1123123.mp4"))
|
||||
|
||||
Reference in New Issue
Block a user