mirror of https://github.com/vladmandic/human
automated browser tests
parent
ded141a161
commit
a5977e3f45
|
@ -9,8 +9,13 @@
|
|||
|
||||
## Changelog
|
||||
|
||||
### **HEAD -> main** 2021/09/19 mandic00@live.com
|
||||
### **HEAD -> main** 2021/09/20 mandic00@live.com
|
||||
|
||||
- initial automated browser tests
|
||||
|
||||
### **origin/main** 2021/09/20 mandic00@live.com
|
||||
|
||||
- more automated tests
|
||||
- added configuration validation
|
||||
- prevent validation failed on some model combinations
|
||||
- webgl exception handling
|
||||
|
|
|
@ -132,7 +132,7 @@ export async function get() {
|
|||
env.tfjs.version = tf.version_core;
|
||||
|
||||
// offscreencanvas supported?
|
||||
env.offscreen = typeof env.offscreen === 'undefined' ? typeof OffscreenCanvas !== undefined : env.offscreen;
|
||||
env.offscreen = typeof env.offscreen === 'undefined' ? typeof OffscreenCanvas !== 'undefined' : env.offscreen;
|
||||
// get platform and agent
|
||||
if (typeof navigator !== 'undefined') {
|
||||
const raw = navigator.userAgent.match(/\(([^()]+)\)/g);
|
||||
|
|
|
@ -63,9 +63,9 @@ export function process(input: Input, config: Config): { tensor: Tensor | null,
|
|||
}
|
||||
if (input instanceof tf.Tensor) {
|
||||
// if input is tensor, use as-is
|
||||
if (input.isDisposed) throw new Error('input tensor is disposed');
|
||||
if ((input as unknown as Tensor).shape && (input as unknown as Tensor).shape.length === 4 && (input as unknown as Tensor).shape[0] === 1 && (input as unknown as Tensor).shape[3] === 3) tensor = tf.clone(input);
|
||||
else throw new Error(`input tensor shape must be [1, height, width, 3] and instead was ${(input as unknown as Tensor).shape}`);
|
||||
if ((input as Tensor)['isDisposedInternal']) throw new Error('input tensor is disposed');
|
||||
if ((input as Tensor).shape && (input as Tensor).shape.length === 4 && (input as unknown as Tensor).shape[0] === 1 && (input as unknown as Tensor).shape[3] === 3) tensor = tf.clone(input);
|
||||
else throw new Error(`input tensor shape must be [1, height, width, 3] and instead was ${(input as Tensor).shape}`);
|
||||
} else {
|
||||
// check if resizing will be needed
|
||||
if (typeof input['readyState'] !== 'undefined' && input['readyState'] <= 2) {
|
||||
|
|
Loading…
Reference in New Issue