You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
im trying to get the frame,id and class of detections that tiggers a line_counter . the end goal is to export to a database or csv this data in order to do post processing analysis .
Can anyone provide some insight how to achieve this? so far i have been able only to get line_counter.out_count and line_counter.in_count values for every frame.
in addition i have noticed that by defaut in_count is triggered by TOP_CENTER and out_count by BOTTOM_CENTER of the bbox . not sure if this is intended to be like that but ideally im looking to tigger the lines by the CENTER of the bbox in both scenarios.
thanks in advance and sorry for my little knowledge about coding .
Script:
import cv2
import tqdm
from ultralytics import YOLO
import supervision as sv
import numpy as np
from supervision import VideoInfo, VideoSink
from supervision import get_video_frames_generator
LINE_START = sv.Point(372, 514)
LINE_END = sv.Point(1736, 718)
SOURCE_VIDEO_PATH ="/media/haroldpc/SSD01/videos/2023-04-12 16-46-26.mp4"
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
hello all,
im trying to get the frame,id and class of detections that tiggers a line_counter . the end goal is to export to a database or csv this data in order to do post processing analysis .
Can anyone provide some insight how to achieve this? so far i have been able only to get line_counter.out_count and line_counter.in_count values for every frame.
in addition i have noticed that by defaut in_count is triggered by TOP_CENTER and out_count by BOTTOM_CENTER of the bbox . not sure if this is intended to be like that but ideally im looking to tigger the lines by the CENTER of the bbox in both scenarios.
thanks in advance and sorry for my little knowledge about coding .
Script:
import cv2
import tqdm
from ultralytics import YOLO
import supervision as sv
import numpy as np
from supervision import VideoInfo, VideoSink
from supervision import get_video_frames_generator
LINE_START = sv.Point(372, 514)
LINE_END = sv.Point(1736, 718)
SOURCE_VIDEO_PATH ="/media/haroldpc/SSD01/videos/2023-04-12 16-46-26.mp4"
def main():
line_counter = sv.LineZone(start=LINE_START, end=LINE_END)
line_annotator = sv.LineZoneAnnotator(thickness=2, text_thickness=1, text_scale=0.5)
box_annotator = sv.BoxAnnotator(
thickness=2,
text_thickness=1,
text_scale=0.5,
text_padding=1
)
if name == "main":
main()
Beta Was this translation helpful? Give feedback.
All reactions