Downloads · 30 days
0
AzrilFahmiardi/yt-news-ribbon-yolov8n-detector
yt-news-ribbon-yolov8n-detector is a machine learning model from AzrilFahmiardi. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Lightweight real-time detector for extracting main news ribbon/headline from YouTube live streams. Trained on custom-labeled data with YOLOv8 and combined with OCR for text extraction. ---
Downloads · 30 days
0
Access
Public
Updated Jan 11, 2026
Repo size
7.9 MB
Likes
0
Public
Click a slice to open those files.
.pt6.2 MB · 79%
From the Hugging Face model README
This project detects:
ribbon_main : main headline ribbonribbon_badge : small badge/label on the left (optional)ribbon_main, ribbon_badgeModel file:
yolov8n_finetuned.pt
pip install ultralytics easyocr opencv-python
from ultralytics import YOLO
import easyocr
model = YOLO("yolov8n_finetuned.pt")
ocr_reader = easyocr.Reader(['en', 'id'])
import cv2
import numpy as np
def detect_and_read(frame, model, ocr_reader, conf=0.3):
results = model(frame, conf=conf, verbose=False)[0]
output = []
if results.boxes is None:
return output
for box in results.boxes:
cls_id = int(box.cls[0])
label = model.names[cls_id]
x1, y1, x2, y2 = map(int, box.xyxy[0])
crop = frame[y1:y2, x1:x2]
if crop.size == 0:
continue
texts = ocr_reader.readtext(crop)
text = " ".join([t[1] for t in texts])
output.append({
"label": label,
"bbox": (x1, y1, x2, y2),
"text": text
})
return output
img = cv2.imread("sample.png")
results = detect_and_read(img, model, ocr_reader)
for r in results:
print(r["label"], ":", r["text"])
SUCCESS: True
TEXT: PRESIDEN SERAHKAN RP 465 M BONUS ATLET SEA GAMES
BBOX: (324, 639, 1444, 736)
