How manojgowda2000/sign-detection-using-yolo works
Project Type and Purpose
• This is a Python‑based machine‑learning project (“Sign‑detection‑using‑YOLO”) that bundles both an MLOps training pipeline and a simple serving layer (app.py likely spins up a Flask service for inference).
• The pipeline automates data ingestion, validation, model training and pushing; the app provides a runtime API or UI to perform sign detection using a trained YOLO model.
File‑Structure Analysis
• Top‑level scripts:
• app.py – launches the inference service (Flask API or web UI).
• data_collector.py – gathers or simulates raw images for training/validation.
• template.py + template/index.html – frontend template for a basic UI.
• signLanguage package (the core pipeline library):
• components/ – four pipeline stages: data_ingestion, data_validation, model_trainer, model_pusher.
• configuration/ – code to read config files and perform S3 operations.
• entity/ – data classes for artifacts and configuration.
• pipeline/ – orchestrator (training_pipeline.py) that ties component stages together.
• utils/ – common utilities, file‑io, YAML parsing, etc.
• constant/ – application‑wide constants, folder paths, pipeline names.
• exception/, logger/ – custom error handling and logging.
• Infrastructure:
• Dockerfile, .dockerignore – containerization support.
• requirements.txt, setup.py – packaging and dependencies.
• data/ – local storage for ingested / processed datasets.
Key README Insights
• Confirms that the main entry point for serving is app.py.
Main Components
a. Data Collection Layer
• “data_collector.py” – raw data ingestion (could point at camera or directory).
• Local storage (“data/” directory).
b. Training Pipeline (MLOps)
• Pipeline Orchestrator – signLanguage.pipeline.training_pipeline
• Components:
– DataIngestion
– DataValidation
– ModelTrainer (trains YOLO network)
– ModelPusher (serializes model & uploads to S3 via signLanguage.configuration.s3_operations)
c. Model Registry / Artifact Storage
• AWS S3 (external service) – stores trained weights and metadata.
d. Serving Layer (Inference)
• app.py (Flask or similar) – loads model from S3 or local cache.
• template/index.html – simple user interface to upload images or stream video.
• YOLO inference engine (a third‑party library called within app.py).
e. Supporting Services
• Logging service – signLanguage.logger writes logs to console or file.
• Configuration loader – YAML/JSON configs read by signLanguage.configuration.
Relationships and Interactions
• Data flows from DataCollector → DataIngestion → DataValidation → ModelTrainer → ModelPusher → S3.
• The Serving Layer (app.py) pulls the latest model from S3 (or local folder) and interacts with users or clients.
• Utility & logging components support both training and serving.
Architectural Patterns and Principles
• Pipeline Pattern: each component implements a single responsibility, chained by an orchestrator.
• Layered Separation:
• Data Layer (raw + processed data)
• Training Layer (ML model lifecycle)
• Serving Layer (inference API/UI)
• Configuration‑driven design: all services use a central configuration module.
• Cloud‑native artifact storage (S3) decouples training from serving.
Technologies, Frameworks, and Libraries
• Python 3.x, Flask (or similar) for app.py web service.
• YOLO (via OpenCV/Darknet bindings) for object detection.
• Boto3 or AWS SDK for Python in signLanguage.configuration.s3_operations.
• Docker (Dockerfile) for containerization.
• PyYAML or JSON for config files.
• Standard logging module, with custom wrapper in signLanguage.logger.