Package: salesvision
Salesvision APISalesvision API provides accurate, reliable and scalable fashion image analysis by endpoints.It includes free public methods and python API clientFashion analysisFashion analysis includes recognition of items:CategoryTags/attributesMaskColorCategory detectionThe following solution will detect 27 categories:Tag/attribute recognitionThe solution will specify tags from 7 main categories and styles such as described below:On the real world images will have such output for different fashion items:Color extractionHere is example of how color is been extracted from the fashion item mask covered area:Public methodsCurl HTTP RequestPublic endpoint for fashion analysis with time measurement`IMG_URL=https%3A%2F%2Fis4.revolveassets.com%2Fimages%2Fp4%2Fn%2Fd%2FCAME-WD114_V1.jpg;timecurl-XGET"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;timecurl-XGET"http://192.168.0.125:5015/fashion_analysis/?url=$IMG_URL"`Try it yourself at:office local network access linkglobal network access linkParameterDefaultDescriptionurltruefashion image url.Thejsonoutput will contain result list where each object is a recognized fashion itemEach object will include:1 of 27 fashion classesTags description in 7 main categoriesMask of the recognized item5 main colors extracted from item mask covered areaColor embedding which can be used later on with fashion item search by colorVisual analysis methodThe 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:Provided attributes for the recognized"category": "pants":AttributePredicted taglengthmaxinicknamejeansopening typeflysilhouetteregular (fit)textile finishing, manufacturing techniqueswashedtextile patternplainwaistlinelow waistTry it yourself at:office local network access linkglobal network access linkClient APISetupYou can easily setup our SDK with python 3.x languageInstall pip package (under development)pipinstallsalesvisionAuthenticationExample of authentification process:
will be replaced with fastapi oauth2fromsalesvisionimportSalesvision# connect to Salesvision module to work with its APIapi=Salesvision(api_url='https://salesvision.com/api',api_key='Your_API_key',secret)Make sure to replacevwith your API key.Salesvision API will be probably using oAuth2 for authentification processAuthorization: Your_API_keyYou must replaceYour_API_keywith your personal API key.Fashion analysisfromsalesvisionimportSalesvision# connect to Salesvision module to work with its APIapi=Salesvision(api_url='https://salesvision.com/api',api_key='Your_API_key',secret)# image can be rather url or local stored fileresults=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 usedQuery ParametersParameterDefaultDescriptionfile:falsefile in binary format.The output of this method will contain result list where each object is a recognized fashion itemEach object will include:1 of 27 fashion classesTags description in 7 main categoriesMask of the recognized item5 main colors extracted from item mask covered areaColor embedding which can be used later on with fashion item search by colorThis method used with client API handles image file paths and urls