Showcase Analysis
Showcase is a display or exhibition area typically used by businesses to present their products, services, or promotional materials in an attractive and eye-catching manner.
This endpoint is currently in beta. It is not yet available in our production URL. Please contact us if you want to use this endpoint. Contact us via hi[at]glair.ai or via our representative for your company.
Showcase Analysis Object
- Name
status
- Type
- string
- Description
Enum code indicating the status of the reading result.
SUCCESS
NO_FILE
FILE_INVALID_FORMAT
FAILED
- Name
reason
- Type
- string
- Description
A human-readable message providing more details about the reading result.
- Name
detected
- Type
- boolean
- Description
Determine whether the showcase is visible or not.
- Name
recognition_result
- Type
- object
- Description
Object containing result provided by showcase detection AI service.
- Name
confidence
- Type
- number
- Description
Score representing the likelihood that the output given by the AI service/model is correct, the higher the score means better result.
- Name
label
- Type
- string
- Description
String specifying whether the showcase is visible or not. Value:
visible
|not visible
.
Analyze Showcase
Detect tenant-owned showcase's visibility by providing an image of the store's environment.
Required parameter
- Name
image
- Type
- file (.png, .jpg, .jpeg)
- Description
The image file for the showcase.
Request
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Minimum Node 18. Save the code as 'index.mjs' and run it by executing 'node index.mjs'
import { readFileSync } from 'fs';
const url = 'https://api.vision.glair.ai/showcase';
const basicAuth = 'Basic ' + Buffer.from('USERNAME' + ':' + 'PASSWORD').toString('base64');
const apiKey = API_KEY;
const data = new FormData();
data.append('image', new Blob(
[readFileSync('/path/to/image/showcase.jpg')],
{ type: 'image/jpg' }
));
const config = {
method: 'POST',
headers: {
Authorization: basicAuth,
'x-api-key': apiKey,
},
body: data,
};
const response = await fetch(url, config);
console.log(await response.json());
Response
1
2
3
4
5
6
7
8
9
{
"status": "SUCCESS",
"reason": "File successfully read",
"detected": true,
"recognition_result": {
"confidence": 99.99978542327881,
"label": "visible"
}
}
Request ID
An associated request identifier is generated for every request made to this endpoint.
This value can be found in the response headers under Request-Id
Responses
Various responses for this endpoint, in addition to general responses specified in Errors.
200 - OK
Request with readable showcase image
Response
1
2
3
4
5
{
"status": "SUCCESS",
"reason": "File successfully read",
//...,
}
400 - Bad Request
Request without form-data image
Response
1
2
3
4
{
"status": "NO_FILE",
"reason": "No file in request body",
}
415 - Unsupported Media Type
Request with non-image file format
Response
1
2
3
4
{
"status": "FILE_INVALID_FORMAT",
"reason": "Failed to process invalid request",
}