Deep learning–powered object detection framework using YOLOv8 for defense and surveillance applications.
ArgusAI is a web-based intelligent vision system built with Flask and YOLOv8.
It allows users to upload images and automatically detect and classify various military and civilian vehicles and aircraft.
The model is trained on a custom defense dataset featuring six distinct object classes.
(Video inference functionality coming soon!)
- 📸 Upload an image through an intuitive web interface
- 🤖 Object detection powered by YOLOv8 (Ultralytics)
- 🧩 Detects both civilian and military vehicles/aircraft
- 💾 Automatically processes and displays detection results
- 🧠 Modular design separating model logic and Flask routes
- ⚡ Real-time inference with bounding boxes and confidence scores
- Model Architecture: YOLOv8 (PyTorch, Ultralytics)
- Trained Weights:
best.pt - Classes:
- Civilian Aircraft
- Civilian Car
- Military Aircraft
- Military Helicopter
- Military Tank
- Military Truck
- Framework: PyTorch
- Backend Integration: Flask
-
User Uploads Image
- The image is sent from the HTML form to the Flask backend (
app.py). - On form submission, a POST request is sent to the Flask backend (
/predictroute). - The uploaded image is accessed in Flask and saved to
/uploadsfolder.
- The image is sent from the HTML form to the Flask backend (
-
Flask Handles Request
- After the image is saved the flask calls the YOLO inference function
yolo_model.predict. - The annotated image path is returned and stored in the variable
processed_image_path.
- After the image is saved the flask calls the YOLO inference function
-
YOLO Inference
- The
predict(image_path)function inyolo_model.pyis called and it performs detection. - Then after this a full output path is generated for locating the annotated image.
- This full output image path is stored in
processed_image_pathas mentioned earlier.
- The
-
Result Generation
- The processed image with bounding boxes and class labels is saved to the
runs/detect/predict/folder.
- The processed image with bounding boxes and class labels is saved to the
-
Result Display
- Flask dynamically loads and renders the processed image on the webpage using the
result.htmlpage.
- Flask dynamically loads and renders the processed image on the webpage using the
| Component | Technology |
|---|---|
| Frontend | HTML, CSS (Jinja2 Templates) |
| Backend | Flask (Python) |
| Model | YOLOv8 (Ultralytics) |
| Framework | PyTorch |
| Inference | Custom YOLO model integrated with Flask |
- Initializes the Flask application
- Handles image upload and result rendering
- Connects the user interface with YOLO inference logic
- Contains all YOLOv8 inference code
- Loads model weights (
best.pt) and performs detection - Returns the path to the output image for display
- Lists all Python dependencies (Flask, Ultralytics, Torch, OpenCV, etc.)
- Contains the code for landing page and image uploading.
- Contains the code for displaying the annotated image.
- ultralytics
- pandas
- numpy
- fastapi
- jinja2
- python-multipart
The repository include the frontend code (index.html & result.html), backend code(app.py), Yolo training and inferencing code(yolo_model.py) as well as trained model weights i.e best.pt.
Since the trained model weights (best.pt) are already included, users can directly run inference without retraining the model.
- Clone the repository.
- Then replace the
model_pathwith the appropriate directory path. - Create a seperate
uploadsfolder to save the uploaded images. In case you haven't, theapp.pywill generate the folder if it doesn't exist. - By default, the annotated image is stored in /runs/detect/predict due to
save=Trueinyolo_model.py.