This is a Python project that subscribes to a RabbitMQ queue and waits for messages containing picture IDs. The picture is downloaded from a MongoDB database and then segmented. The segmented picture is saved back to the MongoDB database.
Below is the UML diagram for the project:
This project can be run using either Poetry or Docker.
- Install Poetry on your system.
- Clone this repository to your local machine.
- Navigate to the project root directory.
- Run
poetry install
to install the project dependencies.
- Install Docker on your system.
- Clone this repository to your local machine.
- Navigate to the project root directory.
- Build the Docker image by running
docker build -t rabbitmq-subscriber .
.
Before running the project, you will need to set up the config file image_segmentation/config.py
and set up environment variables, have a look at file .env.template
- Activate the virtual environment by running
poetry shell
. - Start the subscriber by running
python program/main.py
.
- Start the subscriber by running
docker run -it rabbitmq-subscriber
.
The subscriber will start listening to the RabbitMQ queue and waiting for messages. When a message containing a picture ID is received, it will download the picture from the MongoDB database, segment it using the segmentation model specified in the configuration file, and then save the segmented picture back to the MongoDB database.
This project is licensed under the MIT License - see the LICENSE file for details.