Skip to content

Perform custom object detection using YOLO algorithm and deploy it via web app in Python

Notifications You must be signed in to change notification settings

diardanoraihan/Web_App_Object_Detection

Repository files navigation

Web App Object Detection

Perform custom object detection using YOLO algorithm and deploy it via web app in Python

Packages Installation on Mac

  • Create your python virtual environment

pip3 install virtualenv

python3.9 -m venv yolo_env (Note: to work with labelImg, the stable version of Python is 3.9)

  • Install all packages in the requirements.txt file

pip3 install -r requirements.txt

  • [Optional] Install prerequisites of labelImg package in our system to help us labeling the image

brew install libxml2

brew install qt5

brew link qt5 --force

  • [Optional] Install labelImg package in your newly-created python environment

source <python_virenv>/bin/activate

pip3 install --upgrade pip

pip3 install pyqt5 --config-settings --confirm-license= --verbose

pip3 install labelImg

  • [Optional] Check the list of installed packages

pip list

  • Run the main_object_detection_[image/realtime].py using yolo_env Python environment.

What is Object Detection?

Classification

  • For a simple classification task, the images generally have a single dominant object and the whole image is classified accordingly.

image

Localization

  • It is the next step of classification technique. To find the position of object in the image, we require the object to be localized.
  • This localization is performed using regression provides bounding box (x_min, y_min, x_max, y_max).

image

Object Detection

  • Object detection in simple words finds objects in image and categorizes or classifies them.

image

- __Bounding Box Coordinates__: the bounding boxes of the objects detected in the coordinates. - __Labels__ labels or class names of the bounding boxes predicted above - __Confidence Scores__ confidence or probability scores of the classes detected

image

Detection

  • Detection is the case of identifying or detecting objects in images.
  • It includes both the task mentioned before and can be better understood in case of images with multiple objects to be detected.

image

Evaluating Object Detection Model

image

There are two major evaluation techniques that will perform for object detection model:

  • Intersection Over Union (IoU)
  • mean Average Precision (mAP)

Intesection Over Union

image

  • In general, IoU > 50% is consider as good prediction. (~ mAP 0.5)

mean Average Precision (mAP)

  • In order to understand mAP, let's familiarize again with a confusion matrix as the representation for object detection model.

image

  • True Positive:

    • IoU > 50% (~ mAP 0.5)
    • Both belong to the correct class
  • False Negative:

    • IoU > 50% (~ mAP 0.5)
    • Incorrect class prediction
  • False Positive:

    • IoU < 50%
    • Correct class prediction
  • True Negative:

    • No detection when there is no object.

image

To evaluate object detection models like R-CNN and YOLO, the mean average precision (mAP) is used. The mAP compares the ground-truth bounding box to the detected box and returns a score. The higher the score, the more accurate the model is in its detections. (Source: https://blog.paperspace.com/mean-average-precision/)

FAQ:

About

Perform custom object detection using YOLO algorithm and deploy it via web app in Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published