mirror of https://github.com/vladmandic/human
fix image orientation
parent
849c3d2fad
commit
a477ac0312
|
@ -41,7 +41,7 @@ async function getImage(human, input) {
|
|||
const tensor = human.tf.tensor(Array.from(imageData.data), [canvas.height, canvas.width, 4], 'int32'); // create rgba image tensor from flat array
|
||||
const channels = human.tf.split(tensor, 4, 2); // split rgba to channels
|
||||
const rgb = human.tf.stack([channels[0], channels[1], channels[2]], 2); // stack channels back to rgb
|
||||
const reshape = human.tf.reshape(rgb, [1, canvas.width, canvas.height, 3]); // move extra dim from the end of tensor and use it as batch number instead
|
||||
const reshape = human.tf.reshape(rgb, [1, canvas.height, canvas.width, 3]); // move extra dim from the end of tensor and use it as batch number instead
|
||||
return reshape;
|
||||
});
|
||||
if (res && res.shape[0] === 1 && res.shape[3] === 3) log('state', 'passed: load image:', input, res.shape);
|
||||
|
|
128
test/test.log
128
test/test.log
|
@ -179,3 +179,131 @@
|
|||
2021-04-15 09:34:31 [32mDATA: [39m test-node-wasm.js result: performance: load: 3 total: 7839
|
||||
2021-04-15 09:34:31 [36mINFO: [39m test-node-wasm.js test complete: 35570 ms
|
||||
2021-04-15 09:34:31 [36mINFO: [39m status: {"passed":74,"failed":2}
|
||||
2021-04-15 15:25:36 [36mINFO: [39m @vladmandic/human version 1.5.2
|
||||
2021-04-15 15:25:36 [36mINFO: [39m User: vlado Platform: linux Arch: x64 Node: v15.7.0
|
||||
2021-04-15 15:25:36 [36mINFO: [39m tests: ["test-node.js","test-node-gpu.js","test-node-wasm.js"]
|
||||
2021-04-15 15:25:36 [36mINFO: [39m test-node.js start
|
||||
2021-04-15 15:25:38 [35mSTATE:[39m test-node.js passed: create human
|
||||
2021-04-15 15:25:38 [36mINFO: [39m test-node.js human version: 1.5.2
|
||||
2021-04-15 15:25:38 [36mINFO: [39m test-node.js platform: linux x64 agent: NodeJS v15.7.0
|
||||
2021-04-15 15:25:38 [36mINFO: [39m test-node.js tfjs version: 3.4.0
|
||||
2021-04-15 15:25:38 [35mSTATE:[39m test-node.js passed: set backend: tensorflow
|
||||
2021-04-15 15:25:38 [35mSTATE:[39m test-node.js passed: load models
|
||||
2021-04-15 15:25:38 [35mSTATE:[39m test-node.js result: defined models: 12 loaded models: 6
|
||||
2021-04-15 15:25:38 [35mSTATE:[39m test-node.js passed: warmup: none default
|
||||
2021-04-15 15:25:40 [35mSTATE:[39m test-node.js passed: warmup: face default
|
||||
2021-04-15 15:25:40 [32mDATA: [39m test-node.js result: face: 1 body: 0 hand: 0 gesture: 2 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.52,"class":"person"} {}
|
||||
2021-04-15 15:25:40 [32mDATA: [39m test-node.js result: performance: load: 489 total: 1397
|
||||
2021-04-15 15:25:41 [35mSTATE:[39m test-node.js passed: warmup: body default
|
||||
2021-04-15 15:25:41 [32mDATA: [39m test-node.js result: face: 1 body: 1 hand: 0 gesture: 2 object: 3 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":0.95,"keypoints":17}
|
||||
2021-04-15 15:25:41 [32mDATA: [39m test-node.js result: performance: load: 489 total: 1444
|
||||
2021-04-15 15:25:41 [36mINFO: [39m test-node.js test body variants
|
||||
2021-04-15 15:25:42 [35mSTATE:[39m test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
|
||||
2021-04-15 15:25:44 [35mSTATE:[39m test-node.js passed: detect: assets/human-sample-body.jpg posenet
|
||||
2021-04-15 15:25:44 [32mDATA: [39m test-node.js result: face: 1 body: 1 hand: 0 gesture: 2 object: 3 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":0.95,"keypoints":17}
|
||||
2021-04-15 15:25:44 [32mDATA: [39m test-node.js result: performance: load: 489 total: 1220
|
||||
2021-04-15 15:25:45 [35mSTATE:[39m test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
|
||||
2021-04-15 15:25:47 [35mSTATE:[39m test-node.js passed: detect: assets/human-sample-body.jpg efficientpose
|
||||
2021-04-15 15:25:47 [32mDATA: [39m test-node.js result: face: 1 body: 1 hand: 0 gesture: 2 object: 3 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":0.75,"keypoints":13}
|
||||
2021-04-15 15:25:47 [32mDATA: [39m test-node.js result: performance: load: 489 total: 1950
|
||||
2021-04-15 15:25:48 [35mSTATE:[39m test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
|
||||
2021-04-15 15:25:49 [35mSTATE:[39m test-node.js passed: detect: assets/human-sample-body.jpg blazepose
|
||||
2021-04-15 15:25:49 [32mDATA: [39m test-node.js result: face: 1 body: 1 hand: 0 gesture: 2 object: 3 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":1,"keypoints":39}
|
||||
2021-04-15 15:25:49 [32mDATA: [39m test-node.js result: performance: load: 489 total: 1358
|
||||
2021-04-15 15:25:50 [35mSTATE:[39m test-node.js passed: detect: random default
|
||||
2021-04-15 15:25:50 [32mDATA: [39m test-node.js result: face: 0 body: 1 hand: 0 gesture: 1 object: 0 {} {} {"score":1,"keypoints":39}
|
||||
2021-04-15 15:25:50 [32mDATA: [39m test-node.js result: performance: load: 489 total: 685
|
||||
2021-04-15 15:25:50 [36mINFO: [39m test-node.js test: first instance
|
||||
2021-04-15 15:25:50 [35mSTATE:[39m test-node.js passed: load image: assets/sample-me.jpg [1,700,700,3]
|
||||
2021-04-15 15:25:51 [35mSTATE:[39m test-node.js passed: detect: assets/sample-me.jpg default
|
||||
2021-04-15 15:25:51 [32mDATA: [39m test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 2 {"confidence":1,"age":39.2,"gender":"male"} {"score":0.7,"class":"person"} {"score":1,"keypoints":39}
|
||||
2021-04-15 15:25:51 [32mDATA: [39m test-node.js result: performance: load: 489 total: 1079
|
||||
2021-04-15 15:25:51 [36mINFO: [39m test-node.js test: second instance
|
||||
2021-04-15 15:25:52 [35mSTATE:[39m test-node.js passed: load image: assets/sample-me.jpg [1,700,700,3]
|
||||
2021-04-15 15:25:53 [35mSTATE:[39m test-node.js passed: detect: assets/sample-me.jpg default
|
||||
2021-04-15 15:25:53 [32mDATA: [39m test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 2 {"confidence":1,"age":39.2,"gender":"male"} {"score":0.7,"class":"person"} {"score":1,"keypoints":39}
|
||||
2021-04-15 15:25:53 [32mDATA: [39m test-node.js result: performance: load: 4 total: 1117
|
||||
2021-04-15 15:25:53 [36mINFO: [39m test-node.js test: concurrent
|
||||
2021-04-15 15:25:53 [35mSTATE:[39m test-node.js passed: load image: assets/human-sample-face.jpg [1,256,256,3]
|
||||
2021-04-15 15:25:53 [35mSTATE:[39m test-node.js passed: load image: assets/human-sample-face.jpg [1,256,256,3]
|
||||
2021-04-15 15:25:54 [35mSTATE:[39m test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
|
||||
2021-04-15 15:25:55 [35mSTATE:[39m test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
|
||||
2021-04-15 15:25:59 [35mSTATE:[39m test-node.js passed: detect: assets/human-sample-face.jpg default
|
||||
2021-04-15 15:25:59 [32mDATA: [39m test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.53,"class":"person"} {"score":1,"keypoints":39}
|
||||
2021-04-15 15:25:59 [32mDATA: [39m test-node.js result: performance: load: 489 total: 4426
|
||||
2021-04-15 15:25:59 [35mSTATE:[39m test-node.js passed: detect: assets/human-sample-face.jpg default
|
||||
2021-04-15 15:25:59 [32mDATA: [39m test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.53,"class":"person"} {"score":1,"keypoints":39}
|
||||
2021-04-15 15:25:59 [32mDATA: [39m test-node.js result: performance: load: 4 total: 4426
|
||||
2021-04-15 15:25:59 [35mSTATE:[39m test-node.js passed: detect: assets/human-sample-body.jpg default
|
||||
2021-04-15 15:25:59 [32mDATA: [39m test-node.js result: face: 1 body: 1 hand: 0 gesture: 2 object: 3 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":1,"keypoints":39}
|
||||
2021-04-15 15:25:59 [32mDATA: [39m test-node.js result: performance: load: 489 total: 4426
|
||||
2021-04-15 15:25:59 [35mSTATE:[39m test-node.js passed: detect: assets/human-sample-body.jpg default
|
||||
2021-04-15 15:25:59 [32mDATA: [39m test-node.js result: face: 1 body: 1 hand: 0 gesture: 2 object: 3 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":1,"keypoints":39}
|
||||
2021-04-15 15:25:59 [32mDATA: [39m test-node.js result: performance: load: 4 total: 4426
|
||||
2021-04-15 15:25:59 [36mINFO: [39m test-node.js test complete: 21644 ms
|
||||
2021-04-15 15:26:00 [36mINFO: [39m test-node-gpu.js start
|
||||
2021-04-15 15:26:00 [33mWARN: [39m test-node-gpu.js stderr: 2021-04-15 15:26:00.693950: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
|
||||
2021-04-15 15:26:00 [33mWARN: [39m test-node-gpu.js stderr: 2021-04-15 15:26:00.762098: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory
|
||||
2021-04-15 15:26:00 [33mWARN: [39m test-node-gpu.js stderr: 2021-04-15 15:26:00.762145: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (wyse): /proc/driver/nvidia/version does not exist
|
||||
2021-04-15 15:26:00 [35mSTATE:[39m test-node-gpu.js passed: create human
|
||||
2021-04-15 15:26:00 [36mINFO: [39m test-node-gpu.js human version: 1.5.2
|
||||
2021-04-15 15:26:00 [36mINFO: [39m test-node-gpu.js platform: linux x64 agent: NodeJS v15.7.0
|
||||
2021-04-15 15:26:00 [36mINFO: [39m test-node-gpu.js tfjs version: 3.4.0
|
||||
2021-04-15 15:26:01 [35mSTATE:[39m test-node-gpu.js passed: set backend: tensorflow
|
||||
2021-04-15 15:26:01 [35mSTATE:[39m test-node-gpu.js passed: load models
|
||||
2021-04-15 15:26:01 [35mSTATE:[39m test-node-gpu.js result: defined models: 12 loaded models: 6
|
||||
2021-04-15 15:26:01 [35mSTATE:[39m test-node-gpu.js passed: warmup: none default
|
||||
2021-04-15 15:26:02 [35mSTATE:[39m test-node-gpu.js passed: warmup: face default
|
||||
2021-04-15 15:26:02 [32mDATA: [39m test-node-gpu.js result: face: 1 body: 0 hand: 0 gesture: 2 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.52,"class":"person"} {}
|
||||
2021-04-15 15:26:02 [32mDATA: [39m test-node-gpu.js result: performance: load: 464 total: 1309
|
||||
2021-04-15 15:26:03 [35mSTATE:[39m test-node-gpu.js passed: warmup: body default
|
||||
2021-04-15 15:26:03 [32mDATA: [39m test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 2 object: 3 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":0.95,"keypoints":17}
|
||||
2021-04-15 15:26:03 [32mDATA: [39m test-node-gpu.js result: performance: load: 464 total: 1275
|
||||
2021-04-15 15:26:03 [36mINFO: [39m test-node-gpu.js test body variants
|
||||
2021-04-15 15:26:05 [35mSTATE:[39m test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
|
||||
2021-04-15 15:26:06 [35mSTATE:[39m test-node-gpu.js passed: detect: assets/human-sample-body.jpg posenet
|
||||
2021-04-15 15:26:06 [32mDATA: [39m test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 2 object: 3 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":0.95,"keypoints":17}
|
||||
2021-04-15 15:26:06 [32mDATA: [39m test-node-gpu.js result: performance: load: 464 total: 1256
|
||||
2021-04-15 15:26:07 [35mSTATE:[39m test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
|
||||
2021-04-15 15:26:09 [35mSTATE:[39m test-node-gpu.js passed: detect: assets/human-sample-body.jpg efficientpose
|
||||
2021-04-15 15:26:09 [32mDATA: [39m test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 2 object: 3 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":0.75,"keypoints":13}
|
||||
2021-04-15 15:26:09 [32mDATA: [39m test-node-gpu.js result: performance: load: 464 total: 1947
|
||||
2021-04-15 15:26:10 [35mSTATE:[39m test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
|
||||
2021-04-15 15:26:11 [35mSTATE:[39m test-node-gpu.js passed: detect: assets/human-sample-body.jpg blazepose
|
||||
2021-04-15 15:26:11 [32mDATA: [39m test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 2 object: 3 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":1,"keypoints":39}
|
||||
2021-04-15 15:26:11 [32mDATA: [39m test-node-gpu.js result: performance: load: 464 total: 1495
|
||||
2021-04-15 15:26:12 [35mSTATE:[39m test-node-gpu.js passed: detect: random default
|
||||
2021-04-15 15:26:12 [32mDATA: [39m test-node-gpu.js result: face: 0 body: 1 hand: 0 gesture: 1 object: 0 {} {} {"score":1,"keypoints":39}
|
||||
2021-04-15 15:26:12 [32mDATA: [39m test-node-gpu.js result: performance: load: 464 total: 735
|
||||
2021-04-15 15:26:12 [36mINFO: [39m test-node-gpu.js test: first instance
|
||||
2021-04-15 15:26:13 [35mSTATE:[39m test-node-gpu.js passed: load image: assets/sample-me.jpg [1,700,700,3]
|
||||
2021-04-15 15:26:14 [35mSTATE:[39m test-node-gpu.js passed: detect: assets/sample-me.jpg default
|
||||
2021-04-15 15:26:14 [32mDATA: [39m test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 2 {"confidence":1,"age":39.2,"gender":"male"} {"score":0.7,"class":"person"} {"score":1,"keypoints":39}
|
||||
2021-04-15 15:26:14 [32mDATA: [39m test-node-gpu.js result: performance: load: 464 total: 1216
|
||||
2021-04-15 15:26:14 [36mINFO: [39m test-node-gpu.js test: second instance
|
||||
2021-04-15 15:26:14 [35mSTATE:[39m test-node-gpu.js passed: load image: assets/sample-me.jpg [1,700,700,3]
|
||||
2021-04-15 15:26:16 [35mSTATE:[39m test-node-gpu.js passed: detect: assets/sample-me.jpg default
|
||||
2021-04-15 15:26:16 [32mDATA: [39m test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 2 {"confidence":1,"age":39.2,"gender":"male"} {"score":0.7,"class":"person"} {"score":1,"keypoints":39}
|
||||
2021-04-15 15:26:16 [32mDATA: [39m test-node-gpu.js result: performance: load: 18 total: 1208
|
||||
2021-04-15 15:26:16 [36mINFO: [39m test-node-gpu.js test: concurrent
|
||||
2021-04-15 15:26:16 [35mSTATE:[39m test-node-gpu.js passed: load image: assets/human-sample-face.jpg [1,256,256,3]
|
||||
2021-04-15 15:26:16 [35mSTATE:[39m test-node-gpu.js passed: load image: assets/human-sample-face.jpg [1,256,256,3]
|
||||
2021-04-15 15:26:17 [35mSTATE:[39m test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
|
||||
2021-04-15 15:26:18 [35mSTATE:[39m test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
|
||||
2021-04-15 15:26:22 [35mSTATE:[39m test-node-gpu.js passed: detect: assets/human-sample-face.jpg default
|
||||
2021-04-15 15:26:22 [32mDATA: [39m test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.53,"class":"person"} {"score":1,"keypoints":39}
|
||||
2021-04-15 15:26:22 [32mDATA: [39m test-node-gpu.js result: performance: load: 464 total: 4281
|
||||
2021-04-15 15:26:22 [35mSTATE:[39m test-node-gpu.js passed: detect: assets/human-sample-face.jpg default
|
||||
2021-04-15 15:26:22 [32mDATA: [39m test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.53,"class":"person"} {"score":1,"keypoints":39}
|
||||
2021-04-15 15:26:22 [32mDATA: [39m test-node-gpu.js result: performance: load: 18 total: 4281
|
||||
2021-04-15 15:26:22 [35mSTATE:[39m test-node-gpu.js passed: detect: assets/human-sample-body.jpg default
|
||||
2021-04-15 15:26:22 [32mDATA: [39m test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 2 object: 3 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":1,"keypoints":39}
|
||||
2021-04-15 15:26:22 [32mDATA: [39m test-node-gpu.js result: performance: load: 464 total: 4281
|
||||
2021-04-15 15:26:22 [35mSTATE:[39m test-node-gpu.js passed: detect: assets/human-sample-body.jpg default
|
||||
2021-04-15 15:26:22 [32mDATA: [39m test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 2 object: 3 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":1,"keypoints":39}
|
||||
2021-04-15 15:26:22 [32mDATA: [39m test-node-gpu.js result: performance: load: 18 total: 4281
|
||||
2021-04-15 15:26:22 [36mINFO: [39m test-node-gpu.js test complete: 21681 ms
|
||||
2021-04-15 15:26:22 [36mINFO: [39m test-node-wasm.js start
|
||||
2021-04-15 15:26:23 [31mERROR:[39m test-node-wasm.js failed: model server: request to http://localhost:10030/models/ failed, reason: connect ECONNREFUSED 127.0.0.1:10030
|
||||
2021-04-15 15:26:23 [31mERROR:[39m test-node-wasm.js aborting test
|
||||
2021-04-15 15:26:23 [36mINFO: [39m status: {"passed":50,"failed":1}
|
||||
|
|
Loading…
Reference in New Issue