This Repo contains a Box Detection Application capable of identifying box containers in conveyor belt pictures.
![](https://private-user-images.githubusercontent.com/16919762/305794511-41706bd0-428b-4199-9917-7aea3bc9fb1c.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU4NDk5MTQsIm5iZiI6MTcyNTg0OTYxNCwicGF0aCI6Ii8xNjkxOTc2Mi8zMDU3OTQ1MTEtNDE3MDZiZDAtNDI4Yi00MTk5LTk5MTctN2FlYTNiYzlmYjFjLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA5VDAyNDAxNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM5MjZjMzE1ZTUxYTY2MDU4ODJiY2RjNDFkMjkyYjE3YjY1ZmZlZDYyNmFlMmI2YjRkNjE4NjM1ZGEzZGVhMzgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.3GZ7wDcg55AeX5QqHIRdD83vDKCTcVewZy5XnYkfpAg)
This project has many applications in Warehouse Inventory Management:
- Accurate Counting: Automatically count boxes on conveyor belts for real-time inventory updates, reducing manual counting errors and delays.
- Box Type Identification: Differentiate between different types of boxes based on size, shape, or markings, enabling efficient sorting and tracking.
- Damage Detection: Identify damaged boxes during transportation, allowing for quicker intervention and quality control.
- Install Docker
- Make sure Docker is installed on your system. You can download and install Docker Desktop from the official Docker website.
- Pull the Docker Image
- Open docker desktop, followed by a terminal or command prompt in your system and run:
docker pull agpsuai23/box_detection_image
- This command will download the Docker image named
agpsuai23/box_detection_image
to your local machine.
- Open docker desktop, followed by a terminal or command prompt in your system and run:
- Run the Docker Container
- Once the image is pulled, execute the following command:
docker run -p 8000:8000 agpsuai23/box_detection_image
- This command starts the container and maps port 8000 of the host to port 8000 of the container, allowing access to the application.
- Once the image is pulled, execute the following command:
- Access the Application
- Open a web browser and go to: http://localhost:8000/
- You can now interact with the Box Detection Application through the browser interface.
![](https://private-user-images.githubusercontent.com/16919762/306418153-85cfbe9b-cab4-428b-9fca-5e699ea5d8b8.jpeg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU4NDk5MTQsIm5iZiI6MTcyNTg0OTYxNCwicGF0aCI6Ii8xNjkxOTc2Mi8zMDY0MTgxNTMtODVjZmJlOWItY2FiNC00MjhiLTlmY2EtNWU2OTllYTVkOGI4LmpwZWc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwOTA5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDkwOVQwMjQwMTRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zNDUxYTZlNjMxNzQ0MDRiNTg3OTFkNTkyOGRkMzY0NjNjYjQyZjQ5NmY2MjdiNzAzYTMxODBmNzg2ZjQ1MGZmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.lwsPgbgZnYKyUwmIY6gfK-elqQDu7BkEobymUkrI6gM)
- Computer Vision based Data Science & ML
- Yolo8_Model_Creation.ipynb downloads the dataset from Roboflow, followed by training Yolov8 on train set using transfer learning, validation and test result display. We end up with a mean Average Precision (mAP) of 0.913 (90%+). Finally, the model is saved as best.pt
- Software Engineering using FAST API
- I created a FastAPI web application (main.py) to serve the saved model to customers.
- Home page (Upload_for_Detection.html) is a basic I/O based UI that lets a user upload a conveyor belt image, and when a button is clicked, the application uses the previously saved Yolo8 model to detect box containers and return the image with labels in a new page. Code can be found in main.py - @app.post("/YOLO_Box_Prediction_Website/")
- Alternatively, I also created an API functionality that can programmatically accept a conveyor belt image as input to return as output the image with labels saved in local system. Working can be found at main.py - @app.post("/YOLO_Box_Prediction_Service/"). An example of API call can be found in CUSTOM_YOLO_API_call.ipynb
- Deployment using Docker Containerization
- Finally, I deployed this FastAPI based Yolov8 application as a Docker Image (based on Dockerfile) and uploaded it to Docker Hub.
- All they need to do is to simply install Docker Desktop, pull the image from the hub, run it as a Docker container and finally access the webpage on a browser as localhost:8000
- Advantage of containerization is that all end users can avoid the hassle of installing packages mentioned in requirements.txt, which are necessary to run the application on their system.