Classify procedure

Official Content
This documentation is valid for:

Classifies an image in a set of categories.

Parameters

Configuration

The following table resumes the configuration properties (access credentials) you must set in order to use this AI task.

  PropertyKey
ProviderType   Id Key SecretKey
Alibaba - 用户AccessKey 用户AccessKey
Amazon - Rekognition Rekognition
Baidu 视觉技术 视觉技术 视觉技术
Google  - Cloud Vision API -
IBM  - Visual Recognition  -
Microsoft - Computer Vision -
SAP - Sandbox Environment -
Tencent 多标签识别 多标签识别 -

Additionally, for custom models, you must set the properties described in the following table. For more information, refer to HowTo: Build a custom model for GeneXusAI.

  PropertyKey
ProviderType   ModelId ModelVersion ModelCredential
Alibaba - - -
Amazon - - -
Baidu - - -
Google  AutoML (Project Id) - AutoML (Service Account Json)
IBM  Visual Recognition  (Model Id) - Visual Recognition (API Key)
Microsoft Custom Vision (Project Id) Custom Vision (Published Name) Custom Vision (Prediction Key)
SAP  Customizable Image
Classification (Model Name)
 Customizable Image
Classification (Model Version)
-
Tencent - - -

Sample

Taking the following image input, the table below shows the classification made for each provider and the time it takes for processing it.

GeneXusAI - Image module - Sample

 

Provider Output Benchmark
Alibaba
[{
    "label": "清真寺",
    "confidence": 0.99
}]

12435ms
Amazon
[{
	"label": "Vacation",
	"confidence": 0.998
}, {
	"label": "Sunglasses",
	"confidence": 0.996
}, {
	"label": "Person",
	"confidence": 0.995
}, {
	"label": "Tourist",
	"confidence": 0.982
}, {
	"label": "Building",
	"confidence": 0.906
}, {
	"label": "Architecture",
	"confidence": 0.906
}, {
	"label": "Clothing",
	"confidence": 0.709
}, {
	"label": "Dome",
	"confidence": 0.693
}, {
	"label": "Monument",
	"confidence": 0.656
}, {
	"label": "People",
	"confidence": 0.644
}]

4135ms
Baidu
[{
    "label": "建筑",
    "confidence": 0.952,
    "Info": [{
        "property": "ROOT",
        "value": "建筑-现代建筑"
    }]
}, {
    "label": "李维斯",
    "confidence": 0.799,
    "Info": [{
        "property": "ROOT",
        "value": "Logo"
    }]
}, {
    "label": "历史遗迹",
    "confidence": 0.515,
    "Info": [{
        "property": "ROOT",
        "value": "建筑-文明遗迹"
    }]
}, {
    "label": "情侣",
    "confidence": 0.235,
    "Info": [{
        "property": "ROOT",
        "value": "人物-人物特写"
    }]
}, {
    "label": "卡通动漫人物",
    "confidence": 0.023,
    "Info": [{
        "property": "ROOT",
        "value": "非自然图像-彩色动漫"
    }]
}]

8476ms
Google
[{
    "label": "landmark",
    "confidence": 0.914
}, {
    "label": "tourism",
    "confidence": 0.889
}, {
    "label": "tourist attraction",
    "confidence": 0.827
}, {
    "label": "historic site",
    "confidence": 0.824
}, {
    "label": "vacation",
    "confidence": 0.792
}, {
    "label": "travel",
    "confidence": 0.765
}, {
    "label": "temple",
    "confidence": 0.733
}, {
    "label": "sky",
    "confidence": 0.688
}, {
    "label": "fun",
    "confidence": 0.632
}, {
    "label": "place of worship",
    "confidence": 0.560
}]

8263ms
IBM
[{
    "label": "Taj Mahal",
    "confidence": 0.777
}, {
    "label": "Seven Wonders of the Ancient World",
    "confidence": 0.753
}, {
    "label": "religious building",
    "confidence": 0.635
}, {
    "label": "building",
    "confidence": 0.635
}, {
    "label": "memorial",
    "confidence": 0.601
}, {
    "label": "alabaster color",
    "confidence": 0.927
}]

6160ms
Microsoft
[{
    "label": "outdoor",
    "confidence": 0.003
}, {
    "label": "people",
    "confidence": 0.644
}]

3489ms
SAP
[{
    "label": "mosque",
    "confidence": 0.821
}, {
    "label": "palace",
    "confidence": 0.008
}, {
    "label": "bell cote, bell cot",
    "confidence": 0.003
}, {
    "label": "dome",
    "confidence": 0.003
}, {
    "label": "gondola",
    "confidence": 0.002
}]

4682ms
Tencent
[{
	"label": "广场",
	"confidence": 0.410
}, {
	"label": "天空",
	"confidence": 0.400
}, {
	"label": "欧式建筑",
	"confidence": 0.240
}, {
	"label": "男孩",
	"confidence": 0.190
}, {
	"label": "树木",
	"confidence": 0.140
}, {
	"label": "合影",
	"confidence": 0.120
}]

18196ms

Notes

  • The classification is made with the default classifier of each provider. For such reason, the categories (or labels) returned are not predefined and they depend on the provider used.
  • The maximum image file size is 10MB.
  • SAP Leonardo allows images of 1.0 MP at most.
  • Tencent AI and Baidu AI return labels as Chinese strings.

Scope

Platforms  Web(.NET,.NETCore,Java), SmartDevices(Android,iOS)
Connectivity  Online

Availability

This procedure is available as of GeneXus 16.

See also

Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.