Closed pytesnim closed 5 years ago
You can use custom objects detection :
custom_objects = detector.CustomObjects(person=True, bicycle=True, motorcycle=True)
video_path = detector.detectCustomObjectsFromVideo(custom_objects=custom_objects, input_file_path=os.path.join(execution_path, "traffic.mp4"),
output_file_path=os.path.join(execution_path, "traffic_custom_detected")
, frames_per_second=20, log_progress=True)
More info here : https://github.com/OlafenwaMoses/ImageAI/blob/master/imageai/Detection/VIDEO.md#custom-video-object-detection
What if it detects 2 birds?
And I want to detect a specific bird?
I just started to use imageAI this week, so I just have a basic understanding.
If you want to detect a specific species of bird, I think you will have to train your own model.
Alternative :
As the forFrame
method will return the frame number and the bounding box of each detected object, you will be able to draw a box around a specific object on a specific frame.
[{'name': 'bird', 'percentage_probability': 44.57316696643829, 'box_points': (55, 585, 626, 808)} ...]
Custom trained model can not be used in detecting objects in videos yet, as fas as I understood.
Hello, When I use video detection code, it detects all the objects in the scene. ıs it possible to select specific object from the scene? Thanks very much!