How igli333/ppe-detection-solution works
Main Components
• Frontend: The “ppe-frontend” directory contains a ReactJS application. This serves as the user interface to show live video streaming, dashboards, notifications, and statistics.
• Microservices: There are several microservices, each in its own directory:
• ms-ml: Implements the YOLO-based detection model (YoloRecognitionModel.py) and encapsulates the AI/ML aspects.
• ms-data-processing: Responsible for pre-processing or segmenting data frames (DataProcessingService.py) before sending them for analysis downstream.
• ms-gateway: Acts as the central communication hub with components such as KafkaConsumer, NotificationPropagator, User modules, and UsersService.
• ms-notification: Manages alert distribution and notifications (app.py in ms-notification).
• ms-streaming: Likely handles the streaming portion where incoming video feeds are processed and transmitted (app.py in ms-streaming).
• ms-validation: Provides additional checks or post-processing on detected PPE (ValidationService.py).
• Messaging/Integration: Though not a node on its own in the file tree, the README clearly states the use of a Kafka cluster as the message broker to which real-time video frames are published and consumed.
• Datasets & Training: The “preprocessed_dataset” directory and “training.ipynb” hint that there is an offline dataset and model training facility contributing to the ML aspects.
Relationships and Interactions
• Data Flow:
• Video frames captured at the edge (external cameras) are sent into a Kafka cluster.
• The ms-ml service consumes frames from Kafka for PPE detection.
• The resulting detections are routed through ms-data-processing and ms-validation for further processing or verification.
• ms-gateway acts as the integration point; it reads from Kafka (as indicated by KafkaConsumer) and directs notifications via the ms-notification service.
• ms-streaming then provides processed frames/data to the frontend for live streaming.
• API/Service Calls:
• The ms-gateway service might also handle user management and expose APIs to the frontend.
• Communication between services will be managed over network protocols (REST, messaging via Kafka, etc.), and container deployments are managed via Docker/Docker Compose.
Architectural Patterns & Technologies
• Microservice Architecture: Each service is separately containerized (each has its own Dockerfile) and encapsulates domain-specific functionality.
• Event-Driven Architecture: The use of Kafka indicates an event-driven or messaging-based system for real-time data flow.
• Frontend/Backend Separation: Clear separation between the ReactJS frontend and several backend microservices.
• Containerization and Orchestration: Deployment via Docker and Docker Compose.
• Clearly label interactions (synchronous API calls vs. asynchronous messaging).
• Incorporate any dependencies depicted in the README (for example, the screenshots indicate key UI components and the overall pipeline).
Happy designing!