This is the official SDK for the CobbleVision Computer Vision Marketplace & SaaS. With this SDK using computer vision is easier and less complex then ever. Use this SDK after signing up to process images, gifs and videos on cobblevision.
This function uploads a media file to CobbleVision. You can find it after login in your media storage. Returns a response object with body, response and headers properties, deducted from npm request module
Parameters
Name
Type
Description
price_category
string
- Either high, medium, low
publicBool
boolean
- Make Media available publicly or not?
name
string
- Name of Media (Non Unique)
tags
array
- Tag Names for Media - Array of Strings
file
buffer
- File Buffer from fs.readFile() - instance of UInt8Array;
Returns
Promise<Object> This return the Upload Media Response. The body is in JSON format.
Name
Type
Description
response
object
On Resolve: This is the response from the request npm module
body
object
On Resolve: This is the body of the request npm module.
headers
object
On Resolve: This are the headers from the request npm module.
error
string
On Reject: Message of Error
Optional
code
number
On Reject: Code of Error
Optional
exports.deleteMediaFile(IDArray)
This function deletes Media from CobbleVision
Parameters
Name
Type
Description
IDArray
array
Array of ID's as Strings
Returns
Promise<Object> This return the Delete Media Response. The body is in JSON format.
Name
Type
Description
response
object
On Resolve: This is the response from the request npm module
body
object
On Resolve: This is the body of the request npm module.
headers
object
On Resolve: This are the headers from the request npm module.
Launch a calculation with CobbleVision's Web API. Returns a response object with body, response and headers properties, deducted from npm request module;
Parameters
Name
Type
Description
algorithms
array
Array of Algorithm Names
media
array
Array of Media ID's
type
string
Type of Job - Currently Always "QueuedJob"
notificationURL
string
Optional - Notify user upon finishing calculation!
Optional
Returns
Promise<Object> This returns the Launch Calculation Response. The body is in JSON format.
Name
Type
Description
response
object
On Resolve: This is the response from the request npm module
body
object
On Resolve: This is the body of the request npm module.
headers
object
On Resolve: This are the headers from the request npm module.
This function waits until the given calculation ID's are ready to be downloaded!
Parameters
Name
Type
Description
calculationIDArray
array
Array of Calculation ID's
Returns
Promise<Object> This returns the Wait For Calculation Response. The body is in JSON format.
Name
Type
Description
response
object
On Resolve: This is the response from the request npm module
body
object
On Resolve: This is the body of the request npm module.
headers
object
On Resolve: This are the headers from the request npm module.
error
string
On Reject: Message of Error
Optional
code
number
On Reject: Code of Error
Optional
exports.deleteCalculation(IDArray)
This function deletes Result Files or calculations in status "waiting" from CobbleVision. You cannot delete finished jobs beyond their result files, as we keep them for billing purposes.
Parameters
Name
Type
Description
IDArray
array
Array of ID's as Strings
Returns
Promise<Object> This returns the Delete Calculation Response. The body is in JSON format.
Name
Type
Description
response
object
On Resolve: This is the response from the request npm module
body
object
On Resolve: This is the body of the request npm module.
headers
object
On Resolve: This are the headers from the request npm module.
Launch a calculation with CobbleVision's Web API. Returns a response object with body, response and headers properties, deducted from npm request module;
Parameters
Name
Type
Description
idArray
array
ID of calculation to return result Array
returnOnlyStatusBool
boolean
Return full result or only status? See Doc for more detailed description!
Returns
Promise<Object> This returns the Get Calculation Result. The body is in json format.
Name
Type
Description
response
object
On Resolve: This is the response from the request npm module
body
object
On Resolve: This is the body of the request npm module.
headers
object
On Resolve: This are the headers from the request npm module.
Request your calculation result by ID with the CobbleVision API. Returns a response object with body, response and headers properties, deducted from npm request module;
Parameters
Name
Type
Description
id
array
ID of calculation to return result/check String
returnBase64Bool
boolean
Return Base64 String or image buffer as string?
width
number
target width of visualization file
height
number
target height of visualization file
Returns
Promise<Object> This returns the Get Calculation Visualization Result. The body is in binary format.
Name
Type
Description
response
object
On Resolve: This is the response from the request npm module
body
object
On Resolve: This is the body of the request npm module.
headers
object
On Resolve: This are the headers from the request npm module.