Exemplo n.º 1
0
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.')
    parser.add_argument('--processed',
                        action='store_true',
                        help='Transform the image back to the model space.')
    args = parser.parse_args()

    video_file = args.image_folder + '.mp4'
    print("Creating video {}, FPS={}".format(video_file, args.fps))
    clip = ImageSequenceClip(args.image_folder, fps=args.fps)

    if args.processed:

        def tmp(im):
            processed = utils.process_image(im)
            processed = cv2.cvtColor(processed, color_space['src'])
            return np.hstack((im, processed))

        clip = clip.fl_image(tmp)

    clip.write_videofile(video_file)
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()

    video_file = args.image_folder + '.mp4'
    print("Creating video {}, FPS={}".format(video_file, args.fps))

    clip = ImageSequenceClip(args.image_folder, fps=args.fps)

    # Show preprocessing effects
    video_processor = model.VideoProcessor()
    clip = clip.fl_image(video_processor.process_frame)

    clip.write_videofile(video_file)
Exemplo n.º 3
0
def main(argv):
	if os.path.exists(OUTPUT_DIR):
		shutil.rmtree(OUTPUT_DIR)
	os.makedirs(OUTPUT_DIR)

	clip = ImageSequenceClip(data.images, fps=60)
	new_clip = clip.fl_image(process_image)
	new_clip.write_videofile(VIDEO_OUTPUT, audio=False)
Exemplo n.º 4
0
#  

# In[ ]:


# Import everything needed to edit/save/watch video clips
from moviepy.editor import VideoFileClip
from moviepy.editor import ImageSequenceClip


# Define pathname to save the output video
output = '../output/test_mapping.mp4'
data = Databucket() # Re-initialize data in case you're running this cell multiple times
clip = ImageSequenceClip(data.images, fps=60) # Note: output video will be sped up because 
                                          # recording rate in simulator is fps=25
new_clip = clip.fl_image(process_image) #NOTE: this function expects color images!!
get_ipython().run_line_magic('time', 'new_clip.write_videofile(output, audio=False)')


# ### This next cell should function as an inline video player
# If this fails to render the video, try running the following cell (alternative video rendering method).  You can also simply have a look at the saved mp4 in your `/output` folder

# In[ ]:



from IPython.display import HTML
HTML("""
<video width="960" height="540" controls>
  <source src="{0}">
</video>
# In[ ]:


# Import everything needed to edit/save/watch video clips
from moviepy.editor import VideoFileClip
from moviepy.editor import ImageSequenceClip


# Define pathname to save the output video
output = './output/test_mapping.mp4'
data = Databucket()  # Re-initialize data in case you're running this cell multiple times
# Note: output video will be sped up because
clip = ImageSequenceClip(data.images, fps=60)
# recording rate in simulator is fps=25
# NOTE: this function expects color images!!
new_clip = clip.fl_image(process_image)
get_ipython().magic('time new_clip.write_videofile(output, audio=False)')


# ### This next cell should function as an inline video player
# If this fails to render the video, try running the following cell (alternative video rendering method).  You can also simply have a look at the saved mp4 in your `/output` folder

# In[ ]:


output = './output/test_mapping.mp4'
from IPython.display import HTML
HTML("""
<video width="960" height="540" controls>
  <source src="{0}">
</video>