Skip to content

StevieG47/Object-Detection-Classification

Repository files navigation

Object Detection Using Pre-trained models

Using OpenCV's dnn module with pre-trained models from tensorflow and caffe

python detectVideo.py --method caffe --file office.mp4

office

This will show the object detection on screen and output a video in the output directory. Using detectImage on an image file will output an image in the output directory.

Custom Object Detection

Using a custom trained object detector, a stop sign detector and bison detector were done following the tutorial here. The detectImage and detectVideo scripts can use these detectors instead of the pre-trained caffe/tensorflow ones.

python detectImage.py --method trafficSign --image images/stopSign.jpg

detectimage-output

python detectVideo.py --method trafficSign --file stopSign.mp4

stopgif

python detectImage.py --method bison --image images/bison.jpg

detectimage-output1

python detectVideo.py --method bison --file bison.mp4

bison

Notes

  • Arguments for detectVideo are --method, which is caffe, tensorflow, trafficSign or bison, and --file, which is the path to the video
  • Arguments for detectImage are --method, which is caffe, tensorflow, trafficSign or bison, and --image, which is the path to the image
  • Arguments for detectWebcam are --method, which is caffe or tensorflow
  • The training for the bison detector had to be stopped early due to an error, so as of right now it is not great (it will think pretty much anything is a bison)
  • The stop sign model does better than the bison one, but is still far from perfect

References

https://www.pyimagesearch.com/2017/09/18/real-time-object-detection-with-deep-learning-and-opencv/ https://pythonprogramming.net/introduction-use-tensorflow-object-detection-api-tutorial/
https://github.com/tensorflow/models

About

Image classification, object detection in tensorflow and opencv

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published