Imageai: How to use ImageAI to detect real-time video stream

Created on 27 Jun 2018  路  7Comments  路  Source: OlafenwaMoses/ImageAI

Hello!
Thanks to the great job.
How do I use ImageAI to detect target in real-time video stream?
For example, open the camera for real time detection

Most helpful comment

Currently, ImageAI can only detect objects from a video file. However, we are currently developing the next version of ImageAI that will allow you to parse in a camera input and have detection performed on the live stream video. You will also be able to receive detection details in real-time. We are bringing in support for YOLOv3 in the next version. It will be available soon.

All 7 comments

Currently, ImageAI can only detect objects from a video file. However, we are currently developing the next version of ImageAI that will allow you to parse in a camera input and have detection performed on the live stream video. You will also be able to receive detection details in real-time. We are bringing in support for YOLOv3 in the next version. It will be available soon.

Well, thank you very much. By the way, how long will the next version be? I can't wait.

The latest version of ImageAI (v2.0.2) is now available and supports TinyYOLOv3 for fast and real-time object detection on Low-end devices like the NVIDIA Jets on GPU. Find links to documentation below.

http://imageai.readthedocs.io/en/latest/detection/index.html

http://imageai.readthedocs.io/en/latest/video/index.html

Also, support has been provided for device camera and IP camera video.

Hello @OlafenwaMoses,
I am not able to view live detected video. Like, I can save the video in my directory but I wish to see the live detection. The input source is my webcam

from imageai.Detection.Custom import CustomVideoObjectDetection
import os
import cv2
execution_path = os.getcwd()
camera = cv2.VideoCapture(0)
detector = CustomVideoObjectDetection()
detector.setModelTypeAsYOLOv3()
detector.setModelPath("detection_model-ex-013--loss-0003.666.h5")
detector.setJsonPath("json/detection_config.json")
detector.loadModel()
video_path=detector.detectObjectsFromVideo(camera_input=camera,
output_file_path=os.path.join(execution_path, "holo2-detected3"),
frames_per_second=16,
minimum_percentage_probability=40,
log_progress=True)
print(video_path)

so is it possible to view the live video while it is processing ?

No @TaiTan0
Please ask @OlafenwaMoses to help us out

Was this page helpful?
0 / 5 - 0 ratings