Skip to main content

Salesvision provides accurate, reliable and scalable fashion image analysis

Project description

Salesvision API

Salesvision API provides accurate, reliable and scalable fashion image analysis by endpoints.

It includes free public methods and python API client

Fashion analysis

Fashion analysis includes recognition of items:

  • Category
  • Tags/attributes
  • Mask
  • Color

Category detection

The following solution will detect 27 categories:

Classes

Tag/attribute recognition

The solution will specify tags from 7 main categories and styles such as described below:

Initial tags

On the real world images will have such output for different fashion items:

Tags

Color extraction

Here is example of how color is been extracted from the fashion item mask covered area:

Mask and color item

Public methods

Curl HTTP Request

Public endpoint for fashion analysis with time measurement

`IMG_URL=https%3A%2F%2Fis4.revolveassets.com%2Fimages%2Fp4%2Fn%2Fd%2FCAME-WD114_V1.jpg;
time curl -X GET "http://87.117.25.190:5015/fashion_analysis/?url=$IMG_URL"`

From office local network

`IMG_URL=https%3A%2F%2Fis4.revolveassets.com%2Fimages%2Fp4%2Fn%2Fd%2FCAME-WD114_V1.jpg;
time curl -X GET "http://192.168.0.125:5015/fashion_analysis/?url=$IMG_URL"`

Try it yourself at:

office local network access link

global network access link

Parameter Default Description
url true fashion image url.

The json output will contain result list where each object is a recognized fashion item

Each object will include:

  • 1 of 27 fashion classes
  • Tags description in 7 main categories
  • Mask of the recognized item
  • 5 main colors extracted from item mask covered area
  • Color embedding which can be used later on with fashion item search by color

Visual analysis method

The above command returns JSON structured like this:

{
  "result": [
    {
      "category": "pants",
      "description": {
        "tags": {
          "length": "maxi (length)",
          "nickname": "jeans",
          "opening type": "fly (opening)",
          "silhouette": "regular (fit)",
          "textile finishing, manufacturing techniques": "washed",
          "textile pattern": "plain (pattern)",
          "waistline": "low waist"
        },
        "colors": [
          "172839",
          ...
        ]
      },
      "color_embedding": [
        -0.45759817957878113,
        ...
      ]
    },
    {
      "category": "top, t-shirt, sweatshirt",
      "description": {
        "tags": {
          "length": "above-the-hip (length)",
          "nickname": "classic (t-shirt)",
          "opening type": "no opening",
          "silhouette": "symmetrical",
          "textile finishing, manufacturing techniques": "printed",
          "textile pattern": "plain (pattern)",
          "waistline": "no waistline"
        },
        "colors": [
          "321d1a",
          ...
        ]
      },
      "color_embedding": [
        -0.5404209494590759,
        ...
      ]
    },
    {
      "category": "shoe",
      "description": {
        "colors": [
          "161615",
          ...
        ]
      },
      "color_embedding": [
        -0.5041476488113403,
        ...
      ]
    },
    {
      "category": "headband, head covering, hair accessory",
      "description": {
        "colors": [
          "35261b",
          ...
        ]
      },
      "color_embedding": [
        -0.5759932398796082,
        ...
      ]
    }
  ]
}

That method allows us to check accuracy of given masks and bounding boxes recognition by the given image:

Result of execution

Provided attributes for the recognized "category": "pants":

Attribute Predicted tag
length maxi
nickname jeans
opening type fly
silhouette regular (fit)
textile finishing, manufacturing techniques washed
textile pattern plain
waistline low waist

Try it yourself at:

office local network access link

global network access link

Client API

Setup

You can easily setup our SDK with python 3.x language

Install pip package (under development)

pip install salesvision

Authentication

Example of authentification process: will be replaced with fastapi oauth2

from salesvision import Salesvision

# connect to Salesvision module to work with its API

api = Salesvision(api_url='https://salesvision.com/api', api_key='Your_API_key', secret)

Make sure to replace v with your API key.

Salesvision API will be probably using oAuth2 for authentification process

Authorization: Your_API_key

Fashion analysis

from salesvision import Salesvision

# connect to Salesvision module to work with its API
api = Salesvision(api_url='https://salesvision.com/api', api_key='Your_API_key', secret)


# image can be rather url or local stored file
results = api.fashion_analysis(image)

The above command returns JSON structured like this:

{
  "result": [
    {
      "category": "pants",
      "description": {
        "tags": {
          "length": "maxi (length)",
          "nickname": "jeans",
          "opening type": "fly (opening)",
          "silhouette": "regular (fit)",
          "textile finishing, manufacturing techniques": "washed",
          "textile pattern": "plain (pattern)",
          "waistline": "low waist"
        },
        "colors": [
          "172839",
          ...
        ]
      },
      "color_embedding": [
        -0.45759817957878113,
        ...
      ]
    },
    {
      "category": "top, t-shirt, sweatshirt",
      "description": {
        "tags": {
          "length": "above-the-hip (length)",
          "nickname": "classic (t-shirt)",
          "opening type": "no opening",
          "silhouette": "symmetrical",
          "textile finishing, manufacturing techniques": "printed",
          "textile pattern": "plain (pattern)",
          "waistline": "no waistline"
        },
        "colors": [
          "321d1a",
          ...
        ]
      },
      "color_embedding": [
        -0.5404209494590759,
        ...
      ]
    },
    {
      "category": "shoe",
      "description": {
        "colors": [
          "161615",
          ...
        ]
      },
      "color_embedding": [
        -0.5041476488113403,
        ...
      ]
    },
    {
      "category": "headband, head covering, hair accessory",
      "description": {
        "colors": [
          "35261b",
          ...
        ]
      },
      "color_embedding": [
        -0.5759932398796082,
        ...
      ]
    }
  ]
}

Under the hood POST request is used

Query Parameters

Parameter Default Description
file: false file in binary format.

The output of this method will contain result list where each object is a recognized fashion item

Each object will include:

  • 1 of 27 fashion classes
  • Tags description in 7 main categories
  • Mask of the recognized item
  • 5 main colors extracted from item mask covered area
  • Color embedding which can be used later on with fashion item search by color

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

salesvision-0.1.6.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

salesvision-0.1.6-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file salesvision-0.1.6.tar.gz.

File metadata

  • Download URL: salesvision-0.1.6.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.5

File hashes

Hashes for salesvision-0.1.6.tar.gz
Algorithm Hash digest
SHA256 276f758a3c1eb10755a87eb6b56a218d13633b6a1e7cf14c0c55aabc618c48cb
MD5 11c3182e9e356d9f3f0baee1b444febb
BLAKE2b-256 0019bde10d39cedc5968ee6afcbdacfdd90b9bc98bc94db65d82d51a8a70751c

See more details on using hashes here.

File details

Details for the file salesvision-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: salesvision-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.5

File hashes

Hashes for salesvision-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 8f3a86c83a1440ef2a828dd2c8c94cabd056c7a6fab6e320b1ce5c31ab1f7ef6
MD5 f9541fe1b0875fb8ab446594f61e5e85
BLAKE2b-256 5dba36ba104f61e10d4ef7d1f28cad093d3af7cd5a1c353751d034ca4e28546d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page