Skip to content

Commit c46d6b8

Browse files
committed
Release 1.13.16
1 parent d4ef3a1 commit c46d6b8

20 files changed

+518
-31
lines changed

cli/make-image.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export function makeVideo(buffer: Buffer, hmacKey: string | undefined, fileName:
7474
signature: emptySignature,
7575
payload: {
7676
device_type: "EDGE_IMPULSE_UPLOADER",
77-
interval_ms: 1000 / 25, // this is OK, gets figured out by ingestion
77+
interval_ms: 0, // this is OK, gets figured out by ingestion
7878
sensors: [{ name: 'video', units: 'rgba' }],
7979
values: [`Ref-BINARY-${mimeType} (${buffer.length} bytes) ${hmacVideo.digest().toString('hex')}`]
8080
}

cli/uploader.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,20 @@ const cliOptions = {
141141

142142
let fileArgs = process.argv.slice(argv);
143143

144+
if (fileArgs.length === 1 && Path.basename(fileArgs[0]) === 'bounding_boxes.labels') {
145+
console.log(``);
146+
console.log(`You don't need to upload "bounding_boxes.labels". When uploading an image we check whether ` +
147+
`a labels file is present in the same folder, and automatically attach the bounding boxes ` +
148+
`to the image.`);
149+
console.log(`So you can just do:`);
150+
console.log(` edge-impulse-uploader yourimage.jpg`);
151+
console.log(``);
152+
process.exit(1);
153+
}
154+
155+
// exclude 'bounding_boxes.labels'
156+
fileArgs = fileArgs.filter(f => Path.basename(f) !== 'bounding_boxes.labels');
157+
144158
if (!fileArgs[0]) {
145159
console.log('Requires at least one argument (a ' +
146160
validExtensions.slice(0, validExtensions.length - 1).join(', ') + ' or ' +
@@ -182,8 +196,6 @@ const cliOptions = {
182196
});
183197
}
184198
}
185-
186-
console.log('files', files.length);
187199
}
188200
else {
189201
if (validExtensions.indexOf(Path.extname(fileArgs[0].toLowerCase())) === -1) {

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "edge-impulse-cli",
3-
"version": "1.13.15",
3+
"version": "1.13.16",
44
"description": "Command-line interface tools for Edge Impulse",
55
"preferGlobal": true,
66
"scripts": {

sdk/studio/api/allowsReadOnlyApi.ts

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1897,6 +1897,88 @@ export class AllowsReadOnlyApi {
18971897
});
18981898
});
18991899
}
1900+
/**
1901+
* Get a sample as an video file. This only applies to samples with video data.
1902+
* @summary Get video file
1903+
* @param projectId Project ID
1904+
* @param sampleId Sample ID
1905+
* @param afterInputBlock Whether to process the image through the input block first
1906+
*/
1907+
public async getSampleAsVideo (projectId: number, sampleId: number, afterInputBlock?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
1908+
const localVarPath = this.basePath + '/api/{projectId}/raw-data/{sampleId}/video'
1909+
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
1910+
.replace('{' + 'sampleId' + '}', encodeURIComponent(String(sampleId)));
1911+
let localVarQueryParameters: any = {};
1912+
let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
1913+
const produces = ['video/mp4'];
1914+
// give precedence to 'application/json'
1915+
if (produces.indexOf('application/json') >= 0) {
1916+
localVarHeaderParams.Accept = 'application/json';
1917+
} else {
1918+
localVarHeaderParams.Accept = produces.join(',');
1919+
}
1920+
let localVarFormParams: any = {};
1921+
1922+
// verify required parameter 'projectId' is not null or undefined
1923+
if (projectId === null || projectId === undefined) {
1924+
throw new Error('Required parameter projectId was null or undefined when calling getSampleAsVideo.');
1925+
}
1926+
1927+
// verify required parameter 'sampleId' is not null or undefined
1928+
if (sampleId === null || sampleId === undefined) {
1929+
throw new Error('Required parameter sampleId was null or undefined when calling getSampleAsVideo.');
1930+
}
1931+
1932+
if (afterInputBlock !== undefined) {
1933+
localVarQueryParameters['afterInputBlock'] = ObjectSerializer.serialize(afterInputBlock, "boolean");
1934+
}
1935+
1936+
(<any>Object).assign(localVarHeaderParams, options.headers);
1937+
1938+
let localVarUseFormData = false;
1939+
1940+
let localVarRequestOptions: localVarRequest.Options = {
1941+
method: 'GET',
1942+
qs: localVarQueryParameters,
1943+
headers: localVarHeaderParams,
1944+
uri: localVarPath,
1945+
useQuerystring: this._useQuerystring,
1946+
agentOptions: (process.env.EI_HOST && process.env.EI_HOST !== "edgeimpulse.com") ? {keepAlive: true} : undefined,
1947+
encoding: null,
1948+
};
1949+
1950+
let authenticationPromise = Promise.resolve();
1951+
authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
1952+
1953+
authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
1954+
1955+
authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
1956+
1957+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1958+
return authenticationPromise.then(() => {
1959+
if (Object.keys(localVarFormParams).length) {
1960+
if (localVarUseFormData) {
1961+
(<any>localVarRequestOptions).formData = localVarFormParams;
1962+
} else {
1963+
localVarRequestOptions.form = localVarFormParams;
1964+
}
1965+
}
1966+
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
1967+
localVarRequest(localVarRequestOptions, (error, response, body) => {
1968+
if (error) {
1969+
reject(error);
1970+
} else {
1971+
body = ObjectSerializer.deserialize(body, "Buffer");
1972+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1973+
resolve({ response: response, body: body });
1974+
} else {
1975+
reject(new HttpError(response, body, response.statusCode));
1976+
}
1977+
}
1978+
});
1979+
});
1980+
});
1981+
}
19001982
/**
19011983
* Get a slice of a sample.
19021984
* @summary Get sample slice

sdk/studio/api/projectsApi.ts

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import { ListHmacKeysResponse } from '../model/listHmacKeysResponse';
3030
import { ListProjectsResponse } from '../model/listProjectsResponse';
3131
import { ListVersionsResponse } from '../model/listVersionsResponse';
3232
import { ProjectDataAxesSummaryResponse } from '../model/projectDataAxesSummaryResponse';
33+
import { ProjectDataIntervalResponse } from '../model/projectDataIntervalResponse';
3334
import { ProjectDownloadsResponse } from '../model/projectDownloadsResponse';
3435
import { ProjectInfoResponse } from '../model/projectInfoResponse';
3536
import { RemoveCollaboratorRequest } from '../model/removeCollaboratorRequest';
@@ -839,6 +840,76 @@ export class ProjectsApi {
839840
});
840841
});
841842
}
843+
/**
844+
* Get the interval of the training data; if multiple intervals are present, the interval of the longest data item is returned.
845+
* @summary Get the interval (in ms) of the training data
846+
* @param projectId Project ID
847+
*/
848+
public async getProjectRecommendedDataInterval (projectId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ProjectDataIntervalResponse; }> {
849+
const localVarPath = this.basePath + '/api/{projectId}/data-interval'
850+
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
851+
let localVarQueryParameters: any = {};
852+
let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
853+
const produces = ['application/json'];
854+
// give precedence to 'application/json'
855+
if (produces.indexOf('application/json') >= 0) {
856+
localVarHeaderParams.Accept = 'application/json';
857+
} else {
858+
localVarHeaderParams.Accept = produces.join(',');
859+
}
860+
let localVarFormParams: any = {};
861+
862+
// verify required parameter 'projectId' is not null or undefined
863+
if (projectId === null || projectId === undefined) {
864+
throw new Error('Required parameter projectId was null or undefined when calling getProjectRecommendedDataInterval.');
865+
}
866+
867+
(<any>Object).assign(localVarHeaderParams, options.headers);
868+
869+
let localVarUseFormData = false;
870+
871+
let localVarRequestOptions: localVarRequest.Options = {
872+
method: 'GET',
873+
qs: localVarQueryParameters,
874+
headers: localVarHeaderParams,
875+
uri: localVarPath,
876+
useQuerystring: this._useQuerystring,
877+
agentOptions: (process.env.EI_HOST && process.env.EI_HOST !== "edgeimpulse.com") ? {keepAlive: true} : undefined,
878+
json: true,
879+
};
880+
881+
let authenticationPromise = Promise.resolve();
882+
authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
883+
884+
authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
885+
886+
authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
887+
888+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
889+
return authenticationPromise.then(() => {
890+
if (Object.keys(localVarFormParams).length) {
891+
if (localVarUseFormData) {
892+
(<any>localVarRequestOptions).formData = localVarFormParams;
893+
} else {
894+
localVarRequestOptions.form = localVarFormParams;
895+
}
896+
}
897+
return new Promise<{ response: http.IncomingMessage; body: ProjectDataIntervalResponse; }>((resolve, reject) => {
898+
localVarRequest(localVarRequestOptions, (error, response, body) => {
899+
if (error) {
900+
reject(error);
901+
} else {
902+
body = ObjectSerializer.deserialize(body, "ProjectDataIntervalResponse");
903+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
904+
resolve({ response: response, body: body });
905+
} else {
906+
reject(new HttpError(response, body, response.statusCode));
907+
}
908+
}
909+
});
910+
});
911+
});
912+
}
842913
/**
843914
* Get a token to authenticate with the web socket interface.
844915
* @summary Get socket token

0 commit comments

Comments
 (0)