Dis-Sim is a Microservices architecture based distributed image similarity measuring system. It uses asynchronous message queue to communicate across microservices. Its distributed architecture makes it highly scalable and fault tolerant. It has a built in data monitoring and analytics service which uses Kafka as a message broker, and sqlite3 as a database. It also has a subscription based rate limiter that limits the request based on the subscription tier the user belongs
- Run
docker-compose pull && docker-compose up
to pull and start all the containers.Build from source:
docker-compose up --build
to build from the source, and not use the already built image from dockerhub. - Open the browser and navigate to
localhost:8501
. Note that8501
is the port specified in the dockerfile of thefrontend
service (src/frontend/Dockerfile
). - Use the existing credentials
username: test, password: test
. Would be soon adding frontend to register new user.
Note: Since there are multiple services spinning up, it would take a little longer for all the services to start up before you can start playing with the similarity service. The images are large, and a good internet connection is required. You can expect the whole service to spin up within 5 minutes.
Adding a custom similarity measurer is as simple as overwriding the similarity
function in the src/similarity/models
module.
# import your new similarity measurer
from my_similarity_measurer import MySimilarityMeasurer
# add your new similarity measurer in similarity method
@app.task
def similarity(img1, img2) -> float:
...
score = MySimilarityMeasurer().similarity(img1, img2)
return score
Make sure to add the dependencies of your new similarity measurer in src/similarity/requirements.txt
- Load Testing: here