Skip to content

OpenCV, AI and Python code displaying a working GUI where gloves are inspected and if there are any defects it would measure it.

Notifications You must be signed in to change notification settings

kntb0107/glove_defect_detector

Repository files navigation

Glove Defect Measurement System

Due to the COVID-19 rampage which has now become our daily lives, the usage of these medical gloves has increased in production. It is important to make sure that the gloves are sterile and are not riddled with an defects, and when there is one then it should be taken care of immediately. This project was inspired with that in mind, and the problem was simplified to make this system to work.

The final program works with both OpenCV and AI, where the defect gets measured in mm, the hand oreintation is mentioned and the probability of whether the hole is small, medium or large is displayed. They are displayed and detected live on webcam.

PYTHON FILES

  1. contour_measurement.py : detecting the hand oreintation + measuring the contours using OPENCV
  2. detect.py : using custom trained YOLOv5 weights, the probabilities of the sizes are detected. multiple holes can be detected.
  3. combined.py : both 1 and 2 python files are combined to produce both results at the same time.

NOTEBOOK FILE

  1. train_model.ipynb : training the custom dataset to create a custom yolov5 weight for detection purposes.

Dataset used

  • custom dataset used
  • same colored gloves
  • drawn on marker holes on white gloves
  • male subject for photography
  • annotated in Roboflow

HOW TO RUN THE THE COLAB AND DETECT.PY FILE

Download the dataset and then make sure you upload the dataset inside the yolov5 folder.

Results

opencv_mes.py detects both the hand orientation and measures the contours. image

detect.py detects the sizes and its probabilites. for now, it only detects in three sizes. image

About

OpenCV, AI and Python code displaying a working GUI where gloves are inspected and if there are any defects it would measure it.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published