This Repo contains a Box Detection Application capable of identifying box containers in conveyor belt pictures.
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.
- 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.