Simple object recognition worker configured to perform face blur on jpg images fed via a RabbitMQ message queue.
The code is part of the final exam of the free anynines Kubernetes Tutorial. Therefore, the code is not meant to be production grade and contains refactoring TODOs that learners may engage with.
The worker performs the following steps
- Connect to RabbitMQ
- Retrieve a job (message)
- Retrieve the image
- Start image processing
- Upload the image
- Acknowledge the message (and thus remove it from the queue)
Read the source code for further information.
Example:
docker build -t facerecognition-yolo:dev .
Example:
docker tag facerecognition-yolo:dev fischerjulian/facerecognition-yolo:dev
docker push fischerjulian/facerecognition-yolo:dev
As a oneliner:
docker build -t facerecognition-yolo:dev . && docker tag facerecognition-yolo:dev fischerjulian/facerecognition-yolo:dev && docker push fischerjulian/facerecognition-yolo:dev
Example:
docker run --rm -it --name facerecognition-yolo facerecognition-yolo bash
Inside the container run:
cd python3 yolo_opencv.py --image /tmp/object_recognition/original-image.jpg --config yolov3.cfg --weights yolov3.weights --classes yolov3.txt
This will produce output file: /tmp/object_recognition/filtered-image.jpg
wget https://pjreddie.com/media/files/yolov3.weights