Sign inSign up

tomsriddle/cv-objectdetection

By tomsriddle

•Updated over 2 years ago

Repository to demonstrate usage of Deep Neural Networks in Computer Vision for object detection

Image
0

104

tomsriddle/cv-objectdetection repository overview

⁠Graphical Degrading and Object Detection Assignment

⁠Overview

The Git repository (https://github.com/shaileshhemdev/hemdev-705.603Spring24/tree/master/cvbasicsAssignment-main⁠) contains an implementation of the OpenCV2 Deep Neural Network using YOLO model for object detection in images. It has the following key files

  • Notebook (ObjectDetection.ipynb): In this notebook we demonstrate how certain reduction techniques on images can impact the object detection
  • Python Class (object_detection.py): This class encapsulates the Deep Neural Network implementation to return the objects detected on a given image with the corresponding confidences and bounding boxes
  • Flask Service (object_detection_service.py): This provides a REST service to post any image to the service to obtain the objects detected along with their confidence

⁠Local Development Environment used for building image

  • Apple Mac M1 chip
  • Sonoma 14.1.2
  • Docker Desktop for Mac 4.26.1 (131620)

⁠Running on Local

⁠How to use the image using Docker

⁠Pull Image

To pull an image use the following

docker pull tomsriddle/cv-objectdetection:1.0

After pulling the image check that it is present using following

docker image ls

⁠Build Image from Local
docker buildx build -t "tomsriddle/cv-objectdetection:1.0" --load --platform linux/amd64,linux/arm64 .

⁠Run Image

To run the image use following

docker run -p <host port>:8786 -v <host path>:/workspace/shared-data -e data-folder=/workspace/shared-data/ "tomsriddle/cv-objectdetection:1.0" 

Note: See the volume mapping - this is needed for the saving of the image for the POST API. This volume should have the yolov3.cfg and yolov3.weights files as shown below

Image Not Showing

⁠Docker Image and Run Example

Image Not Showing

⁠API Usage

Following APIs exposed

⁠Detect
http://localhost:8786/detect

We need to submit form-data with image submitted as imagefile attribute

⁠Detect Example

Image Not Showing

⁠Detect Example in Docker

Image Not Showing

Notice how when you make the call the sent image is saved on your volume

Image Not Showing

Tag summary

Content type

Image

Digest

sha256:1641df410…

Size

904.3 MB

Last updated

over 2 years ago

docker pull tomsriddle/cv-objectdetection:1.0