Skip to content

Instantly share code, notes, and snippets.

@OlafenwaMoses
Last active August 10, 2020 06:49
Show Gist options
  • Save OlafenwaMoses/235530a485204209a8de43489a10a7ae to your computer and use it in GitHub Desktop.
Save OlafenwaMoses/235530a485204209a8de43489a10a7ae to your computer and use it in GitHub Desktop.
from imageai.Detection import VideoObjectDetection
import os
execution_path = os.getcwd()
detector = VideoObjectDetection()
detector.setModelTypeAsYOLOv3()
detector.setModelPath( os.path.join(execution_path , "yolo.h5"))
detector.loadModel()
video_path = detector.detectObjectsFromVideo(input_file_path=os.path.join( execution_path, "traffic-mini.mp4"),
output_file_path=os.path.join(execution_path, "traffic_mini_detected_1")
, frames_per_second=29, log_progress=True)
print(video_path)
@mohandev4066
Copy link

please provide the yolo.h5 file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment