Skip to content

Latest commit

 

History

History
236 lines (134 loc) · 5.39 KB

Insight.md

File metadata and controls

236 lines (134 loc) · 5.39 KB

@foyer-inc/insight-sdk / Exports / Insight

Class: Insight

A class for sending requests to Foyer Insight services

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Insight(options?)

Parameters

Name Type Description
options InsightOptions see InsightOptions interface for more information

Defined in

lib/insight.ts:48

Properties

authorization

Private Optional authorization: string

An authorization token for Foyer Insight services

Defined in

lib/insight.ts:14


baseURL

baseURL: string = 'https://api.foyer.ai'

Defined in

lib/insight.ts:42


detectionsRequested

detectionsRequested: string[]

An array of detections names to be returned in ClassifyResponse defaults to ['all'] for returning all available detections

Defined in

lib/insight.ts:40


force

force: boolean = false

A flag requesting a new result even when cached data exists defaults to false

Defined in

lib/insight.ts:20


includeSegmentations

includeSegmentations: boolean = false

A flag requesting the segmentations property to be returned with each Detection, necessary for post processing defaults to false

Defined in

lib/insight.ts:27


includeTagpoints

includeTagpoints: boolean = false

A flag requesting the tagpoint attribute to be returned with each Detection defaults to false

Defined in

lib/insight.ts:34

Methods

bulkClassify

bulkClassify(images, options?): Promise<ClassifyResult[]>

throws can throw errors

Parameters

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

Returns

Promise<ClassifyResult[]>

classifications and detections

Defined in

lib/insight.ts:108


classify

classify(image, options?): Promise<ClassifyResult>

throws can throw errors

Parameters

Name Type Description
image string image encoded as base64 string or as a url
options InsightOptions can override class level properties

Returns

Promise<ClassifyResult>

classifications and detections

Defined in

lib/insight.ts:97


classifyRequest

Private classifyRequest(images, options): Promise<ClassifyResult | ClassifyResult[]>

Parameters

Name Type
images string | string[]
options InsightOptions

Returns

Promise<ClassifyResult | ClassifyResult[]>

Defined in

lib/insight.ts:112


login

login(email, password): Promise<string>

throws {HTTPResponseError} Will throw when unauthorized

Parameters

Name Type Description
email string email used for login
password string password used for login

Returns

Promise<string>

authorization string, automatically saved into class as well

Defined in

lib/insight.ts:70


setAuthorization

setAuthorization(authorization): void

Parameters

Name Type Description
authorization string if you already have a valid token you may set it in lieu of making a login request

Returns

void

Defined in

lib/insight.ts:60