darknet

Activity, over time

Daily observations from the public event archive.

Attention

Daily stars & forks

Loading attention chart

Star accumulation

Cumulative stars

Loading star accumulation chart

Pull requests

Daily opens & merges

Loading pull requests chart

Conversations

Daily issues & comments

Loading conversations chart

Community

Daily accounts & reviews

Loading community chart

Releases

Daily releases

Loading releases chart

Mentions

2posts · 30d
Nov 30 posts
  1. Bloqueador de Anúncios com IA na Smart TV: Guia 2024 Bloqueador de Anúncios com IA para Smart TV em 2024: Guia Prático Introdução Chegou a hora de assistir séries, filmes e programas ao vivo sem interrupções publicitárias. Com os novos tutoriais da Hipertextual e Xataka, a busca por “ad blocker smart tv” explodiu no Google Trends. Graças aos LLM leves (llama.cpp, Ollama) e às APIs que rodam localmente, hoje é possível filtrar anúncios direto na sua Smart TV usando um Raspberry Pi, um NAS ou até a própria TV que suporte Docker ou scripts Python. Neste artigo você encontrará um panorama do modelo publicitário nas Smart TVs, entenderá a tecnologia de detecção em tempo real e seguirá um passo‑a‑passo com código pronto para usar. --- Por que implementar agora | Motivo | Impacto | |--------|----------| | Regulamentação – DSMA da UE e GDPR exigem consentimento explícito para coleta de dados. Fabricantes como Samsung e LG já recebem advertências, o que pode limitar anúncios intrusivos. | Redução de riscos legais e maior privacidade. | | Largura de banda – Cada anúncio consome de 2 MB a 15 MB. Em maratonas de 10 episódios, isso pode chegar a 150 MB desperdiçados. | Economia de dados, principalmente em conexões limitadas. | | LLM leves – Modelos como llama‑2‑7B‑Chat (llama.cpp) e TinyYOLOv4‑nano rodam em CPUs ARM de 2 GHz usando menos de 30 % da CPU. | Processamento em tempo real sem depender de servidores externos. | | Cultura ad‑free – Usuários já esperam experiência sem anúncios em Netflix, Disney+ e Prime Video. | Alinhamento com a expectativa do público. | --- Como funciona: arquitetura simplificada [Smart TV] → Proxy local (mitmproxy) → [Raspberry Pi / NAS] → LLM + Detector visual → Bloqueio / Substituição → [Smart TV] 1. Interceptação – O proxy captura todo o tráfego HTTP/HTTPS da TV. 2. Classificação textual – O LLM analisa cabeçalhos, URLs e metadados procurando termos como adservice, doubleclick ou prebid. 3. Detecção visual – Um modelo TinyYOLO extrai frames a cada 0,5 s e identifica logos, textos “sponsored” ou contadores de tempo típicos de anúncios. 4. Ação – Quando a probabilidade ultrapassa 0,85, o proxy devolve um segmento em branco ou um placeholder silencioso, mantendo a sincronização da transmissão. --- Passo a passo: montando seu bloqueador 1. Preparar o hardware - Raspberry Pi 4 (4 GB ou mais) ou NAS com Docker. - Conexão Ethernet entre a TV e o dispositivo (evita latência). 2. Instalar o proxy (mitmproxy) sudo apt update sudo apt install -y mitmproxy - Gere o certificado: mitmproxy --certs e instale‑o na Smart TV (geralmente nas opções de rede avançada). 3. Configurar o modelo de linguagem git clone https://github.com/ggerganov/llama.cpp cd llama.cpp make wget https://huggingface.co/meta-llama/Llama-2-7b-chat/resolve/main/ggml-model-q4_0.bin ./main -m ggml-model-q4_0.bin -p "Classifique a URL como anúncio ou conteúdo" - Salve o binário em /opt/llm/llama2.bin. 4. Instalar o detector visual TinyYOLO pip install torch torchvision git clone https://github.com/AlexeyAB/darknet cd darknet make wget https://github.com/AlexeyAB/darknet/releases/download/yolo4tiny/yolov4-tiny.weights ./darknet detector test cfg/coco.data cfg/yolov4-tiny.cfg yolov4-tiny.weights - Crie um script detect_ad.py que recebe um frame, roda darknet e devolve a probabilidade de anúncio. 5. Script de orquestração (Python) import mitmproxy.http import subprocess, json, base64 def request(flow: mitmproxy.http.HTTPFlow): url = flow.request.pretty_url # 1. Classificação textual llm_cmd = ["./llama.cpp/main", "-m", "/opt/llm/llama2.bin", "-p", f"Classifique a URL {url}"] result = subprocess.check_output(llm_cmd).decode() if "anúncio" in result.lower(): flow.response = mitmproxy.http.HTTPResponse.make( 200, b"", {"Content-Type": "video/mp4"} ) return # 2. Detecção visual (apenas para fluxos HLS/DASH) if flow.response and flow.response.content_type.startswith("video"): frame = extract_frame(flow.response.content) # função simplificada prob = subprocess.check_output( ["python3", "detect_ad.py", "--frame", base64.b64encode(frame).decode()] ) if float(prob) > 0.85: flow.response = mitmproxy.http.HTTPResponse.make( 200, b"", {"Content-Type": "video/mp4"} ) - Salve em /opt/blocker/blocker.py e inicie o mitmproxy: mitmproxy -s /opt/blocker/blocker.py --mode transparent. 6. Testar e ajustar - Reproduza um canal com anúncios. - Observe os logs do mitmproxy; se houver falsos positivos, ajuste o limiar (0.85) ou adicione novas palavras‑chave ao prompt do LLM. --- Dicas de otimização | Área | Estratégia | |------|------------| | CPU | Use a variante quantizada q4_0 do Llama‑2; reduz o uso de RAM para ~4 GB. | | GPU (se houver) | Ative CUDA no Darknet (GPU=1 no Makefile) para acelerar a detecção visual. | | Cache de URLs | Armazene resultados de classificação por 10 min para evitar chamadas repetidas ao LLM. | | Fallback | Caso o modelo falhe, bloqueie a requisição por padrão; isso garante que nenhum anúncio passe. | --- Conclusão Com a combinação de um proxy local, um LLM leve e um detector visual TinyYOLO, você pode eliminar anúncios das transmissões da sua Smart TV sem depender de serviços externos. O setup funciona em dispositivos de borda de baixo custo, respeita a privacidade do usuário e ainda reduz o consumo de banda. Experimente, ajuste os parâmetros ao seu ambiente e desfrute de maratonas livres de interrupções! --- Herramienta mencionada: Groq Cloud

  2. Build an AI-Powered Ad Blocker for Any Smart TV in 2024 AI‑Powered Ad Blocker for Smart TV 2024 — A Hands‑On Guide Inspired by Hipertextual & Xataka --- Introduction Imagine watching your favorite 4K series without a single pre‑roll or banner stealing bandwidth and patience. In 2024 that vision is no longer a hype article—it’s a ready‑to‑run solution you can install on any modern TV, a Raspberry Pi, or a spare home‑NAS. After the viral Hipertextual and Xataka tutorials, searches for “smart TV ad blocker” and “AI remove ads TV” spiked to breakout status on Google Trends. This guide shows you exactly how to assemble the stack, configure the network proxy, and tune the on‑device AI so you can start blocking ads today. We also share real‑world performance numbers so you can decide whether the setup fits your hardware and bandwidth constraints. --- Quick‑Start Overview | Step | What you’ll do | Approx. time | |------|----------------|--------------| | 1️⃣ | Prepare a low‑cost edge device (Raspberry Pi 4, Intel NUC, or Android TV box) | 5 min | | 2️⃣ | Install the lightweight LLM (7‑B GGML INT8) and TinyYOLO‑v4 detector | 10 min | | 3️⃣ | Deploy a MITM proxy (mitmproxy) that routes TV traffic through the AI filter | 5 min | | 4️⃣ | Add a few simple rules to block detected ads | 2 min | | 5️⃣ | Test on your TV and enjoy a cleaner stream | – | --- 1. Hardware & OS Requirements | Device | Minimum specs | Why it works | |--------|---------------|--------------| | Raspberry Pi 4 (4 GB) | 4 GB RAM, 64‑bit Raspberry OS | Quantized 7‑B LLM fits in ~1.2 GB; TinyYOLO‑v4 runs at 30 fps with NEON | | Intel NUC (i5‑8259U) | 8 GB RAM, Ubuntu 22.04 | Faster CPU, optional GPU acceleration via OpenVINO | | Android TV box (Amlogic S905X3) | 2 GB RAM, Android 11 | Use Termux + proot for Linux environment (advanced) | | Home NAS (Synology DS920+) | 4 GB RAM, Docker support | Run everything inside containers, no extra hardware needed | > Tip: If you already have a spare SSD‑based NAS, the Docker route is the cleanest—no OS changes, easy updates. --- 2. Install the AI Stack Below are the exact commands for a Raspberry Pi running Raspberry OS (64‑bit). Adjust package names for other distros. # 1️⃣ Update & install dependencies sudo apt update && sudo apt install -y git build-essential cmake python3-pip ffmpeg libopencv-dev # 2️⃣ Install llama.cpp (quantized LLM runtime) git clone https://github.com/ggerganov/llama.cpp cd llama.cpp make -j$(nproc) # 3️⃣ Download a 7‑B GGML INT8 model (e.g., LLaMA‑2‑7B‑Chat) wget https://huggingface.co/TheBloke/Llama-2-7B-Chat-GGML/resolve/main/llama-2-7b-chat.ggmlv3.q4_0.bin -O models/llama-2-7b-chat.ggmlv3.q4_0.bin # 4️⃣ Install TinyYOLO‑v4 (ONNX + OpenCV DNN) pip3 install --upgrade pip pip3 install opencv-python-headless onnxruntime # 5️⃣ Clone the ad‑filter repo (contains detection scripts & config) git clone https://github.com/yourname/smart-tv-ad-filter.git cd smart-tv-ad-filter pip3 install -r requirements.txt TinyYOLO‑v4 model download wget https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4-tiny.weights wget https://raw.githubusercontent.com/AlexeyAB/darknet/master/cfg/yolov4-tiny.cfg python3 convert_to_onnx.py yolov4-tiny.cfg yolov4-tiny.weights yolov4-tiny.onnx > Why these models? The 7‑B LLM handles textual ad cues (e.g., “Sponsored”, “Ad”) while TinyYOLO‑v4 spots visual overlays (logo watermarks, banner boxes) in the video stream. Both run under 2 GB RAM when quantized. --- 3. Set Up the Network Proxy We use mitmproxy as a transparent man‑in‑the‑middle (MITM) that forwards TV traffic through a Python filter script. # Install mitmproxy sudo apt install -y mitmproxy # Create a systemd service (optional but recommended) cat <<EOF | sudo tee /etc/systemd/system/mitmproxy.service [Unit] Description=MITM Proxy for AI TV Ad Blocking After=network-online.target Wants=network-online.target [Service] User=pi ExecStart=/usr/bin/mitmproxy -p 8080 --mode transparent --set block_global=false -s /home/pi/smart-tv-ad-filter/filter.py Restart=on-failure [Install] WantedBy=multi-user.target EOF sudo systemctl daemon-reload sudo systemctl enable --now mitmproxy filter.py – the heart of the blocker import json import cv2 import numpy as np from pathlib import Path from mitmproxy import http # Load TinyYOLO‑v4 ONNX model once net = cv2.dnn.readNetFromONNX("/home/pi/smart-tv-ad-filter/yolov4-tiny.onnx") net.setPreferableBackend(cv2.dnn.DNN_BACKEND_OPENCV) net.setPreferableTarget(cv2.dnn.DNN_TARGET_CPU) # Load LLM (llama.cpp wrapper) from llama_cpp import Llama llm = Llama(model_path="/home/pi/llama.cpp/models/llama-2-7b-chat.ggmlv3.q4_0.bin", n_ctx=512) def detect_visual_ad(frame: np.ndarray) -> bool: blob = cv2.dnn.blobFromImage(frame, 1/255.0, (416, 416), swapRB=True, crop=False) net.setInput(blob) outs = net.forward() for detection in outs[0,0]: confidence = float(detection[2]) if confidence > 0.45: # tuned for ad overlays return True return False def detect_textual_ad(chunk: bytes) -> bool: # Simple heuristic: run LLM on extracted subtitles / captions prompt = f"Is the following text an advertisement?\\n\\n{chunk.decode(errors='ignore')}" resp = llm(prompt, max_tokens=5, stop=["\\n"]) return "yes" in resp.lower() def response(flow: http.HTTPFlow) -> None: # Only inspect video segments (MPEG‑TS, MP4 fragments) if "video" not in flow.response.headers.get("content-type", ""): return # Grab first few KB for quick analysis sample = flow.response.content[:8192] # 1️⃣ Visual detection (decode a frame) nparr = np.frombuffer(sample, np.uint8) img = cv2.imdecode(nparr, cv2.IMREAD_COLOR) if img is not None and detect_visual_ad(img): flow.response = http.HTTPResponse.make(204, b"", {}) # drop segment return # 2️⃣ Textual detection (captions/subtitles) if detect_textual_ad(sample): flow.response = http.HTTPResponse.make(204, b"", {}) > How it works: > * The proxy intercepts every HTTP/HTTPS chunk that the TV requests. > * For video payloads it extracts a tiny thumbnail and runs TinyYOLO‑v4. > * If subtitles are present, the LLM evaluates whether the text is promotional. > * Detected ad chunks are replaced with a 204 No Content response, effectively skipping them. --- 4. Wire Your TV to the Proxy 1. Router method (transparent) – Most home routers allow you to set a static route for the TV’s IP pointing to the Pi’s IP on port 8080. Example for OpenWrt: uci add firewall redirect uci set firewall.@redirect[-1].src='lan' uci set firewall.@redirect[-1].src_dport='80,443' uci set firewall.@redirect[-1].dest='192.168.1.42' # Pi IP uci set firewall.@redirect[-1].dest_port='8080' uci commit firewall /etc/init.d/firewall restart 2. Manual DNS method – Install --- Herramienta mencionada: Groq Cloud

Latest stargazers

The last 10 distinct accounts we observed this year.

Most active participants

PR, issue, comment & review events in the past year.

Packages

1
PackageVersionDownloads · 30dTrend · 30d
———

README badges

Embed a badge in your README or website.

  • AlexeyAB/darknet reached #1 in daily stars on gitwal · Apr 24, 2020
  • AlexeyAB/darknet reached #1 in daily forks on gitwal · Apr 24, 2020
Live mentions · last 30 days
AlexeyAB/darknet mentions in the last 30 days