Streaming Cameras with YOLOv8

 Apache NiFi, Python, YoLoV8, MinIO, S3, Images, Cameras, New York City

We can add a very easy to run Ultralytics YOLO v8 to hit against ingested camera’s from New York City. As you can see the code is really simple, we just need to load the pretrained model and call predict with some parameters and the image.

from ultralytics import YOLO
import sys
import io

import shutil

# Load a model
model = YOLO('') # pretrained YOLOv8n model

source = sys.argv[1]

results = model.predict(source, stream=False, save=True, imgsz=320, conf=0.5)

for r in results:


"name": "car",
"class": 2,
"confidence": 0.5163618922233582,
"box": {
"x1": 188.54917907714844,
"y1": 141.74185180664062,
"x2": 204.51304626464844,
"y2": 154.35519409179688
YOLOv9 added annotation

NiFi Flow

NiFi Detailed Steps

We invoke an HTTP URL from NY Open Data to get a list of all URLs. We send the metadata to a Kafka topic. We call the webcam URL to get the image. We save it to MinIO. We then save it local in a temporary file to get it analyzed by YOLOv8. We then retrieve the augmented image and send it to Slack.

Execute Shell Script Passing Argument to Python 3


"Latitude" : 41.51472,
"Longitude" : -74.0733,
"ID" : "Skyline-9873",
"Name" : "I-87 MP 060.40 NB Just North of Interchange 17 (Newburgh/I-84)",
"DirectionOfTravel" : "Northbound",
"RoadwayName" : "I-87 - NYS Thruway",
"Url" : "",
"VideoUrl" : "",
"Disabled" : false,
"Blocked" : false


FLaNK Stack 26 February 2024

FLaNK Stack 26 February 2024 



FLaNK Stack Weekly

Tim Spann @PaaSDev


Please join my meetup group NJ/NYC/Philly/Virtual.


**This is Issue #126 **


Using Google Gemma

NYC Traffic?? (NiFi, Kafka, Flink)

Subways and Transit Updates in Real-Time

Open Source Data Infrastructure Meetup - Feb 2024

AI + More required for startup


Continuous SQL with Kafka and Flink

Building Real-time Pipelines: A Case Study by Transit Data

Unlocking Financial Data with Real-Time Pipelines (OSACon 2023)

The Never Landing Stream

February 8, 2024 NYC Meetup

February 20, 2024 Virtual Meetup

Feb 22, 2024 NYC Meetup


Feb 28, 2024: NYC. Cloudera Meetup. Flink

Feb 29, 2024: Virtual. Conf42 Python.

Soon, 2024: Princeton. TigerLabs New Location. Meetup. GenAI.

March 15, 2024: TCF Pro. Princeton, NJ. IT Professional Conference at Trenton Computer Festival IEEE Information Technology Professional Conference on Friday, March 15th, 2024

March 28, 2024: Pinot + NiFi + Flink + Kafka Meetup NYC

April 2024: XtremeJ 2024. Virtual.

April 11, 2024: Conf42 LLM. Virtual.

May 8-9, 2024: Data Summit 2024. Boston, MA.

Cloudera Events

More Events:




Notable Tools

Postgresql + MySQL Cache


Configuration Management Server

Fast Text to Image

Very Interesting Remote tool for OBS

Commands Du Jour

docker system prune -a docker image prune -a docker system df docker ps docker logs name

© 2020-2024 Tim Spann