Skip to content

Latest commit

 

History

History
154 lines (120 loc) · 3.5 KB

README.md

File metadata and controls

154 lines (120 loc) · 3.5 KB

motif-service

This service provides endpoints for retrieving the bounding box of the motif i.e. the main subject of a given 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/motif_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/motif_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. Note: use the "debug" version of a make job to get the debug base64 image in the response.

Examples

Make job Debug make job Input image Debug image gRPCurl response
make req_obj
make req_obj_debug
Input image object Output debug image object
{
  "bBox": {
    "x": 428,
    "y": 195,
    "width": 286,
    "height": 463
  }
}
make req_human
make req_human_debug
Input image human Output image
{
  "bBox": {
    "x": 208,
    "y": 176,
    "width": 537,
    "height": 371
  }
}
make req_animal
make req_animal_debug
Input image animal Output image
{
  "bBox": {
    "x": 219,
    "y": 65,
    "width": 680,
    "height": 655
  }
}

Credits

Example images used in the tests are from Unsplash: