Skip to content

Latest commit

 

History

History
173 lines (132 loc) · 3.59 KB

README.md

File metadata and controls

173 lines (132 loc) · 3.59 KB

caption-service

This service provides endpoints for retrieving captions based on a given image.

Apart from providing just an input image, the service also accepts a bounding box to generate a caption based on a cropped version image.

Please refer to the proto file for more information on the service's API.

Requirements

Setup

  1. Clone this repository and navigate to the root directory.
  2. Navigate to the services/caption_service directory.
  3. Set up a python virtual environment with the pre-configured make command.
  4. Install the required dependencies to the virtual environment.
  5. Start the service. (optionally edit the make file to change the port or disable debug mode)

The above steps can be executed with the following commands:

git clone https://github.com/nico-i/photo-ops.git
cd photo-ops
cd services/caption_service
make venv
make install
make dev

Usage

If you have followed the setup instructions above, you can utilize the configured make commands to execute the example requests.

Please refer to the make file or the table below for the available make commands.

Examples

Make job Input image gRPCurl response
make req_obj
Input image object
{
  "caption": "a sign on a fence"
}
make req_obj_crop
Input image object
{
  "caption": "a sign in the city."
}
make req_human
Input image human
{
  "caption": "a girl with a flower in her hair"
}
make req_human_crop
Input image human
{
  "caption": "a girl with painted eyes and white makeup"
}
make req_animal
Input image animal
{
"caption": "a cat is lying on a chair"
}
make req_animal_crop
Input image animal
{
  "caption": "a cat is relaxing on a chair"
}

Credits

Example images used in the tests are from Unsplash: