AI-powered graffiti detection built on YOLOv8 for training, inference, surveillance, alerting, and API integration.
Built for municipalities, property managers, security teams, and developers who need a practical computer vision pipeline for detecting graffiti in the field.
I built this project to help teams detect graffiti earlier, respond faster, and reduce the operational cost of vandalism. The focus is not just model training, but a usable end-to-end workflow that can plug into real monitoring and reporting pipelines.
- Train YOLOv8 models on graffiti datasets in YOLO format
- Run inference on images, folders, videos, and live webcams
- Monitor multiple camera feeds and trigger alert channels automatically
- Expose a FastAPI service for integration with existing systems
- Log incidents for downstream reporting and operational follow-up
- Trains YOLOv8 models on graffiti datasets (YOLO annotation format)
- Runs inference on single images, folders, videos, and webcam streams
- Monitors multiple cameras in real time and triggers alert channels
- Exposes a FastAPI service for integration with existing systems
- Logs incidents to SQLite/JSON and supports daily reporting
- End-to-end pipeline in one repo: data prep -> training -> inference -> surveillance -> API -> incident tracking
- Production-oriented scripts (not notebook-only)
- Alert channel support: email, SMS, webhook, Discord, Slack
- Test coverage across data, metrics, alerts, visualization, incident logging, and integration
- City maintenance and anti-vandalism monitoring pilots
- Property and facility surveillance workflows
- AI engineers who want a packaged YOLOv8 graffiti detection baseline
- Teams that need both Python package usage and runnable scripts
- Python 3.8+
- CUDA-capable GPU (recommended for training / real-time workloads)
- Dataset in YOLO format (
class x_center y_center width height)
Choose the setup that matches your use case.
Install from PyPI for package usage:
pip install graffiti-detection-ai-modelInstall from source if you want the full training, scripts, and deployment workflow:
git clone https://github.com/EfficientTools/graffiti-detection-ai-model.git
cd graffiti-detection-ai-model
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txtQuick import example:
from graffiti_detection import GraffitiDetector
detector = GraffitiDetector("models/best.pt")
detections = detector.predict("image.jpg")python scripts/prepare_dataset.py --data-dir data/raw --output-dir data --validate --copypython scripts/train.py --data configs/dataset.yaml --model yolov8n --epochs 100python scripts/inference.py --model models/best.pt --source image.jpg
python scripts/inference.py --model models/best.pt --source 0 --showpython scripts/evaluate.py --model models/best.pt --data configs/dataset.yaml --split testUse the example configs as a base:
cp configs/cameras_example.json configs/cameras.json
cp configs/alerts_example.json configs/alerts.jsonRun multi-camera monitoring:
python scripts/multi_camera_surveillance.py \
--model models/best.pt \
--cameras configs/cameras.json \
--alert-config configs/alerts.jsonOptional utilities:
python scripts/real_time_dashboard.py --stats-file outputs/stats.json
python scripts/incident_logger.py --action stats --period todayStart API service:
uvicorn api.graffiti_detector:app --host 0.0.0.0 --port 8000Main endpoints:
GET /POST /detectPOST /detect/annotatedPOST /detect/batchGET /stats
python tests/run_tests.py
# or
pytest tests/For Docker/Compose/Kubernetes/edge/cloud setup, see DEPLOYMENT.md.
api/ FastAPI service
configs/ Dataset, training, cameras, alerts configs
graffiti_detection/ Public Python package
scripts/ Training, inference, evaluation, surveillance, dashboard tools
src/ Backward-compatible internal modules
tests/ Unit and integration tests
Pierre-Henry Soria
Passionate software AI engineer building intelligent systems to solve real-world problems.
☕️ Enjoying this project? Buy me a coffee to support more AI innovations!
This project is distributed under the MIT License.
This model is intended to assist maintenance and urban management teams. Always comply with local privacy and surveillance regulations when deploying computer vision systems.