setup:
-
Setup virtual env
virtualenv --no-site-packages -p python3.6 . -
Activate the env
source bin/activate -
Install pip-tools.
pip install pip-tools -
requirements.inshould contain the high level packages that we want e.g. flask, numpy etc.pip-compilewill generaterequirements.txtwhich will have all the dependencies.pip-compile requirements.inpip install -r requirements.txt -
Run local server
python application.py
Developing Locally
docker-compose up
docker exec -it search_api python application.py
Test API calls
# Index an Image
curl --location --request POST 'http://localhost:7000/upload_image' \
--header 'Content-Type: application/json' \
--data-raw '{
"image_url": "https://tattle-story-scraper.s3.ap-south-1.amazonaws.com/e9ec45b7-3e9a-46a2-ba8e-46e606b85da6",
"doc_id": 69004
} '
# Search for Duplicate images
curl --location --request POST 'http://localhost:7000/find_duplicate' \
--header 'Content-Type: application/json' \
--data-raw '{
"image_url": "https://tattle-story-scraper.s3.ap-south-1.amazonaws.com/e9ec45b7-3e9a-46a2-ba8e-46e606b85da6"
} '