@foyer-inc/insight-sdk / Exports / Insight
A class for sending requests to Foyer Insight services
• new Insight(options?
)
Name | Type | Description |
---|---|---|
options |
InsightOptions |
see InsightOptions interface for more information |
• Private
Optional
authorization: string
An authorization token for Foyer Insight services
• baseURL: string
= 'https://api.foyer.ai'
• detectionsRequested: string
[]
An array of detections names to be returned in ClassifyResponse defaults to ['all'] for returning all available detections
• force: boolean
= false
A flag requesting a new result even when cached data exists defaults to false
• includeSegmentations: boolean
= false
A flag requesting the segmentations property to be returned with each Detection, necessary for post processing defaults to false
• includeTagpoints: boolean
= false
A flag requesting the tagpoint attribute to be returned with each Detection defaults to false
▸ bulkClassify(images
, options?
): Promise
<ClassifyResult
[]>
throws
can throw errors
Name | Type | Description |
---|---|---|
images |
string [] |
Array of images encoded as base64 strings, must include data prefix, or urls, not both |
options |
InsightOptions |
can override class level properties |
Promise
<ClassifyResult
[]>
classifications and detections
▸ classify(image
, options?
): Promise
<ClassifyResult
>
throws
can throw errors
Name | Type | Description |
---|---|---|
image |
string |
image encoded as base64 string or as a url |
options |
InsightOptions |
can override class level properties |
Promise
<ClassifyResult
>
classifications and detections
▸ Private
classifyRequest(images
, options
): Promise
<ClassifyResult
| ClassifyResult
[]>
Name | Type |
---|---|
images |
string | string [] |
options |
InsightOptions |
Promise
<ClassifyResult
| ClassifyResult
[]>
▸ login(email
, password
): Promise
<string
>
throws
{HTTPResponseError} Will throw when unauthorized
Name | Type | Description |
---|---|---|
email |
string |
email used for login |
password |
string |
password used for login |
Promise
<string
>
authorization string, automatically saved into class as well
▸ setAuthorization(authorization
): void
Name | Type | Description |
---|---|---|
authorization |
string |
if you already have a valid token you may set it in lieu of making a login request |
void