How bhavishyasingla1/drone_detection_webapp works
Main Components
a. Client (Web Browser)
b. Flask Web Server (app.py)
c. Model Inference Engine
• YOLOv8 model file (yolov8n_trained.pt)
• OpenCV + PyTorch libraries
d. Webcam Input (local hardware)
e. HTML/CSS/JS Frontend (templates/index.html)
f. External Dependencies (Flask, OpenCV)
Relationships and Data Flows
• The browser loads the HTML page (GET /) served by Flask.
• JavaScript in the page captures webcam frames and sends them (via WebSocket/AJAX/Fetch) to the Flask server for processing.
• Flask receives a frame, passes it to the Model Inference Engine.
• The Model Inference Engine (OpenCV + PyTorch) loads yolov8n_trained.pt, runs detection, returns annotated frames or detection metadata.
• The front-end renders the returned data in real time.
Architectural Patterns and Principles
• Separation of concerns:
• Presentation layer (templates + JS)
• Business logic + routing (Flask app.py)
• Inference layer (model + CV code)
• Stateless HTTP or WebSocket interactions for each frame
• Model as a backend service component (could be extracted into its own microservice if the app grows)
Relevant Technologies
• Flask for routing and templating
• OpenCV for image capture/preprocessing
• PyTorch (via ultralytics/yolov8) for model inference
• HTML/CSS/JavaScript for UI and real-time streaming
• requirements.txt lists all Python deps
Checklist
• Title (“Drone Detection Web App Architecture”) and date/version