'To separate objects detected from a video using PixelLib
Consider a Silhouette of a person obtained from a video using PixelLib. It is able to detect multiple people from the video, and it is able to save the Silhouette of each person as well.
'''
import pixellib
from pixellib.instance import instance_segmentation
segment_video = instance_segmentation()
segment_video.load_model("mask_rcnn_coco.h5")
target_classes = segment_video.select_target_classes(person=True)
segment_video.process_video("Face.mp4", show_bboxes=True, segment_target_classes= target_classes, extract_segmented_objects=True,save_extracted_objects=True, frames_per_second= 5, output_video_name="output_cctv.mp4")
'''
This is the code, found from the reference here.
Is it possible to save every single extracted object from the video, instead of it refreshing the object everytime there is a change. I tried to find a solution but could not come across any.
Is it also possible to stop the video once it has run fully, without having to do a manual keyboard interrupt
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
