Giter Club home page Giter Club logo

keras-video-object-detector's Introduction

keras-video-object-detector

Object detector in videos using keras and YOLO

Usage

Detect objects in a video file using YOLO algorithm

The demo code below can be found in keras_video_object_detector/demo/detect_objects_in_video.py

The demo codes takes in a sample video and output another video that has the detected boxes with class labels

from keras_video_object_detector.library.download_utils import download_file
from keras_video_object_detector.library.yolo import YoloObjectDetector

model_dir_path = 'keras_video_object_detector/models'

video_file_path = 'keras_video_object_detector/demo/videos/road_video.mp4'
output_video_file_path = 'keras_video_object_detector/demo/videos/predicted_video.mp4'
temp_image_folder = 'frames'

# download the test video file if not exists
download_file(video_file_path, url_path='https://www.dropbox.com/s/9nlph8ha6g1kxhw/road_video.mp4?dl=1')

detector = YoloObjectDetector()
detector.load_model(model_dir_path)

result = detector.detect_objects_in_video(video_file_path=video_file_path,
                                 output_video_path=output_video_file_path,
                                 temp_image_folder=temp_image_folder)

Real-time Detect objects in a camera using YOLO algorithm

The demo code below can be found in keras_video_object_detector/demo/detect_objects_in_camera.py

The demo codes uses the camera from opencv-pyton and adds the detected boxes with class labels to the camera frames:

import cv2
from keras_video_object_detector.library.yolo import YoloObjectDetector

model_dir_path = 'keras_video_object_detector/models'

detector = YoloObjectDetector()
detector.load_model(model_dir_path)

camera = cv2.VideoCapture(0)

detector.detect_objects_in_camera(camera=camera)

camera.release()
cv2.destroyAllWindows()

keras-video-object-detector's People

Contributors

chen0040 avatar

Watchers

Shubham Pachori avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.