Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sichere ProgrammierungI audited my own ML linter and had to withdraw its best evidence(21.09.2026 um 22:54 Uhr)
Sichere ProgrammierungQuantum Result Validation for Distributed Computing Systems(21.09.2026 um 22:54 Uhr)
Sichere ProgrammierungJWT Authentication and Role-Based Access Control in LocalHands(21.09.2026 um 22:56 Uhr)
Sichere ProgrammierungStochastic Parrot or Alien Mind?(21.09.2026 um 22:56 Uhr)
Sichere ProgrammierungBuilding AI for the Physical World Is a Different Engineering Problem(21.09.2026 um 22:58 Uhr)
Sichere ProgrammierungI audited my own ML linter and had to withdraw its best evidence(21.09.2026 um 22:54 Uhr)
Sichere ProgrammierungQuantum Result Validation for Distributed Computing Systems(21.09.2026 um 22:54 Uhr)
Sichere ProgrammierungJWT Authentication and Role-Based Access Control in LocalHands(21.09.2026 um 22:56 Uhr)
Sichere ProgrammierungStochastic Parrot or Alien Mind?(21.09.2026 um 22:56 Uhr)
Sichere ProgrammierungBuilding AI for the Physical World Is a Different Engineering Problem(21.09.2026 um 22:58 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Building Real-time Object Detection on Live-streams

Artificial Intelligence (AI), or more specifically object detection is a fascinating topic that opens a gateway to a wide variety of projects and ideas. I recently came across YOLO (You Only Look Once) from Ultralytics, which is an fast,…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Artificial Intelligence (AI), or more specifically object detection is a fascinating topic that opens a gateway to a wide variety of projects and ideas. I recently came across YOLO (You Only Look Once) from Ultralytics, which is an fast, accurate, and super easy to implement object detection model. In this post I will walk you through my process of building real-time object detection on live streams.



I have built this to work on RTSP (Real-time streaming protocol) and HLS (HTTP Live Streaming).






What Makes YOLO Special?



For starters, YOLO is super fast and excels with real time object detection due to the way it works internally which is very different from other models such as R-CNN.



Algorithms like Faster R-CNN use Region Proposal Network to detect regions of interest, then performs detection on those regions over multiple iterations. While YOLO does it in a single iteration, hence the name "You Only Look Once".



In addition, YOLO requires very little training data because the first 20 convolution layers have been pre-trained on the ImageNet dataset.






Now The Project!



Now that all the terminology is out of the way, I can dive into how I set up real-time object detection using YOLO.



First step is to install the required dependencies:





  • torch (only needed if you plan on utilizing GPU for training)


  • opencv-python for video processing


  • ultralytics for the YOLO model



Since I have a Nvidia graphics card I utilized CUDA to train on my GPU (which is much faster).



First we load the YOLO model, I used YOLOv11 trained on the COCO (Common Objects in Context) dataset.



model = YOLO(r"C:\path\to\your\yolo_model.pt")



Next, we capture the stream using opencv-python, read each frame within a loop, and run that frame through our YOLO model - very straight forward.




video_cap = cv2.VideoCapture(STREAM_URL)
cv2.namedWindow("Detection Output", cv2.WINDOW_NORMAL)

while True:
ret, frame = video_cap.read() # read the frame from the capture
if not ret:
break

results = model(frame) # get prediction on frame from YOLO model

cv2.imshow("Detection Output", frame) # Draw the frame

if cv2.waitKey(1) == ord("q"): # Quit on "q" key press.
break

# Don't forget to quit gracefully!
video_cap.release()
cv2.destroyAllWindows()






That easy, now this will give you the predictions in your terminal, but what if you want to draw your bounding boxes for example?



results = model(frame) - results represents a list of predictions YOLO has made, and each of these predictions have additional data; such as bounding box coordinates, confidence, and labels.



With this you can loop through the results list, and draw whatever data you want to display from the predictions to your frame.



Here is an example where I drew bounding boxes around the predictions:




    for box in results[0].boxes.xywh.tolist():
center_x, center_y, width, height = box
x1 = int(center_x - width / 2) # top left x
y1 = int(center_y - height / 2) # top left y
x2 = int(center_x + width / 2) # bottom right x
y2 = int(center_y + height / 2) # bottom right y

# rectangle parameters: frame, point1, point2, BGR color, thickness
cv2.rectangle(frame, (x1, y1), (x2, y2), (255, 0, 0), 2)






You can find the full code on my GitHub here.






Demo



For this demo, I used yt-dlp to get the direct stream URL from a YouTube livestream like so:



yt-dlp -g https://www.youtube.com/watch?v=VIDEO_ID



With the following detection classes:




  • person

  • bicycle

  • car

  • motorcycle

  • bus

  • truck

  • cat

  • dog

  • sports ball



I purposely omitted labels and confidence scores to reduce clutter







And that's that. Thanks for Reading :)



🌱

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Building Real-time Object Detection on Live-streams

Thematisch verwandte Begriffe: Building, Realtime, Object, Detection · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-79918 | MaxKB is an open-source AI assistant for enterprise. Prior to version 2.…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick