As part of my exploration into computer vision, I developed a personnal project focused on object detection using the YOLO (You Only Look Once) model with the OpenCV (cv2) library. The goal was to detect and recognize pieces from various board games in real-time.
To begin, I searched for publicly available datasets online that featured board game pieces. However, to enrich the diversity and specificity of the dataset, I also took photos of pieces from my own board games (like Carcassonne). This allowed me to tailor the dataset more closely to the objects I wanted the model to recognize.
Once the images were collected, I performed preprocessing tasks to clean the data. This included resizing all images to a consistent format, adjusting lighting where necessary, and converting them to suitable color formats. The goal was to create a uniform and clean dataset for better model performance.
To increase the size and variability of the dataset, I applied data augmentation techniques such as rotation, flipping, zooming, and brightness adjustments. This helped the model generalize better and improved its robustness in different real-world scenarios.
I then used the YOLO algorithm for training the object detection model. YOLO is well-suited for real-time applications due to its speed and accuracy. Training was conducted on the augmented dataset, using appropriate annotations for the various board game pieces.
To test the model in a user-friendly and interactive way, I developed a simple web application using Flask. The application connects to a webcam and allows real-time detection of board game pieces using the trained YOLO model. This provided a practical demonstration of the system’s capabilities.