Project #1 - Finding the Lane Lines on the Road

We need to import the initial packages

In [237]:
#importing some useful packages
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
import cv2
import os
import random
%matplotlib inline


# Import everything needed to edit/save/watch video clips
from moviepy.editor import VideoFileClip
from IPython.display import display, HTML

Create helper functions

Provided by the (project seed)[https://github.com/udacity/CarND-LaneLines-P1/blob/master/P1.ipynb]

In [252]:
import math

def grayscale(img):
    """Applies the Grayscale transform
    This will return an image with only one color channel
    but NOTE: to see the returned image as grayscale
    (assuming your grayscaled image is called 'gray')
    you should call plt.imshow(gray, cmap='gray')"""
    #return cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)
    # Or use BGR2GRAY if you read an image with cv2.imread()
    return cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
    
def canny(img, low_threshold, high_threshold):
    """Applies the Canny transform"""
    return cv2.Canny(img, low_threshold, high_threshold)

def gaussian_blur(img, kernel_size):
    """Applies a Gaussian Noise kernel"""
    return cv2.GaussianBlur(img, (kernel_size, kernel_size), 0)

def region_of_interest(img, vertices):
    """
    Applies an image mask.
    
    Only keeps the region of the image defined by the polygon
    formed from `vertices`. The rest of the image is set to black.
    """
    #defining a blank mask to start with
    mask = np.zeros_like(img)   
    
    #defining a 3 channel or 1 channel color to fill the mask with depending on the input image
    if len(img.shape) > 2:
        channel_count = img.shape[2]  # i.e. 3 or 4 depending on your image
        ignore_mask_color = (255,) * channel_count
    else:
        ignore_mask_color = 255
        
    #filling pixels inside the polygon defined by "vertices" with the fill color    
    cv2.fillPoly(mask, vertices, ignore_mask_color)
    
    #returning the image only where mask pixels are nonzero
    masked_image = cv2.bitwise_and(img, mask)
    return masked_image

def drawLine(img, x, y, color=[255, 0, 0], thickness=20):
    """
    Adjust a line to the points [`x`, `y`] and draws it on the image `img` using `color` and `thickness` for the line.
    """
    if len(x) == 0: 
        return
    
    lineParameters = np.polyfit(x, y, 1) 
    
    m = lineParameters[0]
    b = lineParameters[1]
    
    maxY = img.shape[0]
    maxX = img.shape[1]
    y1 = maxY
    x1 = int((y1 - b)/m)
    y2 = int((maxY/2)) + 60
    x2 = int((y2 - b)/m)
    cv2.line(img, (x1, y1), (x2, y2), [255, 0, 0], 4)

def draw_lines(img, lines, color=[255, 0, 0], thickness=20):
    """
    NOTE: this is the function you might want to use as a starting point once you want to 
    average/extrapolate the line segments you detect to map out the full
    extent of the lane (going from the result shown in raw-lines-example.mp4
    to that shown in P1_example.mp4).  
    
    Think about things like separating line segments by their 
    slope ((y2-y1)/(x2-x1)) to decide which segments are part of the left
    line vs. the right line.  Then, you can average the position of each of 
    the lines and extrapolate to the top and bottom of the lane.
    
    This function draws `lines` with `color` and `thickness`.    
    Lines are drawn on the image inplace (mutates the image).
    If you want to make the lines semi-transparent, think about combining
    this function with the weighted_img() function below
    """
    
    leftPointsX = []
    leftPointsY = []
    rightPointsX = []
    rightPointsY = []

    for line in lines:
        for x1,y1,x2,y2 in line:
            m = (y1 - y2)/(x1 - x2)
            if m < 0:
                leftPointsX.append(x1)
                leftPointsY.append(y1)
                leftPointsX.append(x2)
                leftPointsY.append(y2)
            else:
                rightPointsX.append(x1)
                rightPointsY.append(y1)
                rightPointsX.append(x2)
                rightPointsY.append(y2)

    drawLine(img, leftPointsX, leftPointsY, color, thickness)
        
    drawLine(img, rightPointsX, rightPointsY, color, thickness)

def hough_lines(img, rho, theta, threshold, min_line_len, max_line_gap):
    """
    `img` should be the output of a Canny transform.
        
    Returns an image with hough lines drawn.
    """
    lines = cv2.HoughLinesP(img, rho, theta, threshold, np.array([]), minLineLength=min_line_len, maxLineGap=max_line_gap)
    line_img = np.zeros((img.shape[0], img.shape[1], 3), dtype=np.uint8)
    draw_lines(line_img, lines)
    return line_img

# Python 3 has support for cool math symbols.

def weighted_img(img, initial_img, α=0.8, β=1., λ=0.):
    """
    `img` is the output of the hough_lines(), An image with lines drawn on it.
    Should be a blank image (all black) with lines drawn on it.
    
    `initial_img` should be the image before any processing.
    
    The result image is computed as follows:
    
    initial_img * α + img * β + λ
    NOTE: initial_img and img must be the same shape!
    """
    return cv2.addWeighted(initial_img, α, img, β, λ)
In [253]:
def showImagesInHtml(images, dir):
    """
    Shows the list of `images` names on the directory `dir` as HTML embeded on the page.
    """
    randomNumber = random.randint(1, 100000)
    buffer = "<div>"
    for img in images:
        imgSource = dir + '/' + img + "?" + str(randomNumber)
        buffer += """<img src="{0}" width="300" height="110" style="float:left; margin:1px"/>""".format(imgSource)
    buffer += "</div>"
    display(HTML(buffer))

def saveImages(images, outputDir, imageNames, isGray=0):
    """
    Writes the `images` to the `outputDir` directory using the `imagesNames`.
    It creates the output directory if it doesn't exists.
    
    Example:
    
    saveImages([img1], 'tempDir', ['myImage.jpg'])
    
    Will save the image on the path: tempDir/myImage.jpg
    
    """
    if not os.path.exists(outputDir):
        os.makedirs(outputDir)
        
    zipped = list(map(lambda imgZip: (outputDir + '/' + imgZip[1], imgZip[0]), zip(images, imageNames)))
    for imgPair in zipped:
        if isGray:
            plt.imsave(imgPair[0], imgPair[1], cmap='gray')
        else :
            plt.imsave(imgPair[0], imgPair[1])
        
def doSaveAndDisplay(images, outputDir, imageNames, somethingToDo, isGray=0):
    """
    Applies the lambda `somethingToDo` to `images`, safe the results at the directory `outputDir`,
    and render the results in html.
    
    It returns the output images.
    """
    outputImages = list(map(somethingToDo, images))
    saveImages(outputImages, outputDir, imageNames, isGray)
    showImagesInHtml(imageNames, outputDir)
    return outputImages

Loading test images

In [254]:
testImagesDir = 'test_images'
testImageNames = os.listdir(testImagesDir)
showImagesInHtml(testImageNames, testImagesDir)
testImages = list(map(lambda img: plt.imread(testImagesDir + '/' + img), testImageNames))

Converting images into gray scale

In [255]:
def grayAction(img):
    return grayscale(img)

testImagesGray = doSaveAndDisplay(testImages, 'test_images_gray', testImageNames, grayAction, 1)

Applying Gaussian smoothing

In [256]:
blur_kernel_size = 15
blurAction = lambda img:gaussian_blur(img, blur_kernel_size)

testImagesBlur = doSaveAndDisplay(testImagesGray, 'test_images_blur', testImageNames, blurAction, 1)

Applying Canny transform

In [257]:
canny_low_threshold = 20
canny_high_threshold = 100
cannyAction = lambda img:canny(img, canny_low_threshold, canny_high_threshold)
testImagesCanny = doSaveAndDisplay(testImagesBlur, 'test_images_canny', testImageNames, cannyAction)

Applying Region of Interest

In [258]:
def maskAction(img):
    ysize = img.shape[0]
    xsize = img.shape[1]
    region = np.array([ [0, ysize], [xsize/2,(ysize/2)+ 10], [xsize,ysize] ], np.int32)
    return region_of_interest(img, [region])

testImagesMasked = doSaveAndDisplay(testImagesCanny, 'test_images_region', testImageNames, maskAction)

Applying Hough transform

In [259]:
rho = 1 # distance resolution in pixels of the Hough grid
theta = np.pi/180 # angular resolution in radians of the Hough grid
threshold = 10     # minimum number of votes (intersections in Hough grid cell)
min_line_length = 20 #minimum number of pixels making up a line
max_line_gap = 1    # maximum gap in pixels between connectable line segments

houghAction = lambda img: hough_lines(img, rho, theta, threshold, min_line_length, max_line_gap)

testImagesLines = doSaveAndDisplay(testImagesMasked, 'test_images_hough', testImageNames, houghAction)

Merging original image with lines

In [260]:
testImagesMergeTemp = list(map(lambda imgs: weighted_img(imgs[0], imgs[1]), zip(testImages,testImagesLines) ))
testImagesMerged = doSaveAndDisplay(testImagesMergeTemp, 'test_images_merged', testImageNames, lambda img: img)

Videos test

In [261]:
# Import everything needed to edit/save/watch video clips
from moviepy.editor import VideoFileClip
from IPython.display import HTML
In [262]:
def process_image(image):
    # NOTE: The output you return should be a color image (3 channel) for processing video below
    # TODO: put your pipeline here,
    # you should return the final output (image where lines are drawn on lanes)
    
    withLines = houghAction( maskAction( cannyAction( blurAction( grayAction(image) ) ) ) )
    
    return weighted_img(image, withLines)


def processVideo(videoFileName, inputVideoDir, outputVideoDir):
    """
    Applys the process_image pipeline to the video `videoFileName` on the directory `inputVideoDir`.
    The video is displayed and also saved with the same name on the directory `outputVideoDir`.
    """
    if not os.path.exists(outputVideoDir):
        os.makedirs(outputVideoDir)
    clip = VideoFileClip(inputVideoDir + '/' + videoFileName)
    outputClip = clip.fl_image(process_image)
    outVideoFile = outputVideoDir + '/' + videoFileName
    outputClip.write_videofile(outVideoFile, audio=False)
    display(
        HTML("""
        <video width="960" height="540" controls>
          <source src="{0}">
        </video>
        """.format(outVideoFile))
    )

White lane video test

In [263]:
testVideosOutputDir = 'test_videos_output'
testVideoInputDir = 'test_videos'
processVideo('solidWhiteRight.mp4', testVideoInputDir, testVideosOutputDir)
[MoviePy] >>>> Building video test_videos_output/solidWhiteRight.mp4
[MoviePy] Writing video test_videos_output/solidWhiteRight.mp4

  0%|          | 0/222 [00:00<?, ?it/s]

  5%|▌         | 12/222 [00:00<00:01, 110.16it/s]

 11%|█         | 24/222 [00:00<00:01, 111.19it/s]

 16%|█▌        | 36/222 [00:00<00:01, 112.54it/s]

 21%|██        | 47/222 [00:00<00:01, 101.25it/s]

 26%|██▌       | 57/222 [00:00<00:01, 97.36it/s] 

 30%|██▉       | 66/222 [00:00<00:01, 93.22it/s]

 34%|███▍      | 75/222 [00:00<00:01, 90.84it/s]

 38%|███▊      | 84/222 [00:00<00:01, 86.87it/s]

 42%|████▏     | 93/222 [00:01<00:01, 84.76it/s]

 46%|████▌     | 102/222 [00:01<00:01, 85.65it/s]

 50%|█████     | 111/222 [00:01<00:01, 85.19it/s]

 54%|█████▍    | 120/222 [00:01<00:01, 84.36it/s]

 58%|█████▊    | 129/222 [00:01<00:01, 84.77it/s]

 62%|██████▏   | 138/222 [00:01<00:00, 84.95it/s]

 66%|██████▌   | 147/222 [00:01<00:00, 83.26it/s]

 70%|███████   | 156/222 [00:01<00:00, 83.87it/s]

 74%|███████▍  | 165/222 [00:01<00:00, 83.15it/s]

 78%|███████▊  | 174/222 [00:01<00:00, 82.84it/s]

 82%|████████▏ | 183/222 [00:02<00:00, 82.88it/s]

 86%|████████▋ | 192/222 [00:02<00:00, 81.65it/s]

 91%|█████████ | 201/222 [00:02<00:00, 81.11it/s]

 95%|█████████▍| 210/222 [00:02<00:00, 81.71it/s]

 99%|█████████▊| 219/222 [00:02<00:00, 83.47it/s]

100%|█████████▉| 221/222 [00:02<00:00, 86.86it/s]
[MoviePy] Done.
[MoviePy] >>>> Video ready: test_videos_output/solidWhiteRight.mp4 

Yellow lane video test

In [250]:
processVideo('solidYellowLeft.mp4', testVideoInputDir, testVideosOutputDir)
[MoviePy] >>>> Building video test_videos_output/solidYellowLeft.mp4
[MoviePy] Writing video test_videos_output/solidYellowLeft.mp4

  0%|          | 0/682 [00:00<?, ?it/s]

  2%|▏         | 11/682 [00:00<00:06, 106.06it/s]

  3%|▎         | 23/682 [00:00<00:06, 108.55it/s]

  5%|▌         | 35/682 [00:00<00:05, 110.80it/s]

  7%|▋         | 47/682 [00:00<00:06, 101.20it/s]

  8%|▊         | 56/682 [00:00<00:06, 96.71it/s] 

 10%|▉         | 65/682 [00:00<00:06, 90.57it/s]

 11%|█         | 74/682 [00:00<00:07, 85.76it/s]

 12%|█▏        | 82/682 [00:00<00:07, 82.07it/s]

 13%|█▎        | 90/682 [00:01<00:07, 79.75it/s]

 14%|█▍        | 98/682 [00:01<00:07, 75.87it/s]

 16%|█▌        | 106/682 [00:01<00:07, 75.64it/s]

 17%|█▋        | 114/682 [00:01<00:07, 75.09it/s]

 18%|█▊        | 122/682 [00:01<00:07, 74.47it/s]

 19%|█▉        | 130/682 [00:01<00:07, 74.56it/s]

 20%|██        | 138/682 [00:01<00:07, 74.45it/s]

 21%|██▏       | 146/682 [00:01<00:07, 74.13it/s]

 23%|██▎       | 154/682 [00:01<00:07, 74.84it/s]

 24%|██▍       | 162/682 [00:01<00:07, 73.53it/s]

 25%|██▍       | 170/682 [00:02<00:06, 73.25it/s]

 26%|██▌       | 178/682 [00:02<00:06, 72.54it/s]

 27%|██▋       | 186/682 [00:02<00:06, 73.09it/s]

 28%|██▊       | 194/682 [00:02<00:06, 74.49it/s]

 30%|██▉       | 202/682 [00:02<00:06, 73.49it/s]

 31%|███       | 211/682 [00:02<00:06, 74.82it/s]

 32%|███▏      | 219/682 [00:02<00:06, 75.03it/s]

 33%|███▎      | 227/682 [00:02<00:06, 75.17it/s]

 34%|███▍      | 235/682 [00:02<00:06, 72.43it/s]

 36%|███▌      | 243/682 [00:03<00:06, 71.80it/s]

 37%|███▋      | 251/682 [00:03<00:05, 72.97it/s]

 38%|███▊      | 259/682 [00:03<00:05, 74.43it/s]

 39%|███▉      | 267/682 [00:03<00:05, 74.37it/s]

 40%|████      | 275/682 [00:03<00:05, 73.96it/s]

 41%|████▏     | 283/682 [00:03<00:05, 74.40it/s]

 43%|████▎     | 291/682 [00:03<00:05, 73.39it/s]

 44%|████▍     | 299/682 [00:03<00:05, 72.14it/s]

 45%|████▌     | 307/682 [00:03<00:05, 73.11it/s]

 46%|████▌     | 315/682 [00:04<00:05, 73.14it/s]

 47%|████▋     | 323/682 [00:04<00:04, 73.46it/s]

 49%|████▊     | 331/682 [00:04<00:04, 74.66it/s]

 50%|████▉     | 339/682 [00:04<00:04, 74.57it/s]

 51%|█████     | 347/682 [00:04<00:04, 73.81it/s]

 52%|█████▏    | 355/682 [00:04<00:04, 72.41it/s]

 53%|█████▎    | 363/682 [00:04<00:04, 71.94it/s]

 54%|█████▍    | 371/682 [00:04<00:04, 72.69it/s]

 56%|█████▌    | 379/682 [00:04<00:04, 73.22it/s]

 57%|█████▋    | 387/682 [00:05<00:03, 74.94it/s]

 58%|█████▊    | 395/682 [00:05<00:03, 73.98it/s]

 59%|█████▉    | 403/682 [00:05<00:03, 72.54it/s]

 60%|██████    | 411/682 [00:05<00:03, 73.11it/s]

 61%|██████▏   | 419/682 [00:05<00:03, 73.85it/s]

 63%|██████▎   | 427/682 [00:05<00:03, 73.42it/s]

 64%|██████▍   | 435/682 [00:05<00:03, 73.34it/s]

 65%|██████▍   | 443/682 [00:05<00:03, 74.22it/s]

 66%|██████▌   | 451/682 [00:05<00:03, 72.12it/s]

 67%|██████▋   | 459/682 [00:06<00:03, 73.12it/s]

 69%|██████▊   | 468/682 [00:06<00:02, 75.18it/s]

 70%|██████▉   | 476/682 [00:06<00:02, 74.83it/s]

 71%|███████   | 484/682 [00:06<00:02, 74.63it/s]

 72%|███████▏  | 492/682 [00:06<00:02, 73.96it/s]

 73%|███████▎  | 500/682 [00:06<00:02, 72.96it/s]

 74%|███████▍  | 508/682 [00:06<00:02, 71.82it/s]

 76%|███████▌  | 516/682 [00:06<00:02, 71.97it/s]

 77%|███████▋  | 524/682 [00:06<00:02, 71.59it/s]

 78%|███████▊  | 532/682 [00:07<00:02, 68.94it/s]

 79%|███████▉  | 539/682 [00:07<00:02, 68.63it/s]

 80%|████████  | 547/682 [00:07<00:01, 68.84it/s]

 81%|████████  | 554/682 [00:07<00:01, 69.07it/s]

 82%|████████▏ | 561/682 [00:07<00:01, 68.15it/s]

 83%|████████▎ | 569/682 [00:07<00:01, 68.67it/s]

 85%|████████▍ | 577/682 [00:07<00:01, 69.08it/s]

 86%|████████▌ | 585/682 [00:07<00:01, 69.41it/s]

 87%|████████▋ | 592/682 [00:07<00:01, 67.75it/s]

 88%|████████▊ | 599/682 [00:08<00:01, 68.23it/s]

 89%|████████▉ | 606/682 [00:08<00:01, 66.38it/s]

 90%|████████▉ | 613/682 [00:08<00:01, 64.89it/s]

 91%|█████████ | 620/682 [00:08<00:00, 64.87it/s]

 92%|█████████▏| 628/682 [00:08<00:00, 66.64it/s]

 93%|█████████▎| 636/682 [00:08<00:00, 68.14it/s]

 94%|█████████▍| 643/682 [00:08<00:00, 68.03it/s]

 95%|█████████▌| 651/682 [00:08<00:00, 68.08it/s]

 96%|█████████▋| 658/682 [00:08<00:00, 66.20it/s]

 98%|█████████▊| 665/682 [00:09<00:00, 66.05it/s]

 99%|█████████▊| 672/682 [00:09<00:00, 66.45it/s]

100%|█████████▉| 680/682 [00:09<00:00, 67.99it/s]

100%|█████████▉| 681/682 [00:09<00:00, 73.62it/s]
[MoviePy] Done.
[MoviePy] >>>> Video ready: test_videos_output/solidYellowLeft.mp4 

Challenge video test (not so great....)

In [251]:
processVideo('challenge.mp4', testVideoInputDir, testVideosOutputDir)
[MoviePy] >>>> Building video test_videos_output/challenge.mp4
[MoviePy] Writing video test_videos_output/challenge.mp4

  0%|          | 0/251 [00:00<?, ?it/s]

  2%|▏         | 5/251 [00:00<00:05, 43.45it/s]

  4%|▍         | 10/251 [00:00<00:05, 44.92it/s]

  6%|▌         | 15/251 [00:00<00:05, 45.83it/s]

  8%|▊         | 20/251 [00:00<00:04, 46.77it/s]

 10%|▉         | 25/251 [00:00<00:04, 47.09it/s]

 12%|█▏        | 30/251 [00:00<00:04, 47.20it/s]

 14%|█▍        | 35/251 [00:00<00:04, 47.62it/s]

 16%|█▋        | 41/251 [00:00<00:04, 48.34it/s]

 18%|█▊        | 46/251 [00:00<00:04, 47.41it/s]

 20%|██        | 51/251 [00:01<00:05, 39.47it/s]

 22%|██▏       | 56/251 [00:01<00:05, 37.13it/s]

 24%|██▍       | 60/251 [00:01<00:05, 35.94it/s]

 25%|██▌       | 64/251 [00:01<00:05, 35.71it/s]

 27%|██▋       | 68/251 [00:01<00:05, 34.28it/s]

 29%|██▊       | 72/251 [00:01<00:05, 34.88it/s]

 30%|███       | 76/251 [00:01<00:04, 35.27it/s]

 32%|███▏      | 80/251 [00:02<00:04, 34.24it/s]

 33%|███▎      | 84/251 [00:02<00:05, 33.21it/s]

 35%|███▌      | 88/251 [00:02<00:05, 32.59it/s]

 37%|███▋      | 92/251 [00:02<00:05, 31.47it/s]

 38%|███▊      | 96/251 [00:02<00:04, 32.28it/s]

 40%|███▉      | 100/251 [00:02<00:04, 32.20it/s]

 41%|████▏     | 104/251 [00:02<00:04, 32.74it/s]

 43%|████▎     | 108/251 [00:02<00:04, 33.99it/s]

 45%|████▍     | 112/251 [00:02<00:04, 34.72it/s]

 46%|████▌     | 116/251 [00:03<00:03, 34.83it/s]

 48%|████▊     | 120/251 [00:03<00:03, 33.84it/s]

 49%|████▉     | 124/251 [00:03<00:03, 33.30it/s]

 51%|█████     | 128/251 [00:03<00:03, 32.67it/s]

 53%|█████▎    | 132/251 [00:03<00:03, 30.96it/s]

 54%|█████▍    | 136/251 [00:03<00:03, 30.58it/s]

 56%|█████▌    | 140/251 [00:03<00:03, 30.77it/s]

 57%|█████▋    | 144/251 [00:03<00:03, 30.91it/s]

 59%|█████▉    | 148/251 [00:04<00:03, 30.41it/s]

 61%|██████    | 152/251 [00:04<00:03, 29.60it/s]

 62%|██████▏   | 156/251 [00:04<00:03, 30.33it/s]

 64%|██████▎   | 160/251 [00:04<00:02, 30.72it/s]

 65%|██████▌   | 164/251 [00:04<00:03, 26.95it/s]

 67%|██████▋   | 167/251 [00:04<00:03, 27.52it/s]

 68%|██████▊   | 170/251 [00:04<00:03, 26.73it/s]

 69%|██████▉   | 173/251 [00:05<00:02, 26.19it/s]

 70%|███████   | 176/251 [00:05<00:03, 23.54it/s]

 72%|███████▏  | 180/251 [00:05<00:02, 25.65it/s]

 73%|███████▎  | 184/251 [00:05<00:02, 26.19it/s]

 75%|███████▍  | 187/251 [00:05<00:02, 26.03it/s]

 76%|███████▌  | 190/251 [00:05<00:02, 26.07it/s]

 77%|███████▋  | 193/251 [00:05<00:02, 26.48it/s]

 78%|███████▊  | 196/251 [00:05<00:02, 26.29it/s]

 79%|███████▉  | 199/251 [00:06<00:02, 25.49it/s]

 80%|████████  | 202/251 [00:06<00:01, 25.84it/s]

 82%|████████▏ | 205/251 [00:06<00:01, 26.92it/s]

 83%|████████▎ | 209/251 [00:06<00:01, 28.00it/s]

 84%|████████▍ | 212/251 [00:06<00:01, 27.77it/s]

 86%|████████▌ | 216/251 [00:06<00:01, 28.74it/s]

 88%|████████▊ | 220/251 [00:06<00:01, 30.02it/s]

 89%|████████▉ | 224/251 [00:06<00:00, 30.58it/s]

 91%|█████████ | 228/251 [00:07<00:00, 31.75it/s]

 92%|█████████▏| 232/251 [00:07<00:00, 31.54it/s]

 94%|█████████▍| 236/251 [00:07<00:00, 31.83it/s]

 96%|█████████▌| 240/251 [00:07<00:00, 31.85it/s]

 97%|█████████▋| 244/251 [00:07<00:00, 32.69it/s]

 99%|█████████▉| 248/251 [00:07<00:00, 32.85it/s]

100%|██████████| 251/251 [00:07<00:00, 32.58it/s]
[MoviePy] Done.
[MoviePy] >>>> Video ready: test_videos_output/challenge.mp4 

In [ ]: