tofriede

tofriede / FashionSegmentation / 0.1.5

README.md

This algorithm recognize fashion items in images. It returns a list of discovered articels and their exact location in the shape of a polygon and a bounding box.

woman_input men_input


Fashion Item Categories

The model has been trained to detect the following classes

CategoryDescription
headwearheadwear
sunglassessunglasses
scarf & tiescarf & tie
toptop, blouse, t-shirt, shirt
outercoat, jacket, suit, blazers, cardigan, sweater, Jumpsuits, Rompers, vest
dressdress, t-shirt dress
skirtskirt
pantspants, jeans, leggings
shortsshorts
beltbelt
bagbag
bootsboots
footwearfootwear

Input

{  
   "image":String 
}
  • image - an input image as either a url, data connector uri (data://, s3://, etc) or a base 64 encoded string.

Output

[
  {
    "article_name": String,
    "bbox": [
        Integer, //y1
        Integer, //x1
        Integer, //y2
        Integer, //x2
    ],
    "confidence": Float,
    "segmentation": [[
        Integer, //y1
        Integer, //x1
        Integer, //y2
        Integer, //x2
        Integer, //y3
        Integer, //x3
        Integer, //y4
        Integer, //x4
        Integer, //y5
        Integer, //x5
    ]]
  },
  ..
]
  • article_name - the name of the discovered article.
  • bounding box - the rectangular coordinates of bounding box, defined as (x1,y1), (x2,y2).
  • confidence - the algorithm's confidence that this article exists in the image.
  • segmentation - the coordinates of the polygon, which segments the fashion item.

When calling this api in python the returned segmentation-polygon can be easily converted to a mask of the original image with the image semantics package

from imantics import Polygons, Mask

height = img.shape[0]
width = img.shape[1]

for article in output:
	mask = Polygons(article['segmentation']).mask(width, height).array
	article['mask'] = mask