-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvideo.py
More file actions
19 lines (15 loc) · 682 Bytes
/
Copy pathvideo.py
File metadata and controls
19 lines (15 loc) · 682 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# -*- coding: utf-8 -*-
import imageio
imageio.plugins.ffmpeg.download()
# Import everything needed to edit/save/watch video clips
from moviepy.editor import VideoFileClip
from car.train import load_model
from car.detect import ImgDetector, VideoDetector
if __name__ == "__main__":
detector = VideoDetector(ImgDetector(classifier=load_model("model_v4.pkl")))
def process_image(image):
return detector.run(image, False)
white_output = 'project_video_result.mp4'
clip1 = VideoFileClip("project_video.mp4")
white_clip = clip1.fl_image(process_image) #NOTE: this function expects color images!!
white_clip.write_videofile(white_output, audio=False)