This project created for Beykent University's Computer Science Community.
Main part of this project is removing the background of an image and replacing it with different image while resizing and repositioning.
Steps
RabbitMQ
This is the main part for communicating client and server
- Run the Docker Desktop Client
You can use it from the terminal but I prefer this way to run docker images.
- Run the RabbitMQ container command supplied from official RabbitMQ docs.
docker run -it --rm --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:4.0-management
Python Server
This is the server that removes the background of the image
- Open new terminal and navigate to project's directory
Or simply open the project's directory in an editor and open the terminal in there
- Install the dependencies for server with included Makefile. Run this command
make serverDep
- Run the server with this command
make server
Now the server is ready for requests
Golang Client
This is the client that processes images and places, resizes them.
The golang client accepts images from resources folder with proper naming and extension.
image.jpg
for the image that you want to remove it's background and background.jpg
for the image you want it to be the background.
[!WARNING] The naming conventions is important. And just use .jpg for input images. Or you can get errors while processing
- Open another terminal and navigate to project's directory
Or simply in the editor, open a new terminal
- Run the client with this command
make run
Ta daa! you successfully generated an image!
[!IMPORTANT] Generated images saves to
resources/gen
directory. You can find it here withgenerated.png
name.