代码拉取完成,页面将自动刷新
同步操作将从 jjj1112/Behavioral_Cloning 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
from moviepy.editor import ImageSequenceClip
import argparse
import os
IMAGE_EXT = ['jpeg', 'gif', 'png', 'jpg']
def main():
parser = argparse.ArgumentParser(description='Create driving video.')
parser.add_argument(
'image_folder',
type=str,
default='',
help='Path to image folder. The video will be created from these images.'
)
parser.add_argument(
'--fps',
type=int,
default=60,
help='FPS (Frames per second) setting for the video.')
args = parser.parse_args()
#convert file folder into list firltered for image file types
image_list = sorted([os.path.join(args.image_folder, image_file)
for image_file in os.listdir(args.image_folder)])
image_list = [image_file for image_file in image_list if os.path.splitext(image_file)[1][1:].lower() in IMAGE_EXT]
#two methods of naming output video to handle varying environemnts
video_file_1 = args.image_folder + '.mp4'
video_file_2 = args.image_folder + 'output_video.mp4'
print("Creating video {}, FPS={}".format(args.image_folder, args.fps))
clip = ImageSequenceClip(image_list, fps=args.fps)
try:
clip.write_videofile(video_file_1)
except:
clip.write_videofile(video_file_2)
if __name__ == '__main__':
main()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。