edge-impulse-linux 1.15.3 → 1.15.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli/linux/linux.js +8 -1
- package/build/cli/linux/linux.js.map +1 -1
- package/build/cli/linux/runner-utils.d.ts +6 -1
- package/build/cli/linux/runner-utils.js +31 -19
- package/build/cli/linux/runner-utils.js.map +1 -1
- package/build/cli/linux/runner.js +48 -18
- package/build/cli/linux/runner.js.map +1 -1
- package/build/cli-common/config.d.ts +3 -3
- package/build/cli-common/config.js +13 -13
- package/build/cli-common/config.js.map +1 -1
- package/build/cli-common/model-monitor.d.ts +1 -0
- package/build/cli-common/model-monitor.js +14 -17
- package/build/cli-common/model-monitor.js.map +1 -1
- package/build/library/classifier/image-classifier.d.ts +4 -1
- package/build/library/classifier/image-classifier.js +63 -52
- package/build/library/classifier/image-classifier.js.map +1 -1
- package/build/library/classifier/linux-impulse-runner.d.ts +1 -1
- package/build/library/index.d.ts +1 -0
- package/build/library/index.js +2 -1
- package/build/library/index.js.map +1 -1
- package/build/library/sensors/gstreamer.d.ts +18 -2
- package/build/library/sensors/gstreamer.js +54 -2
- package/build/library/sensors/gstreamer.js.map +1 -1
- package/build/library/sensors/icamera.d.ts +7 -0
- package/build/library/sensors/imagesnap.js +3 -0
- package/build/library/sensors/imagesnap.js.map +1 -1
- package/build/library/sensors/prophesee.js +3 -0
- package/build/library/sensors/prophesee.js.map +1 -1
- package/build/library/sensors/sensors-helper.d.ts +12 -5
- package/build/library/sensors/sensors-helper.js +9 -15
- package/build/library/sensors/sensors-helper.js.map +1 -1
- package/build/sdk/studio/sdk/api/deploymentApi.d.ts +1 -1
- package/build/sdk/studio/sdk/api/deploymentApi.js +1 -1
- package/build/sdk/studio/sdk/api/devicesApi.d.ts +22 -0
- package/build/sdk/studio/sdk/api/devicesApi.js +103 -0
- package/build/sdk/studio/sdk/api/devicesApi.js.map +1 -1
- package/build/sdk/studio/sdk/api/optimizationApi.d.ts +11 -0
- package/build/sdk/studio/sdk/api/optimizationApi.js +75 -0
- package/build/sdk/studio/sdk/api/optimizationApi.js.map +1 -1
- package/build/sdk/studio/sdk/api/rawDataApi.d.ts +79 -0
- package/build/sdk/studio/sdk/api/rawDataApi.js +211 -0
- package/build/sdk/studio/sdk/api/rawDataApi.js.map +1 -1
- package/build/sdk/studio/sdk/model/allBlocksResponse.d.ts +36 -0
- package/build/sdk/studio/sdk/model/allBlocksResponse.js +49 -0
- package/build/sdk/studio/sdk/model/allBlocksResponse.js.map +1 -0
- package/build/sdk/studio/sdk/model/allBlocksResponseAllOf.d.ts +28 -0
- package/build/sdk/studio/sdk/model/allBlocksResponseAllOf.js +39 -0
- package/build/sdk/studio/sdk/model/allBlocksResponseAllOf.js.map +1 -0
- package/build/sdk/studio/sdk/model/dSPGroupItem.d.ts +12 -0
- package/build/sdk/studio/sdk/model/dSPGroupItem.js +15 -0
- package/build/sdk/studio/sdk/model/dSPGroupItem.js.map +1 -1
- package/build/sdk/studio/sdk/model/getSampleMetadataFilterOptionsResponse.d.ts +39 -0
- package/build/sdk/studio/sdk/model/getSampleMetadataFilterOptionsResponse.js +49 -0
- package/build/sdk/studio/sdk/model/getSampleMetadataFilterOptionsResponse.js.map +1 -0
- package/build/sdk/studio/sdk/model/metadataFilterOptions.d.ts +31 -0
- package/build/sdk/studio/sdk/model/metadataFilterOptions.js +39 -0
- package/build/sdk/studio/sdk/model/metadataFilterOptions.js.map +1 -0
- package/build/sdk/studio/sdk/model/metadataFilterOptionsOptionsList.d.ts +26 -0
- package/build/sdk/studio/sdk/model/metadataFilterOptionsOptionsList.js +34 -0
- package/build/sdk/studio/sdk/model/metadataFilterOptionsOptionsList.js.map +1 -0
- package/build/sdk/studio/sdk/model/models.d.ts +10 -0
- package/build/sdk/studio/sdk/model/models.js +30 -0
- package/build/sdk/studio/sdk/model/models.js.map +1 -1
- package/build/sdk/studio/sdk/model/permission.d.ts +1 -1
- package/build/sdk/studio/sdk/model/permission.js +1 -1
- package/build/sdk/studio/sdk/model/permission.js.map +1 -1
- package/build/sdk/studio/sdk/model/tunerBlock.d.ts +42 -0
- package/build/sdk/studio/sdk/model/tunerBlock.js +79 -0
- package/build/sdk/studio/sdk/model/tunerBlock.js.map +1 -0
- package/build/sdk/studio/sdk/model/tunerBlockBlocks.d.ts +28 -0
- package/build/sdk/studio/sdk/model/tunerBlockBlocks.js +39 -0
- package/build/sdk/studio/sdk/model/tunerBlockBlocks.js.map +1 -0
- package/build/sdk/studio/sdk/model/tunerBlockBlocksInput.d.ts +27 -0
- package/build/sdk/studio/sdk/model/tunerBlockBlocksInput.js +39 -0
- package/build/sdk/studio/sdk/model/tunerBlockBlocksInput.js.map +1 -0
- package/build/sdk/studio/sdk/model/tunerBlockSearchSpaceTemplates.d.ts +28 -0
- package/build/sdk/studio/sdk/model/tunerBlockSearchSpaceTemplates.js +39 -0
- package/build/sdk/studio/sdk/model/tunerBlockSearchSpaceTemplates.js.map +1 -0
- package/build/sdk/studio/sdk/model/tunerBlockVariants.d.ts +34 -0
- package/build/sdk/studio/sdk/model/tunerBlockVariants.js +59 -0
- package/build/sdk/studio/sdk/model/tunerBlockVariants.js.map +1 -0
- package/examples/js/classify-camera.js +9 -2
- package/examples/ts/classify-camera-webserver.ts +8 -3
- package/examples/ts/classify-camera.ts +10 -3
- package/package.json +1 -1
- package/test/gstreamer.test.ts +191 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Edge Impulse API
|
|
4
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
*
|
|
6
|
+
* The version of the OpenAPI document: 1.0.0
|
|
7
|
+
*
|
|
8
|
+
*
|
|
9
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
10
|
+
* https://openapi-generator.tech
|
|
11
|
+
* Do not edit the class manually.
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.TunerBlockSearchSpaceTemplates = void 0;
|
|
15
|
+
class TunerBlockSearchSpaceTemplates {
|
|
16
|
+
static getAttributeTypeMap() {
|
|
17
|
+
return TunerBlockSearchSpaceTemplates.attributeTypeMap;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.TunerBlockSearchSpaceTemplates = TunerBlockSearchSpaceTemplates;
|
|
21
|
+
TunerBlockSearchSpaceTemplates.discriminator = undefined;
|
|
22
|
+
TunerBlockSearchSpaceTemplates.attributeTypeMap = [
|
|
23
|
+
{
|
|
24
|
+
"name": "template",
|
|
25
|
+
"baseName": "template",
|
|
26
|
+
"type": "string"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "group",
|
|
30
|
+
"baseName": "group",
|
|
31
|
+
"type": "string"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "blocks",
|
|
35
|
+
"baseName": "blocks",
|
|
36
|
+
"type": "TunerBlockBlocks"
|
|
37
|
+
}
|
|
38
|
+
];
|
|
39
|
+
//# sourceMappingURL=tunerBlockSearchSpaceTemplates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tunerBlockSearchSpaceTemplates.js","sourceRoot":"","sources":["../../../../../sdk/studio/sdk/model/tunerBlockSearchSpaceTemplates.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAIH,MAAa,8BAA8B;IAwBvC,MAAM,CAAC,mBAAmB;QACtB,OAAO,8BAA8B,CAAC,gBAAgB,CAAC;IAC3D,CAAC;;AA1BL,wEA2BC;AAtBU,4CAAa,GAAuB,SAAS,CAAC;AAE9C,+CAAgB,GAA0D;IAC7E;QACI,MAAM,EAAE,UAAU;QAClB,UAAU,EAAE,UAAU;QACtB,MAAM,EAAE,QAAQ;KACnB;IACD;QACI,MAAM,EAAE,OAAO;QACf,UAAU,EAAE,OAAO;QACnB,MAAM,EAAE,QAAQ;KACnB;IACD;QACI,MAAM,EAAE,QAAQ;QAChB,UAAU,EAAE,QAAQ;QACpB,MAAM,EAAE,kBAAkB;KAC7B;CAAK,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Edge Impulse API
|
|
3
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import { TunerBlockSearchSpaceTemplates } from './tunerBlockSearchSpaceTemplates';
|
|
13
|
+
export declare class TunerBlockVariants {
|
|
14
|
+
'title'?: string;
|
|
15
|
+
'key'?: string;
|
|
16
|
+
'regression'?: boolean;
|
|
17
|
+
'objectDetection'?: boolean;
|
|
18
|
+
'projectDataType'?: string;
|
|
19
|
+
'searchSpaceTemplates'?: Array<TunerBlockSearchSpaceTemplates>;
|
|
20
|
+
'params'?: {
|
|
21
|
+
[key: string]: Array<object>;
|
|
22
|
+
};
|
|
23
|
+
static discriminator: string | undefined;
|
|
24
|
+
static attributeTypeMap: Array<{
|
|
25
|
+
name: string;
|
|
26
|
+
baseName: string;
|
|
27
|
+
type: string;
|
|
28
|
+
}>;
|
|
29
|
+
static getAttributeTypeMap(): {
|
|
30
|
+
name: string;
|
|
31
|
+
baseName: string;
|
|
32
|
+
type: string;
|
|
33
|
+
}[];
|
|
34
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Edge Impulse API
|
|
4
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
*
|
|
6
|
+
* The version of the OpenAPI document: 1.0.0
|
|
7
|
+
*
|
|
8
|
+
*
|
|
9
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
10
|
+
* https://openapi-generator.tech
|
|
11
|
+
* Do not edit the class manually.
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.TunerBlockVariants = void 0;
|
|
15
|
+
class TunerBlockVariants {
|
|
16
|
+
static getAttributeTypeMap() {
|
|
17
|
+
return TunerBlockVariants.attributeTypeMap;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.TunerBlockVariants = TunerBlockVariants;
|
|
21
|
+
TunerBlockVariants.discriminator = undefined;
|
|
22
|
+
TunerBlockVariants.attributeTypeMap = [
|
|
23
|
+
{
|
|
24
|
+
"name": "title",
|
|
25
|
+
"baseName": "title",
|
|
26
|
+
"type": "string"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "key",
|
|
30
|
+
"baseName": "key",
|
|
31
|
+
"type": "string"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "regression",
|
|
35
|
+
"baseName": "regression",
|
|
36
|
+
"type": "boolean"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "objectDetection",
|
|
40
|
+
"baseName": "objectDetection",
|
|
41
|
+
"type": "boolean"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "projectDataType",
|
|
45
|
+
"baseName": "projectDataType",
|
|
46
|
+
"type": "string"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "searchSpaceTemplates",
|
|
50
|
+
"baseName": "searchSpaceTemplates",
|
|
51
|
+
"type": "Array<TunerBlockSearchSpaceTemplates>"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "params",
|
|
55
|
+
"baseName": "params",
|
|
56
|
+
"type": "{ [key: string]: Array<object>; }"
|
|
57
|
+
}
|
|
58
|
+
];
|
|
59
|
+
//# sourceMappingURL=tunerBlockVariants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tunerBlockVariants.js","sourceRoot":"","sources":["../../../../../sdk/studio/sdk/model/tunerBlockVariants.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAIH,MAAa,kBAAkB;IAgD3B,MAAM,CAAC,mBAAmB;QACtB,OAAO,kBAAkB,CAAC,gBAAgB,CAAC;IAC/C,CAAC;;AAlDL,gDAmDC;AA1CU,gCAAa,GAAuB,SAAS,CAAC;AAE9C,mCAAgB,GAA0D;IAC7E;QACI,MAAM,EAAE,OAAO;QACf,UAAU,EAAE,OAAO;QACnB,MAAM,EAAE,QAAQ;KACnB;IACD;QACI,MAAM,EAAE,KAAK;QACb,UAAU,EAAE,KAAK;QACjB,MAAM,EAAE,QAAQ;KACnB;IACD;QACI,MAAM,EAAE,YAAY;QACpB,UAAU,EAAE,YAAY;QACxB,MAAM,EAAE,SAAS;KACpB;IACD;QACI,MAAM,EAAE,iBAAiB;QACzB,UAAU,EAAE,iBAAiB;QAC7B,MAAM,EAAE,SAAS;KACpB;IACD;QACI,MAAM,EAAE,iBAAiB;QACzB,UAAU,EAAE,iBAAiB;QAC7B,MAAM,EAAE,QAAQ;KACnB;IACD;QACI,MAAM,EAAE,sBAAsB;QAC9B,UAAU,EAAE,sBAAsB;QAClC,MAAM,EAAE,uCAAuC;KAClD;IACD;QACI,MAAM,EAAE,QAAQ;QAChB,UAAU,EAAE,QAAQ;QACpB,MAAM,EAAE,mCAAmC;KAC9C;CAAK,CAAC"}
|
|
@@ -48,7 +48,9 @@ const { ImageClassifier, LinuxImpulseRunner, Ffmpeg, Imagesnap, RunnerHelloHasAn
|
|
|
48
48
|
camera = new Imagesnap();
|
|
49
49
|
}
|
|
50
50
|
else if (process.platform === 'linux') {
|
|
51
|
-
camera = new Ffmpeg(false /* verbose
|
|
51
|
+
camera = new Ffmpeg(false /* verbose */, {
|
|
52
|
+
scaleAndCropInPipeline: true,
|
|
53
|
+
});
|
|
52
54
|
}
|
|
53
55
|
else {
|
|
54
56
|
throw new Error('Unsupported platform "' + process.platform + '"');
|
|
@@ -71,7 +73,12 @@ const { ImageClassifier, LinuxImpulseRunner, Ffmpeg, Imagesnap, RunnerHelloHasAn
|
|
|
71
73
|
await camera.start({
|
|
72
74
|
device: device,
|
|
73
75
|
intervalMs: 1000 / fps,
|
|
74
|
-
dimensions: dimensions
|
|
76
|
+
dimensions: dimensions,
|
|
77
|
+
inferenceDimensions: {
|
|
78
|
+
width: model.modelParameters.image_input_width,
|
|
79
|
+
height: model.modelParameters.image_input_height,
|
|
80
|
+
resizeMode: model.modelParameters.image_resize_mode || 'none',
|
|
81
|
+
},
|
|
75
82
|
});
|
|
76
83
|
|
|
77
84
|
camera.on('error', error => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ImageClassifier, LinuxImpulseRunner,
|
|
1
|
+
import { ImageClassifier, LinuxImpulseRunner, ICamera, Imagesnap, ModelInformation, GStreamer } from "../../library";
|
|
2
2
|
import { ips } from "../../cli-common/get-ips";
|
|
3
3
|
import sharp from 'sharp';
|
|
4
4
|
import express = require('express');
|
|
@@ -58,7 +58,7 @@ import { RunnerHelloHasAnomaly } from "../../library/classifier/linux-impulse-ru
|
|
|
58
58
|
camera = new Imagesnap();
|
|
59
59
|
}
|
|
60
60
|
else if (process.platform === 'linux') {
|
|
61
|
-
camera = new
|
|
61
|
+
camera = new GStreamer(false /* verbose */);
|
|
62
62
|
}
|
|
63
63
|
else {
|
|
64
64
|
throw new Error('Unsupported platform "' + process.platform + '"');
|
|
@@ -81,7 +81,12 @@ import { RunnerHelloHasAnomaly } from "../../library/classifier/linux-impulse-ru
|
|
|
81
81
|
await camera.start({
|
|
82
82
|
device: device,
|
|
83
83
|
intervalMs: 1000 / fps,
|
|
84
|
-
dimensions: dimensions
|
|
84
|
+
dimensions: dimensions,
|
|
85
|
+
inferenceDimensions: {
|
|
86
|
+
width: model.modelParameters.image_input_width,
|
|
87
|
+
height: model.modelParameters.image_input_height,
|
|
88
|
+
resizeMode: model.modelParameters.image_resize_mode || 'none',
|
|
89
|
+
},
|
|
85
90
|
});
|
|
86
91
|
|
|
87
92
|
camera.on('error', error => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ImageClassifier, LinuxImpulseRunner,
|
|
1
|
+
import { ImageClassifier, LinuxImpulseRunner, ICamera, Imagesnap, GStreamer } from "../../library";
|
|
2
2
|
import { RunnerHelloHasAnomaly } from "../../library/classifier/linux-impulse-runner";
|
|
3
3
|
|
|
4
4
|
(async () => {
|
|
@@ -49,7 +49,9 @@ import { RunnerHelloHasAnomaly } from "../../library/classifier/linux-impulse-ru
|
|
|
49
49
|
camera = new Imagesnap();
|
|
50
50
|
}
|
|
51
51
|
else if (process.platform === 'linux') {
|
|
52
|
-
camera = new
|
|
52
|
+
camera = new GStreamer(false /* verbose */, {
|
|
53
|
+
scaleAndCropInPipeline: true,
|
|
54
|
+
});
|
|
53
55
|
}
|
|
54
56
|
else {
|
|
55
57
|
throw new Error('Unsupported platform "' + process.platform + '"');
|
|
@@ -72,7 +74,12 @@ import { RunnerHelloHasAnomaly } from "../../library/classifier/linux-impulse-ru
|
|
|
72
74
|
await camera.start({
|
|
73
75
|
device: device,
|
|
74
76
|
intervalMs: 1000 / fps,
|
|
75
|
-
dimensions: dimensions
|
|
77
|
+
dimensions: dimensions,
|
|
78
|
+
inferenceDimensions: {
|
|
79
|
+
width: model.modelParameters.image_input_width,
|
|
80
|
+
height: model.modelParameters.image_input_height,
|
|
81
|
+
resizeMode: model.modelParameters.image_resize_mode || 'none',
|
|
82
|
+
},
|
|
76
83
|
});
|
|
77
84
|
|
|
78
85
|
camera.on('error', error => {
|
package/package.json
CHANGED
package/test/gstreamer.test.ts
CHANGED
|
@@ -5234,6 +5234,7 @@ Freeing pipeline ...
|
|
|
5234
5234
|
|
|
5235
5235
|
const gstreamer = new GStreamer(false, {
|
|
5236
5236
|
spawnHelperOverride: spawnHelper,
|
|
5237
|
+
scaleAndCropInPipeline: true,
|
|
5237
5238
|
});
|
|
5238
5239
|
await gstreamer.init();
|
|
5239
5240
|
const launchResp = await gstreamer.getGstreamerLaunchCommand({
|
|
@@ -5246,7 +5247,195 @@ Freeing pipeline ...
|
|
|
5246
5247
|
type: "pylonsrc",
|
|
5247
5248
|
}],
|
|
5248
5249
|
videoSource: 'pylonsrc',
|
|
5249
|
-
}, { width: 1440, height: 1080 });
|
|
5250
|
+
}, { width: 1440, height: 1080 }, undefined);
|
|
5251
|
+
|
|
5252
|
+
// console.log('launchResp', launchResp);
|
|
5253
|
+
|
|
5254
|
+
assert.equal(launchResp.invokeProcess, 'spawn');
|
|
5255
|
+
assert.equal(launchResp.command, 'gst-launch-1.0');
|
|
5256
|
+
assert.equal(launchResp.args.join(' '),
|
|
5257
|
+
'pylonsrc ! video/x-raw,width=1440,height=1080 ! videoconvert ! jpegenc ! multifilesink location=test%05d.jpg');
|
|
5258
|
+
});
|
|
5259
|
+
|
|
5260
|
+
it("w/ inference dims #1", async () => {
|
|
5261
|
+
const spawnHelper: SpawnHelperType = async (command: string,
|
|
5262
|
+
args: string[],
|
|
5263
|
+
opts: {
|
|
5264
|
+
ignoreErrors: boolean,
|
|
5265
|
+
cwd ? : string
|
|
5266
|
+
} = {
|
|
5267
|
+
ignoreErrors: false
|
|
5268
|
+
}) => {
|
|
5269
|
+
|
|
5270
|
+
if (command === 'which') {
|
|
5271
|
+
return '';
|
|
5272
|
+
}
|
|
5273
|
+
else {
|
|
5274
|
+
throw new Error('spawnHelper failed on ' + command + ' ' + args.join(' '));
|
|
5275
|
+
}
|
|
5276
|
+
};
|
|
5277
|
+
|
|
5278
|
+
const gstreamer = new GStreamer(false, {
|
|
5279
|
+
spawnHelperOverride: spawnHelper,
|
|
5280
|
+
scaleAndCropInPipeline: true,
|
|
5281
|
+
});
|
|
5282
|
+
await gstreamer.init();
|
|
5283
|
+
const launchResp = await gstreamer.getGstreamerLaunchCommand({
|
|
5284
|
+
id: 'pylonsrc',
|
|
5285
|
+
name: 'Basler camera',
|
|
5286
|
+
caps: [{
|
|
5287
|
+
framerate: 60,
|
|
5288
|
+
height: 1080,
|
|
5289
|
+
width: 1440,
|
|
5290
|
+
type: "pylonsrc",
|
|
5291
|
+
}],
|
|
5292
|
+
videoSource: 'pylonsrc',
|
|
5293
|
+
}, { width: 1440, height: 1080 }, {
|
|
5294
|
+
width: 320,
|
|
5295
|
+
height: 320,
|
|
5296
|
+
resizeMode: 'fit-shortest',
|
|
5297
|
+
});
|
|
5298
|
+
|
|
5299
|
+
// console.log('launchResp', launchResp);
|
|
5300
|
+
|
|
5301
|
+
assert.equal(launchResp.invokeProcess, 'spawn');
|
|
5302
|
+
assert.equal(launchResp.command, 'gst-launch-1.0');
|
|
5303
|
+
assert.equal(launchResp.args.join(' '),
|
|
5304
|
+
'pylonsrc ! video/x-raw,width=1440,height=1080 ! videoconvert ! videocrop left=180 right=180 ! videoscale method=lanczos ! video/x-raw,width=320,height=320 ! jpegenc ! multifilesink location=test%05d.jpg');
|
|
5305
|
+
});
|
|
5306
|
+
|
|
5307
|
+
it("w/ inference dims #2", async () => {
|
|
5308
|
+
const spawnHelper: SpawnHelperType = async (command: string,
|
|
5309
|
+
args: string[],
|
|
5310
|
+
opts: {
|
|
5311
|
+
ignoreErrors: boolean,
|
|
5312
|
+
cwd ? : string
|
|
5313
|
+
} = {
|
|
5314
|
+
ignoreErrors: false
|
|
5315
|
+
}) => {
|
|
5316
|
+
|
|
5317
|
+
if (command === 'which') {
|
|
5318
|
+
return '';
|
|
5319
|
+
}
|
|
5320
|
+
else {
|
|
5321
|
+
throw new Error('spawnHelper failed on ' + command + ' ' + args.join(' '));
|
|
5322
|
+
}
|
|
5323
|
+
};
|
|
5324
|
+
|
|
5325
|
+
const gstreamer = new GStreamer(false, {
|
|
5326
|
+
spawnHelperOverride: spawnHelper,
|
|
5327
|
+
scaleAndCropInPipeline: true,
|
|
5328
|
+
});
|
|
5329
|
+
await gstreamer.init();
|
|
5330
|
+
const launchResp = await gstreamer.getGstreamerLaunchCommand({
|
|
5331
|
+
id: 'pylonsrc',
|
|
5332
|
+
name: 'Basler camera',
|
|
5333
|
+
caps: [{
|
|
5334
|
+
framerate: 60,
|
|
5335
|
+
height: 1080,
|
|
5336
|
+
width: 1440,
|
|
5337
|
+
type: "pylonsrc",
|
|
5338
|
+
}],
|
|
5339
|
+
videoSource: 'pylonsrc',
|
|
5340
|
+
}, { width: 1440, height: 1080 }, {
|
|
5341
|
+
width: 320,
|
|
5342
|
+
height: 320,
|
|
5343
|
+
resizeMode: 'squash',
|
|
5344
|
+
});
|
|
5345
|
+
|
|
5346
|
+
// console.log('launchResp', launchResp);
|
|
5347
|
+
|
|
5348
|
+
assert.equal(launchResp.invokeProcess, 'spawn');
|
|
5349
|
+
assert.equal(launchResp.command, 'gst-launch-1.0');
|
|
5350
|
+
assert.equal(launchResp.args.join(' '),
|
|
5351
|
+
'pylonsrc ! video/x-raw,width=1440,height=1080 ! videoconvert ! videoscale method=lanczos ! video/x-raw,width=320,height=320 ! jpegenc ! multifilesink location=test%05d.jpg');
|
|
5352
|
+
});
|
|
5353
|
+
|
|
5354
|
+
it("w/ inference dims #3", async () => {
|
|
5355
|
+
const spawnHelper: SpawnHelperType = async (command: string,
|
|
5356
|
+
args: string[],
|
|
5357
|
+
opts: {
|
|
5358
|
+
ignoreErrors: boolean,
|
|
5359
|
+
cwd ? : string
|
|
5360
|
+
} = {
|
|
5361
|
+
ignoreErrors: false
|
|
5362
|
+
}) => {
|
|
5363
|
+
|
|
5364
|
+
if (command === 'which') {
|
|
5365
|
+
return '';
|
|
5366
|
+
}
|
|
5367
|
+
else {
|
|
5368
|
+
throw new Error('spawnHelper failed on ' + command + ' ' + args.join(' '));
|
|
5369
|
+
}
|
|
5370
|
+
};
|
|
5371
|
+
|
|
5372
|
+
const gstreamer = new GStreamer(false, {
|
|
5373
|
+
spawnHelperOverride: spawnHelper,
|
|
5374
|
+
scaleAndCropInPipeline: true,
|
|
5375
|
+
});
|
|
5376
|
+
await gstreamer.init();
|
|
5377
|
+
const launchResp = await gstreamer.getGstreamerLaunchCommand({
|
|
5378
|
+
id: 'pylonsrc',
|
|
5379
|
+
name: 'Basler camera',
|
|
5380
|
+
caps: [{
|
|
5381
|
+
framerate: 60,
|
|
5382
|
+
height: 1080,
|
|
5383
|
+
width: 1440,
|
|
5384
|
+
type: "pylonsrc",
|
|
5385
|
+
}],
|
|
5386
|
+
videoSource: 'pylonsrc',
|
|
5387
|
+
}, { width: 1440, height: 1080 }, {
|
|
5388
|
+
width: 320,
|
|
5389
|
+
height: 320,
|
|
5390
|
+
resizeMode: 'fit-longest',
|
|
5391
|
+
});
|
|
5392
|
+
|
|
5393
|
+
// console.log('launchResp', launchResp);
|
|
5394
|
+
|
|
5395
|
+
assert.equal(launchResp.invokeProcess, 'spawn');
|
|
5396
|
+
assert.equal(launchResp.command, 'gst-launch-1.0');
|
|
5397
|
+
assert.equal(launchResp.args.join(' '),
|
|
5398
|
+
'pylonsrc ! video/x-raw,width=1440,height=1080 ! videoconvert ! jpegenc ! multifilesink location=test%05d.jpg');
|
|
5399
|
+
});
|
|
5400
|
+
|
|
5401
|
+
it("w/ inference dims #4", async () => {
|
|
5402
|
+
const spawnHelper: SpawnHelperType = async (command: string,
|
|
5403
|
+
args: string[],
|
|
5404
|
+
opts: {
|
|
5405
|
+
ignoreErrors: boolean,
|
|
5406
|
+
cwd ? : string
|
|
5407
|
+
} = {
|
|
5408
|
+
ignoreErrors: false
|
|
5409
|
+
}) => {
|
|
5410
|
+
|
|
5411
|
+
if (command === 'which') {
|
|
5412
|
+
return '';
|
|
5413
|
+
}
|
|
5414
|
+
else {
|
|
5415
|
+
throw new Error('spawnHelper failed on ' + command + ' ' + args.join(' '));
|
|
5416
|
+
}
|
|
5417
|
+
};
|
|
5418
|
+
|
|
5419
|
+
const gstreamer = new GStreamer(false, {
|
|
5420
|
+
spawnHelperOverride: spawnHelper,
|
|
5421
|
+
scaleAndCropInPipeline: undefined,
|
|
5422
|
+
});
|
|
5423
|
+
await gstreamer.init();
|
|
5424
|
+
const launchResp = await gstreamer.getGstreamerLaunchCommand({
|
|
5425
|
+
id: 'pylonsrc',
|
|
5426
|
+
name: 'Basler camera',
|
|
5427
|
+
caps: [{
|
|
5428
|
+
framerate: 60,
|
|
5429
|
+
height: 1080,
|
|
5430
|
+
width: 1440,
|
|
5431
|
+
type: "pylonsrc",
|
|
5432
|
+
}],
|
|
5433
|
+
videoSource: 'pylonsrc',
|
|
5434
|
+
}, { width: 1440, height: 1080 }, {
|
|
5435
|
+
width: 320,
|
|
5436
|
+
height: 320,
|
|
5437
|
+
resizeMode: 'squash',
|
|
5438
|
+
});
|
|
5250
5439
|
|
|
5251
5440
|
// console.log('launchResp', launchResp);
|
|
5252
5441
|
|
|
@@ -5302,6 +5491,7 @@ async function testGetDevices(output: {
|
|
|
5302
5491
|
const gstreamer = new GStreamer(false, {
|
|
5303
5492
|
spawnHelperOverride: spawnHelper,
|
|
5304
5493
|
modeOverride: output?.modeOverride,
|
|
5494
|
+
scaleAndCropInPipeline: true,
|
|
5305
5495
|
});
|
|
5306
5496
|
await gstreamer.init();
|
|
5307
5497
|
const devices = await gstreamer.getAllDevices();
|