Repository to demonstrate usage of Deep Neural Networks in Computer Vision for object detection
104
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
You need git, python 3.8 and pip. See https://pip.pypa.io/en/stable/installation/
It is recommended that you use Python virtual environments. See https://www.freecodecamp.org/news/how-to-setup-virtual-environments-in-python/
Run pip3 install -r requirements.txt
Run python object_detection_service.py
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
docker buildx build -t "tomsriddle/cv-objectdetection:1.0" --load --platform linux/amd64,linux/arm64 .
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


Following APIs exposed
http://localhost:8786/detect
We need to submit form-data with image submitted as imagefile attribute


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

Content type
Image
Digest
sha256:1641df410…
Size
904.3 MB
Last updated
over 2 years ago
docker pull tomsriddle/cv-objectdetection:1.0