mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-07 01:22:59 +08:00

* Refactor js submodule * Remove change-log * Update ocr module * Update ocr-detection module * Update ocr-detection module * Remove change-log
12 lines
327 B
TypeScript
12 lines
327 B
TypeScript
export function flatten(arr: number[] | number[][]) {
|
|
return arr.toString().split(',').map(item => +item);
|
|
}
|
|
|
|
export function int(num: number) {
|
|
return num > 0 ? Math.floor(num) : Math.ceil(num);
|
|
}
|
|
|
|
export function clip(data: number, min: number, max: number) {
|
|
return data < min ? min : data > max ? max : data;
|
|
}
|