Namespace: WebAI

WebAI

Namespace of WebAI.
Source:

Methods

(static) argmax(arr)

get the index of the max value of the array.
Parameters:
Name Type Description
arr array
Source:
Returns:
the index of the max value of the array

(static) crop(img, cropSize)

image center crop.
Parameters:
Name Type Description
img image mat
cropSize crop size [h, w]
Source:
Returns:
cropped image

(static) drawBBoxes(img, bboxes, withLabel, withScore, thickness, lineType, fontFace, fontScale)

draw bboxes onto the image.
Parameters:
Name Type Description
img image mat
bboxes bboxes of detection
withLabel draw with label
withScore draw with score
thickness line thickness
lineType line type
fontFace font face
fontScale font scale
Source:
Returns:
drawed image

(static) getColorMap(labelList)

get color map of label list.
Parameters:
Name Type Description
labelList label list
Source:
Returns:
color map of label list

(static) getIMScale(height, width, targetSize, keepRatio, limitMax)

get image scale.
Parameters:
Name Type Description
height image height
width image width
targetSize target size [h, w]
keepRatio is keep the ratio of image size
limitMax is limit max size of image
Source:
Returns:
[scale factor of x axis, , scale factor of y axis]

(static) loadText(textURL)

load text content.
Parameters:
Name Type Description
textURL text URL
Source:
Returns:
content of the text

(static) normalize(img, scale, mean, std, isScale)

image normalize.
Parameters:
Name Type Description
img image mat
scale normalize scale
mean normalize mean
std normalize std
isScale is scale the image
Source:
Returns:
normalized image

(static) permute(img)

permute hwc -> chw.
Parameters:
Name Type Description
img image mat
Source:
Returns:
image data

(static) resize(img, height, width, targetSize, keepRatio, limitMax, interp)

image resize.
Parameters:
Name Type Description
img image mat
height image height
width image width
targetSize target size [h, w]
keepRatio is keep the ratio of image size
limitMax is limit max size of image
interp interpolation method
Source:
Returns:
[image resized, scale factor of x axis, , scale factor of y axis]

(static) rgba2bgr(imgRGBA)

RGBA -> BGR image.
Parameters:
Name Type Description
imgRGBA RGBA image
Source:
Returns:
BGR image

(static) rgba2rgb(imgRGBA)

RGBA -> RGB image.
Parameters:
Name Type Description
imgRGBA RGBA image
Source:
Returns:
RGB image