Created
July 26, 2018 00:15
-
-
Save OlafenwaMoses/f02ecb745b4309241bbf0a4e2c7fb91a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from imageai.Detection import VideoObjectDetection | |
import os | |
import cv2 | |
execution_path = os.getcwd() | |
camera = cv2.VideoCapture(0) | |
detector = VideoObjectDetection() | |
detector.setModelTypeAsYOLOv3() | |
detector.setModelPath(os.path.join(execution_path , "yolo.h5")) | |
detector.loadModel() | |
video_path = detector.detectObjectsFromVideo(camera_input=camera, | |
output_file_path=os.path.join(execution_path, "camera_detected_1") | |
, frames_per_second=29, log_progress=True) | |
print(video_path) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment