Sanjay / DEPLOYMENT.md
TheDeepDas's picture
Yolo
6bbbfda

Marine Pollution Detection System - Deployment Guide

This guide provides instructions for deploying the Marine Pollution Detection system using YOLOv8x for optimal detection accuracy.

Deployment Preparation

Option 1: Using the Automated Script (Recommended)

  1. Run the deployment preparation script:

    For Windows:

    prepare_deployment.bat
    

    For Linux/Mac:

    chmod +x prepare_deployment.sh
    ./prepare_deployment.sh
    
  2. Build the Docker container:

    docker build -t marine-pollution-api .
    
  3. Run the container:

    docker run -p 7860:7860 marine-pollution-api
    

Option 2: Manual Deployment

  1. Clean up unnecessary files:

    • Remove all test files (test_*.py, test_files/, test_output/, etc.)
    • Remove smaller YOLO models (keep only yolov8x.pt)
    • Remove development utilities (debug_*.py, etc.)
  2. Use the production Dockerfile:

    cp Dockerfile.prod Dockerfile
    cp .dockerignore.prod .dockerignore
    
  3. Build and run the Docker container as described in Option 1.

Important Notes

  1. YOLOv8x Model: The system now exclusively uses YOLOv8x (the largest/most accurate model) for marine pollution detection. The model file will be downloaded automatically on the first run if it doesn't exist.

  2. Image Annotation: The output images now have more subtle scene annotations in small text to improve readability.

  3. Deployment Size: The Docker image is optimized to include only necessary files for production use.

  4. First Run: The first time the system runs, it will download the YOLOv8x model (approximately 136MB). Subsequent runs will use the downloaded model.

  5. Requirements: Make sure the deployment environment has sufficient memory and processing power to run YOLOv8x effectively.

Troubleshooting

  1. Model Download Issues: If the model download fails, check your internet connection. If you want to manually provide the YOLOv8x model, place the file in the root directory of the project.

  2. Performance Optimization: For better performance on low-resource environments, consider adding memory management optimizations or serving the model with ONNX Runtime.

  3. Errors: Check the logs for detailed error messages. Most issues are related to model loading or file paths.

Contact

For any deployment issues or questions, please contact the development team.