in ur code for object detecion you have used “with” statement in process_image function, which is why it is taking a long time run. instead use “with” statement before clip1.fl_image in ur code. this is improve video detection by ~80%.
white_output = ‘ads/Coca-Cola_belgassd27k.mp4’
clip1 = VideoFileClip(“ads/Coca-Cola.mp4”).subclip(0,30)
with tf.Session(graph=detection_graph) as sess:
#clip_resized = clip1.resize(height=512,width=512)
white_clip = clip1.fl_image(detect_objects) #NOTE: this function expects color images!!s
%time white_clip.write_videofile(white_output, audio=False,preset=’ultrafast’)