edge-impulse-linux 1.8.9 → 1.9.0
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/check-new-version.js +1 -1
- package/build/cli/check-new-version.js.map +1 -1
- package/build/cli/config.d.ts +7 -0
- package/build/cli/config.js +16 -1
- package/build/cli/config.js.map +1 -1
- package/build/cli/init-cli-app.js +1 -1
- package/build/cli/init-cli-app.js.map +1 -1
- package/build/cli/linux/remote-mgmt-service.d.ts +3 -1
- package/build/cli/linux/remote-mgmt-service.js +1 -1
- package/build/cli/linux/remote-mgmt-service.js.map +1 -1
- package/build/cli/linux/runner-downloader.d.ts +17 -2
- package/build/cli/linux/runner-downloader.js +42 -18
- package/build/cli/linux/runner-downloader.js.map +1 -1
- package/build/cli/linux/runner.js +93 -14
- package/build/cli/linux/runner.js.map +1 -1
- package/build/cli/linux/webserver/views/escape-html-template-tag/escape.js.map +1 -1
- package/build/library/argv-split.js.map +1 -1
- package/build/library/sensors/gstreamer.js +1 -1
- package/build/library/sensors/gstreamer.js.map +1 -1
- package/build/library/sensors/prophesee.js.map +1 -1
- package/build/library/sensors/recorder.js.map +1 -1
- package/build/sdk/studio/sdk/api/adminApi.d.ts +166 -19
- package/build/sdk/studio/sdk/api/adminApi.js +1052 -202
- package/build/sdk/studio/sdk/api/adminApi.js.map +1 -1
- package/build/sdk/studio/sdk/api/authApi.js +2 -2
- package/build/sdk/studio/sdk/api/authApi.js.map +1 -1
- package/build/sdk/studio/sdk/api/cDNApi.js +1 -1
- package/build/sdk/studio/sdk/api/cDNApi.js.map +1 -1
- package/build/sdk/studio/sdk/api/canaryApi.js +1 -1
- package/build/sdk/studio/sdk/api/canaryApi.js.map +1 -1
- package/build/sdk/studio/sdk/api/classifyApi.d.ts +25 -7
- package/build/sdk/studio/sdk/api/classifyApi.js +41 -13
- package/build/sdk/studio/sdk/api/classifyApi.js.map +1 -1
- package/build/sdk/studio/sdk/api/dSPApi.d.ts +3 -3
- package/build/sdk/studio/sdk/api/dSPApi.js +12 -12
- package/build/sdk/studio/sdk/api/dSPApi.js.map +1 -1
- package/build/sdk/studio/sdk/api/deploymentApi.d.ts +45 -9
- package/build/sdk/studio/sdk/api/deploymentApi.js +57 -17
- package/build/sdk/studio/sdk/api/deploymentApi.js.map +1 -1
- package/build/sdk/studio/sdk/api/emailVerificationApi.d.ts +12 -0
- package/build/sdk/studio/sdk/api/emailVerificationApi.js +70 -0
- package/build/sdk/studio/sdk/api/emailVerificationApi.js.map +1 -1
- package/build/sdk/studio/sdk/api/healthApi.d.ts +2 -2
- package/build/sdk/studio/sdk/api/healthApi.js +2 -2
- package/build/sdk/studio/sdk/api/healthApi.js.map +1 -1
- package/build/sdk/studio/sdk/api/impulseApi.d.ts +121 -25
- package/build/sdk/studio/sdk/api/impulseApi.js +537 -52
- package/build/sdk/studio/sdk/api/impulseApi.js.map +1 -1
- package/build/sdk/studio/sdk/api/jobsApi.d.ts +99 -15
- package/build/sdk/studio/sdk/api/jobsApi.js +381 -29
- package/build/sdk/studio/sdk/api/jobsApi.js.map +1 -1
- package/build/sdk/studio/sdk/api/learnApi.d.ts +41 -17
- package/build/sdk/studio/sdk/api/learnApi.js +47 -15
- package/build/sdk/studio/sdk/api/learnApi.js.map +1 -1
- package/build/sdk/studio/sdk/api/optimizationApi.d.ts +36 -0
- package/build/sdk/studio/sdk/api/optimizationApi.js +245 -2
- package/build/sdk/studio/sdk/api/optimizationApi.js.map +1 -1
- package/build/sdk/studio/sdk/api/organizationBlocksApi.d.ts +2 -3
- package/build/sdk/studio/sdk/api/organizationBlocksApi.js +28 -28
- package/build/sdk/studio/sdk/api/organizationBlocksApi.js.map +1 -1
- package/build/sdk/studio/sdk/api/organizationCreateProjectApi.d.ts +2 -2
- package/build/sdk/studio/sdk/api/organizationCreateProjectApi.js +8 -8
- package/build/sdk/studio/sdk/api/organizationCreateProjectApi.js.map +1 -1
- package/build/sdk/studio/sdk/api/organizationDataApi.d.ts +8 -123
- package/build/sdk/studio/sdk/api/organizationDataApi.js +37 -621
- package/build/sdk/studio/sdk/api/organizationDataApi.js.map +1 -1
- package/build/sdk/studio/sdk/api/organizationDataCampaignsApi.d.ts +1 -2
- package/build/sdk/studio/sdk/api/organizationJobsApi.d.ts +6 -6
- package/build/sdk/studio/sdk/api/organizationJobsApi.js +18 -18
- package/build/sdk/studio/sdk/api/organizationJobsApi.js.map +1 -1
- package/build/sdk/studio/sdk/api/organizationPipelinesApi.d.ts +3 -3
- package/build/sdk/studio/sdk/api/organizationPipelinesApi.js +3 -3
- package/build/sdk/studio/sdk/api/organizationPipelinesApi.js.map +1 -1
- package/build/sdk/studio/sdk/api/organizationsApi.d.ts +97 -29
- package/build/sdk/studio/sdk/api/organizationsApi.js +416 -54
- package/build/sdk/studio/sdk/api/organizationsApi.js.map +1 -1
- package/build/sdk/studio/sdk/api/performanceCalibrationApi.d.ts +66 -11
- package/build/sdk/studio/sdk/api/performanceCalibrationApi.js +127 -10
- package/build/sdk/studio/sdk/api/performanceCalibrationApi.js.map +1 -1
- package/build/sdk/studio/sdk/api/projectsApi.d.ts +15 -18
- package/build/sdk/studio/sdk/api/projectsApi.js +17 -82
- package/build/sdk/studio/sdk/api/projectsApi.js.map +1 -1
- package/build/sdk/studio/sdk/api/rawDataApi.d.ts +16 -6
- package/build/sdk/studio/sdk/api/rawDataApi.js +122 -102
- package/build/sdk/studio/sdk/api/rawDataApi.js.map +1 -1
- package/build/sdk/studio/sdk/api/themesApi.d.ts +1 -2
- package/build/sdk/studio/sdk/api/thirdPartyAuthApi.d.ts +1 -2
- package/build/sdk/studio/sdk/api/thirdPartyAuthApi.js +1 -1
- package/build/sdk/studio/sdk/api/thirdPartyAuthApi.js.map +1 -1
- package/build/sdk/studio/sdk/api/uploadPortalApi.js +1 -1
- package/build/sdk/studio/sdk/api/uploadPortalApi.js.map +1 -1
- package/build/sdk/studio/sdk/api/userApi.d.ts +5 -4
- package/build/sdk/studio/sdk/api/userApi.js +7 -1
- package/build/sdk/studio/sdk/api/userApi.js.map +1 -1
- package/build/sdk/studio/sdk/model/addOrganizationTransferLearningBlockRequest.d.ts +7 -0
- package/build/sdk/studio/sdk/model/addOrganizationTransferLearningBlockRequest.js +10 -0
- package/build/sdk/studio/sdk/model/addOrganizationTransferLearningBlockRequest.js.map +1 -1
- package/build/sdk/studio/sdk/model/adminGetOrganizationComputeTimeUsageResponse.d.ts +1 -1
- package/build/sdk/studio/sdk/model/adminGetOrganizationsResponseAllOfOrganizations.d.ts +1 -0
- package/build/sdk/studio/sdk/model/adminGetOrganizationsResponseAllOfOrganizations.js +5 -0
- package/build/sdk/studio/sdk/model/adminGetOrganizationsResponseAllOfOrganizations.js.map +1 -1
- package/build/sdk/studio/sdk/model/{organizationProjectsDataBatchDisableResponse.d.ts → adminGetReportResponse.d.ts} +3 -2
- package/build/sdk/studio/sdk/model/{adminGetOrganizationUsageReportResponse.js → adminGetReportResponse.js} +8 -8
- package/build/sdk/studio/sdk/model/adminGetReportResponse.js.map +1 -0
- package/build/sdk/studio/sdk/model/adminGetReportResponseAllOf.d.ts +26 -0
- package/build/sdk/studio/sdk/model/adminGetReportResponseAllOf.js +29 -0
- package/build/sdk/studio/sdk/model/adminGetReportResponseAllOf.js.map +1 -0
- package/build/sdk/studio/sdk/model/{adminGetOrganizationUsageReportsResponse.d.ts → adminGetReportsResponse.d.ts} +3 -3
- package/build/sdk/studio/sdk/model/{adminGetOrganizationUsageReportsResponse.js → adminGetReportsResponse.js} +8 -8
- package/build/sdk/studio/sdk/model/adminGetReportsResponse.js.map +1 -0
- package/build/sdk/studio/sdk/model/{adminGetOrganizationUsageReportsResponseAllOf.d.ts → adminGetReportsResponseAllOf.d.ts} +3 -3
- package/build/sdk/studio/sdk/model/{adminGetOrganizationUsageReportsResponseAllOf.js → adminGetReportsResponseAllOf.js} +8 -8
- package/build/sdk/studio/sdk/model/adminGetReportsResponseAllOf.js.map +1 -0
- package/build/sdk/studio/sdk/model/adminOrganizationInfoResponse.d.ts +1 -1
- package/build/sdk/studio/sdk/model/adminUpdateConfigRequest.d.ts +28 -0
- package/build/sdk/studio/sdk/model/adminUpdateConfigRequest.js +29 -0
- package/build/sdk/studio/sdk/model/adminUpdateConfigRequest.js.map +1 -0
- package/build/sdk/studio/sdk/model/allLearnBlocksResponse.d.ts +34 -0
- package/build/sdk/studio/sdk/model/allLearnBlocksResponse.js +39 -0
- package/build/sdk/studio/sdk/model/allLearnBlocksResponse.js.map +1 -0
- package/build/sdk/studio/sdk/model/allLearnBlocksResponseAllOf.d.ts +26 -0
- package/build/sdk/studio/sdk/model/allLearnBlocksResponseAllOf.js +29 -0
- package/build/sdk/studio/sdk/model/allLearnBlocksResponseAllOf.js.map +1 -0
- package/build/sdk/studio/sdk/model/allLearnBlocksResponseAllOfLearnBlocks.d.ts +36 -0
- package/build/sdk/studio/sdk/model/allLearnBlocksResponseAllOfLearnBlocks.js +69 -0
- package/build/sdk/studio/sdk/model/allLearnBlocksResponseAllOfLearnBlocks.js.map +1 -0
- package/build/sdk/studio/sdk/model/{anomalyResponseAllOf.d.ts → anomalyConfig.d.ts} +3 -3
- package/build/sdk/studio/sdk/model/{anomalyResponseAllOf.js → anomalyConfig.js} +8 -8
- package/build/sdk/studio/sdk/model/anomalyConfig.js.map +1 -0
- package/build/sdk/studio/sdk/model/{anomalyResponseAllOfAxes.d.ts → anomalyConfigAxes.d.ts} +1 -1
- package/build/sdk/studio/sdk/model/{anomalyResponseAllOfAxes.js → anomalyConfigAxes.js} +7 -7
- package/build/sdk/studio/sdk/model/anomalyConfigAxes.js.map +1 -0
- package/build/sdk/studio/sdk/model/{anomalyResponse.d.ts → anomalyConfigResponse.d.ts} +3 -3
- package/build/sdk/studio/sdk/model/{anomalyResponse.js → anomalyConfigResponse.js} +8 -8
- package/build/sdk/studio/sdk/model/anomalyConfigResponse.js.map +1 -0
- package/build/sdk/studio/sdk/model/anomalyGmmMetadata.d.ts +0 -8
- package/build/sdk/studio/sdk/model/anomalyGmmMetadata.js +0 -10
- package/build/sdk/studio/sdk/model/anomalyGmmMetadata.js.map +1 -1
- package/build/sdk/studio/sdk/model/{anomalyGmmMetadataAllOf.d.ts → anomalyGmmMetadataResponse.d.ts} +9 -1
- package/build/sdk/studio/sdk/model/{anomalyGmmMetadataAllOf.js → anomalyGmmMetadataResponse.js} +17 -7
- package/build/sdk/studio/sdk/model/anomalyGmmMetadataResponse.js.map +1 -0
- package/build/sdk/studio/sdk/model/anomalyModelMetadata.d.ts +2 -10
- package/build/sdk/studio/sdk/model/anomalyModelMetadata.js +1 -11
- package/build/sdk/studio/sdk/model/anomalyModelMetadata.js.map +1 -1
- package/build/sdk/studio/sdk/model/{anomalyModelMetadataAllOfClusters.d.ts → anomalyModelMetadataClusters.d.ts} +1 -1
- package/build/sdk/studio/sdk/model/{anomalyModelMetadataAllOfClusters.js → anomalyModelMetadataClusters.js} +7 -7
- package/build/sdk/studio/sdk/model/anomalyModelMetadataClusters.js.map +1 -0
- package/build/sdk/studio/sdk/model/{anomalyModelMetadataAllOf.d.ts → anomalyModelMetadataResponse.d.ts} +11 -3
- package/build/sdk/studio/sdk/model/{anomalyModelMetadataAllOf.js → anomalyModelMetadataResponse.js} +18 -8
- package/build/sdk/studio/sdk/model/anomalyModelMetadataResponse.js.map +1 -0
- package/build/sdk/studio/sdk/model/blockParameters.d.ts +47 -0
- package/build/sdk/studio/sdk/model/blockParameters.js +52 -0
- package/build/sdk/studio/sdk/model/blockParameters.js.map +1 -0
- package/build/sdk/studio/sdk/model/blockParamsVisualAnomalyGmm.d.ts +28 -0
- package/build/sdk/studio/sdk/model/blockParamsVisualAnomalyGmm.js +29 -0
- package/build/sdk/studio/sdk/model/blockParamsVisualAnomalyGmm.js.map +1 -0
- package/build/sdk/studio/sdk/model/blockParamsVisualAnomalyPatchcore.d.ts +44 -0
- package/build/sdk/studio/sdk/model/blockParamsVisualAnomalyPatchcore.js +49 -0
- package/build/sdk/studio/sdk/model/blockParamsVisualAnomalyPatchcore.js.map +1 -0
- package/build/sdk/studio/sdk/model/canaryResponse.d.ts +8 -0
- package/build/sdk/studio/sdk/model/canaryResponse.js +10 -0
- package/build/sdk/studio/sdk/model/canaryResponse.js.map +1 -1
- package/build/sdk/studio/sdk/model/canaryResponseAllOf.d.ts +28 -0
- package/build/sdk/studio/sdk/model/{getNotesResponseAllOf.js → canaryResponseAllOf.js} +10 -10
- package/build/sdk/studio/sdk/model/canaryResponseAllOf.js.map +1 -0
- package/build/sdk/studio/sdk/model/classifySampleResponseClassification.d.ts +1 -1
- package/build/sdk/studio/sdk/model/{organizationProjectsDataBatchRequest.d.ts → cloneImpulseRequest.d.ts} +2 -2
- package/build/sdk/studio/sdk/model/cloneImpulseRequest.js +29 -0
- package/build/sdk/studio/sdk/model/cloneImpulseRequest.js.map +1 -0
- package/build/sdk/studio/sdk/model/createImpulseRequest.d.ts +43 -0
- package/build/sdk/studio/sdk/model/createImpulseRequest.js +44 -0
- package/build/sdk/studio/sdk/model/createImpulseRequest.js.map +1 -0
- package/build/sdk/studio/sdk/model/{createBlockVersionResponse.d.ts → createImpulseResponse.d.ts} +2 -2
- package/build/sdk/studio/sdk/model/{createBlockVersionResponse.js → createImpulseResponse.js} +7 -7
- package/build/sdk/studio/sdk/model/createImpulseResponse.js.map +1 -0
- package/build/sdk/studio/sdk/model/{createBlockVersionResponseAllOf.d.ts → createImpulseResponseAllOf.d.ts} +2 -2
- package/build/sdk/studio/sdk/model/{createBlockVersionResponseAllOf.js → createImpulseResponseAllOf.js} +7 -7
- package/build/sdk/studio/sdk/model/createImpulseResponseAllOf.js.map +1 -0
- package/build/sdk/studio/sdk/model/{adminGetOrganizationUsageReportResponse.d.ts → createNewEmptyImpulseResponse.d.ts} +9 -3
- package/build/sdk/studio/sdk/model/{getOrganizationProjectsDataCountResponse.js → createNewEmptyImpulseResponse.js} +14 -9
- package/build/sdk/studio/sdk/model/createNewEmptyImpulseResponse.js.map +1 -0
- package/build/sdk/studio/sdk/model/{listOrganizationProjectsDataResponseAllOfProjects.d.ts → createNewEmptyImpulseResponseAllOf.d.ts} +8 -4
- package/build/sdk/studio/sdk/model/createNewEmptyImpulseResponseAllOf.js +34 -0
- package/build/sdk/studio/sdk/model/createNewEmptyImpulseResponseAllOf.js.map +1 -0
- package/build/sdk/studio/sdk/model/createProTierUserRequest.d.ts +4 -0
- package/build/sdk/studio/sdk/model/createProTierUserRequest.js +5 -0
- package/build/sdk/studio/sdk/model/createProTierUserRequest.js.map +1 -1
- package/build/sdk/studio/sdk/model/createUserRequest.d.ts +4 -0
- package/build/sdk/studio/sdk/model/createUserRequest.js +5 -0
- package/build/sdk/studio/sdk/model/createUserRequest.js.map +1 -1
- package/build/sdk/studio/sdk/model/{dSPConfigResponseAllOf.d.ts → dSPConfig.d.ts} +1 -1
- package/build/sdk/studio/sdk/model/{dSPConfigResponseAllOf.js → dSPConfig.js} +7 -7
- package/build/sdk/studio/sdk/model/dSPConfig.js.map +1 -0
- package/build/sdk/studio/sdk/model/dataExplorerSettings.d.ts +4 -0
- package/build/sdk/studio/sdk/model/dataExplorerSettings.js +5 -0
- package/build/sdk/studio/sdk/model/dataExplorerSettings.js.map +1 -1
- package/build/sdk/studio/sdk/model/deployPretrainedModelRequest.d.ts +6 -0
- package/build/sdk/studio/sdk/model/deployPretrainedModelRequest.js +7 -1
- package/build/sdk/studio/sdk/model/deployPretrainedModelRequest.js.map +1 -1
- package/build/sdk/studio/sdk/model/deploymentTargetEngine.d.ts +1 -1
- package/build/sdk/studio/sdk/model/deploymentTargetEngine.js +1 -1
- package/build/sdk/studio/sdk/model/deploymentTargetEngine.js.map +1 -1
- package/build/sdk/studio/sdk/model/detailedImpulse.d.ts +44 -0
- package/build/sdk/studio/sdk/model/detailedImpulse.js +64 -0
- package/build/sdk/studio/sdk/model/detailedImpulse.js.map +1 -0
- package/build/sdk/studio/sdk/model/detailedImpulseDspBlockConfigs.d.ts +29 -0
- package/build/sdk/studio/sdk/model/detailedImpulseDspBlockConfigs.js +39 -0
- package/build/sdk/studio/sdk/model/detailedImpulseDspBlockConfigs.js.map +1 -0
- package/build/sdk/studio/sdk/model/detailedImpulseLearnBlockAnomalyConfigs.d.ts +31 -0
- package/build/sdk/studio/sdk/model/detailedImpulseLearnBlockAnomalyConfigs.js +44 -0
- package/build/sdk/studio/sdk/model/detailedImpulseLearnBlockAnomalyConfigs.js.map +1 -0
- package/build/sdk/studio/sdk/model/detailedImpulseLearnBlockKerasConfigs.d.ts +29 -0
- package/build/sdk/studio/sdk/model/detailedImpulseLearnBlockKerasConfigs.js +39 -0
- package/build/sdk/studio/sdk/model/detailedImpulseLearnBlockKerasConfigs.js.map +1 -0
- package/build/sdk/studio/sdk/model/detailedImpulseMetric.d.ts +40 -0
- package/build/sdk/studio/sdk/model/detailedImpulseMetric.js +70 -0
- package/build/sdk/studio/sdk/model/detailedImpulseMetric.js.map +1 -0
- package/build/sdk/studio/sdk/model/detailedImpulseMetricCategory.d.ts +13 -0
- package/build/sdk/studio/sdk/model/detailedImpulseMetricCategory.js +16 -0
- package/build/sdk/studio/sdk/model/detailedImpulseMetricCategory.js.map +1 -0
- package/build/sdk/studio/sdk/model/detailedImpulseMetricFilteringType.d.ts +28 -0
- package/build/sdk/studio/sdk/model/detailedImpulseMetricFilteringType.js +35 -0
- package/build/sdk/studio/sdk/model/detailedImpulseMetricFilteringType.js.map +1 -0
- package/build/sdk/studio/sdk/model/{getNotesResponseAllOf.d.ts → detailedImpulsePretrainedModelInfo.d.ts} +2 -3
- package/build/sdk/studio/sdk/model/detailedImpulsePretrainedModelInfo.js +29 -0
- package/build/sdk/studio/sdk/model/detailedImpulsePretrainedModelInfo.js.map +1 -0
- package/build/sdk/studio/sdk/model/downgradeSubscriptionRequest.d.ts +28 -0
- package/build/sdk/studio/sdk/model/downgradeSubscriptionRequest.js +29 -0
- package/build/sdk/studio/sdk/model/downgradeSubscriptionRequest.js.map +1 -0
- package/build/sdk/studio/sdk/model/editSampleLabelRequest.d.ts +1 -1
- package/build/sdk/studio/sdk/model/emailValidationRequest.d.ts +28 -0
- package/build/sdk/studio/sdk/model/emailValidationRequest.js +29 -0
- package/build/sdk/studio/sdk/model/emailValidationRequest.js.map +1 -0
- package/build/sdk/studio/sdk/model/feature.d.ts +1 -1
- package/build/sdk/studio/sdk/model/feature.js +1 -1
- package/build/sdk/studio/sdk/model/feature.js.map +1 -1
- package/build/sdk/studio/sdk/model/getAllDetailedImpulsesResponse.d.ts +40 -0
- package/build/sdk/studio/sdk/model/getAllDetailedImpulsesResponse.js +49 -0
- package/build/sdk/studio/sdk/model/getAllDetailedImpulsesResponse.js.map +1 -0
- package/build/sdk/studio/sdk/model/getAllDetailedImpulsesResponseAllOf.d.ts +32 -0
- package/build/sdk/studio/sdk/model/getAllDetailedImpulsesResponseAllOf.js +39 -0
- package/build/sdk/studio/sdk/model/getAllDetailedImpulsesResponseAllOf.js.map +1 -0
- package/build/sdk/studio/sdk/model/getAllDetailedImpulsesResponseAllOfMetricKeys.d.ts +32 -0
- package/build/sdk/studio/sdk/model/getAllDetailedImpulsesResponseAllOfMetricKeys.js +50 -0
- package/build/sdk/studio/sdk/model/getAllDetailedImpulsesResponseAllOfMetricKeys.js.map +1 -0
- package/build/sdk/studio/sdk/model/getAllDetailedImpulsesResponseAllOfMetricKeysByCategory.d.ts +28 -0
- package/build/sdk/studio/sdk/model/getAllDetailedImpulsesResponseAllOfMetricKeysByCategory.js +34 -0
- package/build/sdk/studio/sdk/model/getAllDetailedImpulsesResponseAllOfMetricKeysByCategory.js.map +1 -0
- package/build/sdk/studio/sdk/model/{getNotesResponse.d.ts → getAllImpulsesResponse.d.ts} +3 -3
- package/build/sdk/studio/sdk/model/getAllImpulsesResponse.js +39 -0
- package/build/sdk/studio/sdk/model/getAllImpulsesResponse.js.map +1 -0
- package/build/sdk/studio/sdk/model/getAllImpulsesResponseAllOf.d.ts +26 -0
- package/build/sdk/studio/sdk/model/getAllImpulsesResponseAllOf.js +29 -0
- package/build/sdk/studio/sdk/model/getAllImpulsesResponseAllOf.js.map +1 -0
- package/build/sdk/studio/sdk/model/getDataExplorerSettingsResponse.d.ts +4 -0
- package/build/sdk/studio/sdk/model/getDataExplorerSettingsResponse.js +5 -0
- package/build/sdk/studio/sdk/model/getDataExplorerSettingsResponse.js.map +1 -1
- package/build/sdk/studio/sdk/model/getJobResponse.d.ts +1 -1
- package/build/sdk/studio/sdk/model/getJobResponseAllOf.d.ts +1 -1
- package/build/sdk/studio/sdk/model/getModelVariantsResponse.d.ts +1 -1
- package/build/sdk/studio/sdk/model/getModelVariantsResponseAllOf.d.ts +1 -1
- package/build/sdk/studio/sdk/model/{getOrganizationProjectsDataCountResponse.d.ts → getNewBlockIdResponse.d.ts} +2 -2
- package/build/sdk/studio/sdk/model/{getNotesResponse.js → getNewBlockIdResponse.js} +10 -10
- package/build/sdk/studio/sdk/model/getNewBlockIdResponse.js.map +1 -0
- package/build/sdk/studio/sdk/model/getNewBlockIdResponseAllOf.d.ts +25 -0
- package/build/sdk/studio/sdk/model/getNewBlockIdResponseAllOf.js +29 -0
- package/build/sdk/studio/sdk/model/getNewBlockIdResponseAllOf.js.map +1 -0
- package/build/sdk/studio/sdk/model/getOrganizationUsageReportResponse.d.ts +2 -2
- package/build/sdk/studio/sdk/model/getOrganizationUsageReportResponse.js +1 -1
- package/build/sdk/studio/sdk/model/getOrganizationUsageReportResponse.js.map +1 -1
- package/build/sdk/studio/sdk/model/getPostProcessingResultsResponse.d.ts +48 -0
- package/build/sdk/studio/sdk/model/getPostProcessingResultsResponse.js +54 -0
- package/build/sdk/studio/sdk/model/getPostProcessingResultsResponse.js.map +1 -0
- package/build/sdk/studio/sdk/model/{note.d.ts → getPostProcessingResultsResponseAllOf.d.ts} +9 -12
- package/build/sdk/studio/sdk/model/getPostProcessingResultsResponseAllOf.js +44 -0
- package/build/sdk/studio/sdk/model/getPostProcessingResultsResponseAllOf.js.map +1 -0
- package/build/sdk/studio/sdk/model/getStudioConfigResponse.d.ts +37 -0
- package/build/sdk/studio/sdk/model/getStudioConfigResponse.js +39 -0
- package/build/sdk/studio/sdk/model/getStudioConfigResponse.js.map +1 -0
- package/build/sdk/studio/sdk/model/getStudioConfigResponseAllOf.d.ts +29 -0
- package/build/sdk/studio/sdk/model/getStudioConfigResponseAllOf.js +29 -0
- package/build/sdk/studio/sdk/model/getStudioConfigResponseAllOf.js.map +1 -0
- package/build/sdk/studio/sdk/model/{adminGetOrganizationUsageReportResponseAllOf.d.ts → getStudioConfigResponseAllOfConfig.d.ts} +9 -3
- package/build/sdk/studio/sdk/model/getStudioConfigResponseAllOfConfig.js +34 -0
- package/build/sdk/studio/sdk/model/getStudioConfigResponseAllOfConfig.js.map +1 -0
- package/build/sdk/studio/sdk/model/getUserResponse.d.ts +4 -0
- package/build/sdk/studio/sdk/model/getUserResponse.js +5 -0
- package/build/sdk/studio/sdk/model/getUserResponse.js.map +1 -1
- package/build/sdk/studio/sdk/model/getUserResponseAllOf.d.ts +4 -0
- package/build/sdk/studio/sdk/model/getUserResponseAllOf.js +5 -0
- package/build/sdk/studio/sdk/model/getUserResponseAllOf.js.map +1 -1
- package/build/sdk/studio/sdk/model/impulse.d.ts +8 -0
- package/build/sdk/studio/sdk/model/impulse.js +10 -0
- package/build/sdk/studio/sdk/model/impulse.js.map +1 -1
- package/build/sdk/studio/sdk/model/impulseDspBlock.d.ts +5 -36
- package/build/sdk/studio/sdk/model/impulseDspBlock.js +5 -45
- package/build/sdk/studio/sdk/model/impulseDspBlock.js.map +1 -1
- package/build/sdk/studio/sdk/model/impulseDspBlockNamedAxes.d.ts +40 -0
- package/build/sdk/studio/sdk/model/{listOrganizationProjectsDataResponseAllOfProjects.js → impulseDspBlockNamedAxes.js} +16 -16
- package/build/sdk/studio/sdk/model/impulseDspBlockNamedAxes.js.map +1 -0
- package/build/sdk/studio/sdk/model/impulseInputBlock.d.ts +4 -38
- package/build/sdk/studio/sdk/model/impulseInputBlock.js +6 -46
- package/build/sdk/studio/sdk/model/impulseInputBlock.js.map +1 -1
- package/build/sdk/studio/sdk/model/impulseInputBlockDatasetSubset.d.ts +29 -0
- package/build/sdk/studio/sdk/model/impulseInputBlockDatasetSubset.js +37 -0
- package/build/sdk/studio/sdk/model/impulseInputBlockDatasetSubset.js.map +1 -0
- package/build/sdk/studio/sdk/model/impulseLearnBlock.d.ts +0 -36
- package/build/sdk/studio/sdk/model/impulseLearnBlock.js +0 -45
- package/build/sdk/studio/sdk/model/impulseLearnBlock.js.map +1 -1
- package/build/sdk/studio/sdk/model/inputBlock.d.ts +1 -1
- package/build/sdk/studio/sdk/model/inputBlock.js +1 -1
- package/build/sdk/studio/sdk/model/inputBlock.js.map +1 -1
- package/build/sdk/studio/sdk/model/{kerasResponseAllOf.d.ts → kerasConfig.d.ts} +6 -4
- package/build/sdk/studio/sdk/model/{kerasResponseAllOf.js → kerasConfig.js} +14 -9
- package/build/sdk/studio/sdk/model/kerasConfig.js.map +1 -0
- package/build/sdk/studio/sdk/model/kerasModelMetadata.d.ts +3 -10
- package/build/sdk/studio/sdk/model/kerasModelMetadata.js +3 -12
- package/build/sdk/studio/sdk/model/kerasModelMetadata.js.map +1 -1
- package/build/sdk/studio/sdk/model/{kerasModelMetadataAllOf.d.ts → kerasModelMetadataResponse.d.ts} +12 -3
- package/build/sdk/studio/sdk/model/{kerasModelMetadataAllOf.js → kerasModelMetadataResponse.js} +19 -8
- package/build/sdk/studio/sdk/model/kerasModelMetadataResponse.js.map +1 -0
- package/build/sdk/studio/sdk/model/kerasResponse.d.ts +2 -0
- package/build/sdk/studio/sdk/model/kerasResponse.js +5 -0
- package/build/sdk/studio/sdk/model/kerasResponse.js.map +1 -1
- package/build/sdk/studio/sdk/model/kerasVisualLayerType.d.ts +1 -1
- package/build/sdk/studio/sdk/model/kerasVisualLayerType.js +1 -1
- package/build/sdk/studio/sdk/model/kerasVisualLayerType.js.map +1 -1
- package/build/sdk/studio/sdk/model/listOrganizationUsageReportsResponse.d.ts +2 -2
- package/build/sdk/studio/sdk/model/listOrganizationUsageReportsResponse.js +1 -1
- package/build/sdk/studio/sdk/model/listOrganizationUsageReportsResponse.js.map +1 -1
- package/build/sdk/studio/sdk/model/listOrganizationUsageReportsResponseAllOf.d.ts +2 -2
- package/build/sdk/studio/sdk/model/listOrganizationUsageReportsResponseAllOf.js +1 -1
- package/build/sdk/studio/sdk/model/listOrganizationUsageReportsResponseAllOf.js.map +1 -1
- package/build/sdk/studio/sdk/model/listVersionsResponseAllOfVersions.d.ts +10 -0
- package/build/sdk/studio/sdk/model/listVersionsResponseAllOfVersions.js +5 -0
- package/build/sdk/studio/sdk/model/listVersionsResponseAllOfVersions.js.map +1 -1
- package/build/sdk/studio/sdk/model/modelPrediction.d.ts +1 -1
- package/build/sdk/studio/sdk/model/models.d.ts +70 -29
- package/build/sdk/studio/sdk/model/models.js +229 -99
- package/build/sdk/studio/sdk/model/models.js.map +1 -1
- package/build/sdk/studio/sdk/model/optimizeConfig.d.ts +74 -12
- package/build/sdk/studio/sdk/model/optimizeConfig.js +93 -13
- package/build/sdk/studio/sdk/model/optimizeConfig.js.map +1 -1
- package/build/sdk/studio/sdk/model/optimizeConfigResponse.d.ts +74 -12
- package/build/sdk/studio/sdk/model/optimizeConfigResponse.js +93 -13
- package/build/sdk/studio/sdk/model/optimizeConfigResponse.js.map +1 -1
- package/build/sdk/studio/sdk/model/optimizeConfigSearchSpaceTemplate.d.ts +45 -0
- package/build/sdk/studio/sdk/model/optimizeConfigSearchSpaceTemplate.js +48 -0
- package/build/sdk/studio/sdk/model/optimizeConfigSearchSpaceTemplate.js.map +1 -0
- package/build/sdk/studio/sdk/model/optimizeStateResponse.d.ts +5 -0
- package/build/sdk/studio/sdk/model/optimizeStateResponse.js +10 -0
- package/build/sdk/studio/sdk/model/optimizeStateResponse.js.map +1 -1
- package/build/sdk/studio/sdk/model/optimizeStateResponseAllOf.d.ts +5 -0
- package/build/sdk/studio/sdk/model/optimizeStateResponseAllOf.js +10 -0
- package/build/sdk/studio/sdk/model/optimizeStateResponseAllOf.js.map +1 -1
- package/build/sdk/studio/sdk/model/organizationAddDataFolderRequest.d.ts +2 -3
- package/build/sdk/studio/sdk/model/organizationAddDataFolderRequest.js +2 -3
- package/build/sdk/studio/sdk/model/organizationAddDataFolderRequest.js.map +1 -1
- package/build/sdk/studio/sdk/model/organizationAddDatasetRequest.d.ts +2 -3
- package/build/sdk/studio/sdk/model/organizationAddDatasetRequest.js +2 -3
- package/build/sdk/studio/sdk/model/organizationAddDatasetRequest.js.map +1 -1
- package/build/sdk/studio/sdk/model/organizationComputeTimeUsage.d.ts +1 -1
- package/build/sdk/studio/sdk/model/organizationCreateProjectWithFilesAllOfFiles.d.ts +2 -3
- package/build/sdk/studio/sdk/model/organizationCreateProjectWithFilesAllOfFiles.js +2 -3
- package/build/sdk/studio/sdk/model/organizationCreateProjectWithFilesAllOfFiles.js.map +1 -1
- package/build/sdk/studio/sdk/model/organizationDataset.d.ts +1 -2
- package/build/sdk/studio/sdk/model/organizationDataset.js +1 -2
- package/build/sdk/studio/sdk/model/organizationDataset.js.map +1 -1
- package/build/sdk/studio/sdk/model/organizationDatasetTypeEnum.d.ts +13 -0
- package/build/sdk/studio/sdk/model/organizationDatasetTypeEnum.js +16 -0
- package/build/sdk/studio/sdk/model/organizationDatasetTypeEnum.js.map +1 -0
- package/build/sdk/studio/sdk/model/organizationMetricsResponseAllOfMetrics.d.ts +2 -2
- package/build/sdk/studio/sdk/model/organizationPipelineFeedingIntoDataset.d.ts +2 -0
- package/build/sdk/studio/sdk/model/organizationPipelineFeedingIntoDataset.js +5 -0
- package/build/sdk/studio/sdk/model/organizationPipelineFeedingIntoDataset.js.map +1 -1
- package/build/sdk/studio/sdk/model/organizationTransferLearningBlock.d.ts +5 -0
- package/build/sdk/studio/sdk/model/organizationTransferLearningBlock.js +5 -0
- package/build/sdk/studio/sdk/model/organizationTransferLearningBlock.js.map +1 -1
- package/build/sdk/studio/sdk/model/organizationTransferLearningBlockCustomVariant.d.ts +34 -0
- package/build/sdk/studio/sdk/model/organizationTransferLearningBlockCustomVariant.js +39 -0
- package/build/sdk/studio/sdk/model/organizationTransferLearningBlockCustomVariant.js.map +1 -0
- package/build/sdk/studio/sdk/model/organizationTransferLearningBlockModelFile.d.ts +42 -0
- package/build/sdk/studio/sdk/model/organizationTransferLearningBlockModelFile.js +45 -0
- package/build/sdk/studio/sdk/model/organizationTransferLearningBlockModelFile.js.map +1 -0
- package/build/sdk/studio/sdk/model/organizationUser.d.ts +8 -0
- package/build/sdk/studio/sdk/model/organizationUser.js +10 -0
- package/build/sdk/studio/sdk/model/organizationUser.js.map +1 -1
- package/build/sdk/studio/sdk/model/organizationUserAllOf.d.ts +8 -0
- package/build/sdk/studio/sdk/model/organizationUserAllOf.js +10 -0
- package/build/sdk/studio/sdk/model/organizationUserAllOf.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/project.d.ts +5 -0
- package/build/sdk/studio/sdk/model/project.js +10 -0
- package/build/sdk/studio/sdk/model/project.js.map +1 -1
- package/build/sdk/studio/sdk/model/projectInfoResponse.d.ts +4 -0
- package/build/sdk/studio/sdk/model/projectInfoResponse.js +5 -0
- package/build/sdk/studio/sdk/model/projectInfoResponse.js.map +1 -1
- package/build/sdk/studio/sdk/model/projectInfoResponseAllOf.d.ts +4 -0
- package/build/sdk/studio/sdk/model/projectInfoResponseAllOf.js +5 -0
- package/build/sdk/studio/sdk/model/projectInfoResponseAllOf.js.map +1 -1
- package/build/sdk/studio/sdk/model/projectPublicData.d.ts +6 -0
- package/build/sdk/studio/sdk/model/projectPublicData.js.map +1 -1
- package/build/sdk/studio/sdk/model/{organizationUsageReport.d.ts → report.d.ts} +1 -1
- package/build/sdk/studio/sdk/model/{organizationUsageReport.js → report.js} +7 -7
- package/build/sdk/studio/sdk/model/report.js.map +1 -0
- package/build/sdk/studio/sdk/model/sample.d.ts +1 -1
- package/build/sdk/studio/sdk/model/sample.js +1 -1
- package/build/sdk/studio/sdk/model/sample.js.map +1 -1
- package/build/sdk/studio/sdk/model/setKerasParameterRequest.d.ts +2 -0
- package/build/sdk/studio/sdk/model/setKerasParameterRequest.js +5 -0
- package/build/sdk/studio/sdk/model/setKerasParameterRequest.js.map +1 -1
- package/build/sdk/studio/sdk/model/{organizationProjectsDataBulkMetadataRequest.d.ts → setLegacyImpulseStateInternalRequest.d.ts} +18 -3
- package/build/sdk/studio/sdk/model/setLegacyImpulseStateInternalRequest.js +39 -0
- package/build/sdk/studio/sdk/model/setLegacyImpulseStateInternalRequest.js.map +1 -0
- package/build/sdk/studio/sdk/model/setTunerPrimaryJobRequest.d.ts +28 -0
- package/build/sdk/studio/sdk/model/setTunerPrimaryJobRequest.js +29 -0
- package/build/sdk/studio/sdk/model/setTunerPrimaryJobRequest.js.map +1 -0
- package/build/sdk/studio/sdk/model/startClassifyJobRequest.d.ts +1 -1
- package/build/sdk/studio/sdk/model/startPostProcessingRequest.d.ts +60 -0
- package/build/sdk/studio/sdk/model/startPostProcessingRequest.js +70 -0
- package/build/sdk/studio/sdk/model/startPostProcessingRequest.js.map +1 -0
- package/build/sdk/studio/sdk/model/transferLearningModel.d.ts +1 -0
- package/build/sdk/studio/sdk/model/transferLearningModel.js +5 -0
- package/build/sdk/studio/sdk/model/transferLearningModel.js.map +1 -1
- package/build/sdk/studio/sdk/model/tunerCompleteSearch.d.ts +25 -0
- package/build/sdk/studio/sdk/model/tunerCompleteSearch.js +29 -0
- package/build/sdk/studio/sdk/model/tunerCompleteSearch.js.map +1 -0
- package/build/sdk/studio/sdk/model/tunerCreateTrialImpulse.d.ts +1 -0
- package/build/sdk/studio/sdk/model/tunerCreateTrialImpulse.js +5 -0
- package/build/sdk/studio/sdk/model/tunerCreateTrialImpulse.js.map +1 -1
- package/build/sdk/studio/sdk/model/tunerRun.d.ts +5 -0
- package/build/sdk/studio/sdk/model/tunerRun.js +5 -0
- package/build/sdk/studio/sdk/model/tunerRun.js.map +1 -1
- package/build/sdk/studio/sdk/model/tunerSpaceImpulse.d.ts +1 -1
- package/build/sdk/studio/sdk/model/tunerSpaceImpulse.js +1 -1
- package/build/sdk/studio/sdk/model/tunerSpaceImpulse.js.map +1 -1
- package/build/sdk/studio/sdk/model/tunerTrial.d.ts +8 -0
- package/build/sdk/studio/sdk/model/tunerTrial.js +25 -0
- package/build/sdk/studio/sdk/model/tunerTrial.js.map +1 -1
- package/build/sdk/studio/sdk/model/tunerTrialBlocks.d.ts +4 -0
- package/build/sdk/studio/sdk/model/tunerTrialBlocks.js +5 -0
- package/build/sdk/studio/sdk/model/tunerTrialBlocks.js.map +1 -1
- package/build/sdk/studio/sdk/model/tunerTrialImpulseAddedToProject.d.ts +26 -0
- package/build/sdk/studio/sdk/model/tunerTrialImpulseAddedToProject.js +34 -0
- package/build/sdk/studio/sdk/model/tunerTrialImpulseAddedToProject.js.map +1 -0
- package/build/sdk/studio/sdk/model/tunerTrialMetrics.d.ts +28 -0
- package/build/sdk/studio/sdk/model/tunerTrialMetrics.js +39 -0
- package/build/sdk/studio/sdk/model/tunerTrialMetrics.js.map +1 -0
- package/build/sdk/studio/sdk/model/tunerTrialMetricsTest.d.ts +27 -0
- package/build/sdk/studio/sdk/model/tunerTrialMetricsTest.js +34 -0
- package/build/sdk/studio/sdk/model/tunerTrialMetricsTest.js.map +1 -0
- package/build/sdk/studio/sdk/model/tunerTrialProgress.d.ts +29 -0
- package/build/sdk/studio/sdk/model/tunerTrialProgress.js +49 -0
- package/build/sdk/studio/sdk/model/tunerTrialProgress.js.map +1 -0
- package/build/sdk/studio/sdk/model/updateImpulseRequest.d.ts +26 -0
- package/build/sdk/studio/sdk/model/updateImpulseRequest.js +34 -0
- package/build/sdk/studio/sdk/model/updateImpulseRequest.js.map +1 -0
- package/build/sdk/studio/sdk/model/updateOrganizationDatasetRequest.d.ts +2 -3
- package/build/sdk/studio/sdk/model/updateOrganizationDatasetRequest.js +2 -3
- package/build/sdk/studio/sdk/model/updateOrganizationDatasetRequest.js.map +1 -1
- package/build/sdk/studio/sdk/model/updateOrganizationTransferLearningBlockRequest.d.ts +5 -0
- package/build/sdk/studio/sdk/model/updateOrganizationTransferLearningBlockRequest.js +5 -0
- package/build/sdk/studio/sdk/model/updateOrganizationTransferLearningBlockRequest.js.map +1 -1
- package/build/sdk/studio/sdk/model/updateProjectRequest.d.ts +12 -0
- package/build/sdk/studio/sdk/model/updateProjectRequest.js +15 -0
- package/build/sdk/studio/sdk/model/updateProjectRequest.js.map +1 -1
- package/build/sdk/studio/sdk/model/updateUserRequest.d.ts +4 -0
- package/build/sdk/studio/sdk/model/updateUserRequest.js +5 -0
- package/build/sdk/studio/sdk/model/updateUserRequest.js.map +1 -1
- package/build/sdk/studio/sdk/model/userOrganization.d.ts +15 -0
- package/build/sdk/studio/sdk/model/userOrganization.js +15 -0
- package/build/sdk/studio/sdk/model/userOrganization.js.map +1 -1
- package/build/sdk/studio/sdk/model/validateEmailResponse.d.ts +58 -0
- package/build/sdk/studio/sdk/model/validateEmailResponse.js +65 -0
- package/build/sdk/studio/sdk/model/validateEmailResponse.js.map +1 -0
- package/build/sdk/studio/sdk/model/validateEmailResponseAllOf.d.ts +50 -0
- package/build/sdk/studio/sdk/model/validateEmailResponseAllOf.js +55 -0
- package/build/sdk/studio/sdk/model/validateEmailResponseAllOf.js.map +1 -0
- package/build/sdk/studio/sdk/model/{windowSettingsResponseAllOfWindowSettings.d.ts → windowSettings.d.ts} +1 -1
- package/build/sdk/studio/sdk/model/{windowSettingsResponseAllOfWindowSettings.js → windowSettings.js} +7 -7
- package/build/sdk/studio/sdk/model/windowSettings.js.map +1 -0
- package/build/sdk/studio/sdk/model/windowSettingsResponse.d.ts +3 -2
- package/build/sdk/studio/sdk/model/windowSettingsResponse.js +8 -3
- package/build/sdk/studio/sdk/model/windowSettingsResponse.js.map +1 -1
- package/build/sdk/studio/sdk/model/windowSettingsResponseAllOf.d.ts +3 -2
- package/build/sdk/studio/sdk/model/windowSettingsResponseAllOf.js +8 -3
- package/build/sdk/studio/sdk/model/windowSettingsResponseAllOf.js.map +1 -1
- package/build/shared/bounding-box-file-types.d.ts +1 -0
- package/build/shared/bounding-box-file-types.js +7 -2
- package/build/shared/bounding-box-file-types.js.map +1 -1
- package/build/shared/daemon/ei-serial-protocol.d.ts +6 -0
- package/build/shared/daemon/ei-serial-protocol.js +31 -1
- package/build/shared/daemon/ei-serial-protocol.js.map +1 -1
- package/build/shared/daemon/remote-mgmt-service.d.ts +3 -1
- package/build/shared/daemon/remote-mgmt-service.js +1 -1
- package/build/shared/daemon/remote-mgmt-service.js.map +1 -1
- package/build/shared/viewmodels/init.d.ts +4 -1
- package/build/shared/viewmodels/init.js +11 -2
- package/build/shared/viewmodels/init.js.map +1 -1
- package/examples/ts/classify-audio.ts +83 -0
- package/examples/ts/classify-camera-webserver.ts +190 -0
- package/examples/ts/classify-camera.ts +113 -0
- package/examples/ts/classify-custom-from-test.ts +97 -0
- package/examples/ts/classify-custom.ts +63 -0
- package/examples/ts/collect-custom.ts +56 -0
- package/package.json +29 -16
- package/build/sdk/studio/sdk/model/adminGetOrganizationUsageReportResponse.js.map +0 -1
- package/build/sdk/studio/sdk/model/adminGetOrganizationUsageReportResponseAllOf.js +0 -29
- package/build/sdk/studio/sdk/model/adminGetOrganizationUsageReportResponseAllOf.js.map +0 -1
- package/build/sdk/studio/sdk/model/adminGetOrganizationUsageReportsResponse.js.map +0 -1
- package/build/sdk/studio/sdk/model/adminGetOrganizationUsageReportsResponseAllOf.js.map +0 -1
- package/build/sdk/studio/sdk/model/anomalyGmmMetadataAllOf.js.map +0 -1
- package/build/sdk/studio/sdk/model/anomalyModelMetadataAllOf.js.map +0 -1
- package/build/sdk/studio/sdk/model/anomalyModelMetadataAllOfClusters.js.map +0 -1
- package/build/sdk/studio/sdk/model/anomalyResponse.js.map +0 -1
- package/build/sdk/studio/sdk/model/anomalyResponseAllOf.js.map +0 -1
- package/build/sdk/studio/sdk/model/anomalyResponseAllOfAxes.js.map +0 -1
- package/build/sdk/studio/sdk/model/createBlockVersionResponse.js.map +0 -1
- package/build/sdk/studio/sdk/model/createBlockVersionResponseAllOf.js.map +0 -1
- package/build/sdk/studio/sdk/model/dSPConfigResponseAllOf.js.map +0 -1
- package/build/sdk/studio/sdk/model/getNotesResponse.js.map +0 -1
- package/build/sdk/studio/sdk/model/getNotesResponseAllOf.js.map +0 -1
- package/build/sdk/studio/sdk/model/getOrganizationProjectsDataCountResponse.js.map +0 -1
- package/build/sdk/studio/sdk/model/impulseBlockVersion.d.ts +0 -98
- package/build/sdk/studio/sdk/model/impulseBlockVersion.js +0 -112
- package/build/sdk/studio/sdk/model/impulseBlockVersion.js.map +0 -1
- package/build/sdk/studio/sdk/model/kerasModelMetadataAllOf.js.map +0 -1
- package/build/sdk/studio/sdk/model/kerasResponseAllOf.js.map +0 -1
- package/build/sdk/studio/sdk/model/listOrganizationProjectsDataResponse.d.ts +0 -36
- package/build/sdk/studio/sdk/model/listOrganizationProjectsDataResponse.js +0 -44
- package/build/sdk/studio/sdk/model/listOrganizationProjectsDataResponse.js.map +0 -1
- package/build/sdk/studio/sdk/model/listOrganizationProjectsDataResponseAllOf.d.ts +0 -28
- package/build/sdk/studio/sdk/model/listOrganizationProjectsDataResponseAllOf.js +0 -34
- package/build/sdk/studio/sdk/model/listOrganizationProjectsDataResponseAllOf.js.map +0 -1
- package/build/sdk/studio/sdk/model/listOrganizationProjectsDataResponseAllOfProjects.js.map +0 -1
- package/build/sdk/studio/sdk/model/note.js +0 -59
- package/build/sdk/studio/sdk/model/note.js.map +0 -1
- package/build/sdk/studio/sdk/model/organizationProjectsDataBatchDisableResponse.js +0 -39
- package/build/sdk/studio/sdk/model/organizationProjectsDataBatchDisableResponse.js.map +0 -1
- package/build/sdk/studio/sdk/model/organizationProjectsDataBatchEnableResponse.d.ts +0 -33
- package/build/sdk/studio/sdk/model/organizationProjectsDataBatchEnableResponse.js +0 -39
- package/build/sdk/studio/sdk/model/organizationProjectsDataBatchEnableResponse.js.map +0 -1
- package/build/sdk/studio/sdk/model/organizationProjectsDataBatchRequest.js +0 -29
- package/build/sdk/studio/sdk/model/organizationProjectsDataBatchRequest.js.map +0 -1
- package/build/sdk/studio/sdk/model/organizationProjectsDataBulkMetadataRequest.js +0 -34
- package/build/sdk/studio/sdk/model/organizationProjectsDataBulkMetadataRequest.js.map +0 -1
- package/build/sdk/studio/sdk/model/organizationUsageReport.js.map +0 -1
- package/build/sdk/studio/sdk/model/windowSettingsResponseAllOfWindowSettings.js.map +0 -1
- package/build/test/gstreamer.test.d.ts +0 -1
- package/build/test/gstreamer.test.js +0 -4248
- package/build/test/gstreamer.test.js.map +0 -1
- package/cli/linux/camera-debug.ts +0 -172
- package/cli/linux/linux.ts +0 -606
- package/cli/linux/model-monitor.ts +0 -838
- package/cli/linux/remote-mgmt-service.ts +0 -461
- package/cli/linux/runner-downloader.ts +0 -212
- package/cli/linux/runner.ts +0 -992
- package/cli/linux/webserver/middleware/asyncMiddleware.ts +0 -7
- package/cli/linux/webserver/public/assets/argon-dashboard.css +0 -20595
- package/cli/linux/webserver/public/assets/favicon-color/favicon-120.png +0 -0
- package/cli/linux/webserver/public/assets/favicon-color/favicon-128.png +0 -0
- package/cli/linux/webserver/public/assets/favicon-color/favicon-144.png +0 -0
- package/cli/linux/webserver/public/assets/favicon-color/favicon-152.png +0 -0
- package/cli/linux/webserver/public/assets/favicon-color/favicon-16.png +0 -0
- package/cli/linux/webserver/public/assets/favicon-color/favicon-180.png +0 -0
- package/cli/linux/webserver/public/assets/favicon-color/favicon-228.png +0 -0
- package/cli/linux/webserver/public/assets/favicon-color/favicon-32.png +0 -0
- package/cli/linux/webserver/public/assets/favicon-color/favicon-57.png +0 -0
- package/cli/linux/webserver/public/assets/favicon-color/favicon-76.png +0 -0
- package/cli/linux/webserver/public/assets/favicon-color/favicon-96.png +0 -0
- package/cli/linux/webserver/public/assets/logo-rgb.svg +0 -18
- package/cli/linux/webserver/public/assets/mark.svg +0 -20
- package/cli/linux/webserver/public/assets/mobileclient.css +0 -4179
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-300.eot +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-300.svg +0 -332
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-300.ttf +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-300.woff +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-300.woff2 +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-300italic.eot +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-300italic.svg +0 -345
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-300italic.ttf +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-300italic.woff +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-300italic.woff2 +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-600.eot +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-600.svg +0 -336
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-600.ttf +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-600.woff +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-600.woff2 +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-600italic.eot +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-600italic.svg +0 -349
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-600italic.ttf +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-600italic.woff +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-600italic.woff2 +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-700.eot +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-700.svg +0 -334
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-700.ttf +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-700.woff +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-700.woff2 +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-700italic.eot +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-700italic.svg +0 -342
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-700italic.ttf +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-700italic.woff +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-700italic.woff2 +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-800.eot +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-800.svg +0 -336
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-800.ttf +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-800.woff +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-800.woff2 +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-800italic.eot +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-800italic.svg +0 -342
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-800italic.ttf +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-800italic.woff +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-800italic.woff2 +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-italic.eot +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-italic.svg +0 -349
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-italic.ttf +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-italic.woff +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-italic.woff2 +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-regular.eot +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-regular.svg +0 -336
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-regular.ttf +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-regular.woff +0 -0
- package/cli/linux/webserver/public/fonts/open-sans-v17-latin-regular.woff2 +0 -0
- package/cli/linux/webserver/public/index.html +0 -114
- package/cli/linux/webserver/public/inference-server.js +0 -216
- package/cli/linux/webserver/public/webserver.js +0 -247
- package/cli/linux/webserver/views/escape-html-template-tag/escape.ts +0 -66
- package/cli/linux/webserver/views/escape-html-template-tag/index.ts +0 -2
- package/cli/linux/webserver/views/inference-server-view.ts +0 -179
|
@@ -1,838 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import Path from 'path';
|
|
3
|
-
import util from 'util';
|
|
4
|
-
import { Config } from '../config';
|
|
5
|
-
import { RunnerClassifyResponseSuccess } from "../../library/classifier/linux-impulse-runner";
|
|
6
|
-
import { ModelInformation } from '../../library/classifier/linux-impulse-runner';
|
|
7
|
-
import { EventEmitter } from 'tsee';
|
|
8
|
-
import { MgmtInterfaceImpulseRecordRawData } from '../../shared/MgmtInterfaceTypes';
|
|
9
|
-
|
|
10
|
-
const MONITOR_PREFIX = '\x1b[34m[MON]\x1b[0m';
|
|
11
|
-
|
|
12
|
-
function checkFileExists(file: string) {
|
|
13
|
-
return new Promise(resolve => {
|
|
14
|
-
return fs.promises.access(file, fs.constants.F_OK)
|
|
15
|
-
.then(() => resolve(true))
|
|
16
|
-
.catch(() => resolve(false));
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
async function asyncPool<IN, OUT>(poolLimit: number, array: ReadonlyArray<IN>,
|
|
21
|
-
iteratorFn: (generator: IN) => Promise <OUT>): Promise<OUT[]> {
|
|
22
|
-
const ret = [];
|
|
23
|
-
const executing: Promise<OUT>[] = [];
|
|
24
|
-
for (const item of array) {
|
|
25
|
-
const p = Promise.resolve().then(() => iteratorFn(item));
|
|
26
|
-
ret.push(p);
|
|
27
|
-
|
|
28
|
-
if (poolLimit <= array.length) {
|
|
29
|
-
const e = <Promise<OUT>>p.then(() => executing.splice(executing.indexOf(e), 1));
|
|
30
|
-
executing.push(e);
|
|
31
|
-
if (executing.length >= poolLimit) {
|
|
32
|
-
await Promise.race(executing);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return Promise.all(ret);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export type ImpulseRecord = {
|
|
40
|
-
impulseRecord: RunnerClassifyResponseSuccess;
|
|
41
|
-
timestamp: number;
|
|
42
|
-
index: number;
|
|
43
|
-
rawData: MgmtInterfaceImpulseRecordRawData;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export type ImpulseRecordError = {
|
|
47
|
-
index: number;
|
|
48
|
-
error: string;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export type StorageStatus = {
|
|
52
|
-
firstIndex: number;
|
|
53
|
-
firstTimestamp: number;
|
|
54
|
-
lastIndex: number;
|
|
55
|
-
lastTimestamp: number;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export type InferenceMetrics = {
|
|
59
|
-
firstIndex: number;
|
|
60
|
-
lastIndex: number;
|
|
61
|
-
classificationCounter: {
|
|
62
|
-
label: string;
|
|
63
|
-
value: number
|
|
64
|
-
}[];
|
|
65
|
-
mean: {
|
|
66
|
-
label: string;
|
|
67
|
-
value: number
|
|
68
|
-
}[];
|
|
69
|
-
standardDeviation: {
|
|
70
|
-
label: string;
|
|
71
|
-
value: number
|
|
72
|
-
}[];
|
|
73
|
-
metrics: {
|
|
74
|
-
name: string;
|
|
75
|
-
value: number
|
|
76
|
-
}[];
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
class StorageManager {
|
|
80
|
-
private _storagePath: string = '';
|
|
81
|
-
private _metricsPath: string = '';
|
|
82
|
-
private _config: Config;
|
|
83
|
-
private _model: ModelInformation;
|
|
84
|
-
private _storageIndex: number = 0;
|
|
85
|
-
private _firstIndex: number = Number.MAX_SAFE_INTEGER;
|
|
86
|
-
// this limits the number of records in a single directory
|
|
87
|
-
private _storageIndexSegment: number = 1000;
|
|
88
|
-
// hardcoded to 250 MB for now
|
|
89
|
-
private _storageSizeMaxBytes: number = 250 * 1024 * 1024;
|
|
90
|
-
private _storageSize: number = 0;
|
|
91
|
-
// when the monitor stores the record, storage manager checks if the storage size
|
|
92
|
-
// is above the limit, if it is, it will remove the oldest segment
|
|
93
|
-
// beacues of that feature, it is important to configure segement size and storage limit
|
|
94
|
-
// on a propers level (depending on ther record size and the number of records per second)
|
|
95
|
-
// so there will be more than one segment in the storage
|
|
96
|
-
|
|
97
|
-
static async getStorageManager(conf: Config, model: ModelInformation) {
|
|
98
|
-
let storageManager = new StorageManager(conf, model);
|
|
99
|
-
await storageManager.initialize();
|
|
100
|
-
return storageManager;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
private constructor(conf: Config, model: ModelInformation) {
|
|
104
|
-
this._config = conf;
|
|
105
|
-
this._model = model;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
private async getHighestAndLowestIndexes(path: string): Promise<{ highest: number, lowest: number }> {
|
|
109
|
-
let highest = 0;
|
|
110
|
-
let lowest = Number.MAX_SAFE_INTEGER;
|
|
111
|
-
|
|
112
|
-
// get a list of all json files in the storage directory
|
|
113
|
-
let files = await fs.promises.readdir(path);
|
|
114
|
-
|
|
115
|
-
// filter out non-json files
|
|
116
|
-
files = files.filter(file => file.endsWith('.json'));
|
|
117
|
-
|
|
118
|
-
// filter out files that don't have a number as the name
|
|
119
|
-
files = files.filter(file => !isNaN(Number(Path.basename(file, '.json'))));
|
|
120
|
-
|
|
121
|
-
// find the highest and lowest indexes
|
|
122
|
-
for (const file of files) {
|
|
123
|
-
const index = Number(Path.basename(file, '.json'));
|
|
124
|
-
if (index > highest) {
|
|
125
|
-
highest = index;
|
|
126
|
-
}
|
|
127
|
-
if (index < lowest) {
|
|
128
|
-
lowest = index;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
if (lowest === Number.MAX_SAFE_INTEGER) {
|
|
132
|
-
lowest = 0;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
return { highest, lowest };
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
private async getPathByIndex(index: number): Promise<string> {
|
|
139
|
-
const segment = Math.floor(index / this._storageIndexSegment);
|
|
140
|
-
const path = Path.join(this._storagePath, segment.toString());
|
|
141
|
-
|
|
142
|
-
if (await checkFileExists(path) === false) {
|
|
143
|
-
await fs.promises.mkdir(path, { recursive: true });
|
|
144
|
-
}
|
|
145
|
-
return path;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
private async getStorageSize(path: string = this._storagePath): Promise<number> {
|
|
149
|
-
|
|
150
|
-
const dirSize = async (dir: string) => {
|
|
151
|
-
const files = await fs.promises.readdir(dir, { withFileTypes: true });
|
|
152
|
-
// create a list of promises that will return the size of each file
|
|
153
|
-
const sizesPromiseArr: Promise<number>[] = files.map( async file => {
|
|
154
|
-
const filePath = Path.join( dir, file.name );
|
|
155
|
-
// if the file is a directory, then call the dirSize function recursively
|
|
156
|
-
if (file.isDirectory()) return await dirSize(filePath);
|
|
157
|
-
if (file.isFile()) return (await fs.promises.stat(filePath)).size;
|
|
158
|
-
// for any other types return 0 bytes size
|
|
159
|
-
return 0;
|
|
160
|
-
});
|
|
161
|
-
// wait for all promises to resolve
|
|
162
|
-
const sizesArr = (await asyncPool(10, sizesPromiseArr, async (fileSize) => {
|
|
163
|
-
return await fileSize;
|
|
164
|
-
})).flat();
|
|
165
|
-
|
|
166
|
-
return sizesArr.reduce((acc, size) => acc + size, 0);
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
return await dirSize(path);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
private async initialize(): Promise<void> {
|
|
173
|
-
this._storagePath = await this._config.getStoragePath();
|
|
174
|
-
|
|
175
|
-
let modelProjectId = this._model.project.id;
|
|
176
|
-
|
|
177
|
-
// check if the last directory in the path is equal to modelProjectId
|
|
178
|
-
if (Path.basename(this._storagePath) !== modelProjectId.toString()) {
|
|
179
|
-
// if not, append modelProjectId to the default storage path
|
|
180
|
-
this._storagePath = Path.join(this._config.getDefaultStoragePath(), modelProjectId.toString());
|
|
181
|
-
// update the storage path in the config
|
|
182
|
-
await this._config.storeStoragePath(this._storagePath);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
// set the metrics path
|
|
186
|
-
this._metricsPath = Path.join(this._storagePath, 'metrics.json');
|
|
187
|
-
|
|
188
|
-
// get the current storage index (the next index to be used for saving records)
|
|
189
|
-
// storage index may be updated during the initialization if there is a record with higer index
|
|
190
|
-
// we can't overwrite existing records, so we need to start from the next index
|
|
191
|
-
this._storageIndex = await this._config.getStorageIndex();
|
|
192
|
-
|
|
193
|
-
// check if storage directory exists
|
|
194
|
-
if (await checkFileExists(this._storagePath) === false) {
|
|
195
|
-
await fs.promises.mkdir(this._storagePath, { recursive: true });
|
|
196
|
-
}
|
|
197
|
-
else {
|
|
198
|
-
// if storage exist, then try to restore first and last index
|
|
199
|
-
// get list of all directories (segments) in the storage directory
|
|
200
|
-
let dirs = await fs.promises.readdir(this._storagePath, { withFileTypes: true });
|
|
201
|
-
// filter out non-directories
|
|
202
|
-
dirs = dirs.filter(dirent => dirent.isDirectory());
|
|
203
|
-
// filter out directories that don't have a number as the name
|
|
204
|
-
dirs = dirs.filter(dirent => !isNaN(Number(dirent.name)));
|
|
205
|
-
let lowest = 0;
|
|
206
|
-
let highest = 0;
|
|
207
|
-
if (dirs.length === 0) {
|
|
208
|
-
// if there are no directories, then we need to find the highest and lowest indexes
|
|
209
|
-
({ highest, lowest } = await this.getHighestAndLowestIndexes(this._storagePath));
|
|
210
|
-
}
|
|
211
|
-
else {
|
|
212
|
-
let highestSegment = 0;
|
|
213
|
-
let lowestSegment = Number.MAX_SAFE_INTEGER;
|
|
214
|
-
// find the highest and lowest segments
|
|
215
|
-
for (const dirent of dirs) {
|
|
216
|
-
const index = Number(dirent.name);
|
|
217
|
-
if (index > highestSegment) {
|
|
218
|
-
highestSegment = index;
|
|
219
|
-
}
|
|
220
|
-
if (index < lowestSegment) {
|
|
221
|
-
lowestSegment = index;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
({ highest } = await this.getHighestAndLowestIndexes(
|
|
225
|
-
Path.join(this._storagePath, highestSegment.toString())
|
|
226
|
-
));
|
|
227
|
-
({ lowest } = await this.getHighestAndLowestIndexes(
|
|
228
|
-
Path.join(this._storagePath, lowestSegment.toString())
|
|
229
|
-
));
|
|
230
|
-
}
|
|
231
|
-
this._firstIndex = lowest;
|
|
232
|
-
this._storageIndex = highest + 1;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
this._storageSize = await this.getStorageSize();
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
private async cleanupStorage(): Promise<void> {
|
|
239
|
-
// get list of segment directories
|
|
240
|
-
let dirs = await fs.promises.readdir(this._storagePath, { withFileTypes: true });
|
|
241
|
-
// filter out non-directories
|
|
242
|
-
dirs = dirs.filter(dirent => dirent.isDirectory());
|
|
243
|
-
// filter out directories that don't have a number as the name
|
|
244
|
-
dirs = dirs.filter(dirent => !isNaN(Number(dirent.name)));
|
|
245
|
-
if (dirs.length < 2) {
|
|
246
|
-
return;
|
|
247
|
-
}
|
|
248
|
-
// sort the directories in ascending order
|
|
249
|
-
dirs.sort((a, b) => a.name.localeCompare(b.name));
|
|
250
|
-
// get the lowest segment number
|
|
251
|
-
let lowestSegmentPath = Path.join(this._storagePath, dirs[0].name);
|
|
252
|
-
|
|
253
|
-
// get the size of the lowest segment
|
|
254
|
-
let lowestSegmentSize = await this.getStorageSize(lowestSegmentPath);
|
|
255
|
-
|
|
256
|
-
// get number of records in the lowest segment
|
|
257
|
-
let { highest, lowest } = await this.getHighestAndLowestIndexes(lowestSegmentPath);
|
|
258
|
-
|
|
259
|
-
// remove the lowest segment
|
|
260
|
-
await fs.promises.rm(lowestSegmentPath, { recursive: true });
|
|
261
|
-
// update the first index
|
|
262
|
-
this._firstIndex = highest + 1;
|
|
263
|
-
// update the storage size
|
|
264
|
-
this._storageSize -= lowestSegmentSize;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
async getStorageStatus(): Promise<StorageStatus> {
|
|
268
|
-
let temp = await this.getRecord(this._firstIndex);
|
|
269
|
-
const firstTimestamp = temp ? temp.timestamp : 0;
|
|
270
|
-
temp = await this.getRecord(this._storageIndex - 1);
|
|
271
|
-
const lastTimestamp = temp ? temp.timestamp : 0;
|
|
272
|
-
|
|
273
|
-
return {
|
|
274
|
-
firstIndex: this._firstIndex,
|
|
275
|
-
firstTimestamp: firstTimestamp,
|
|
276
|
-
lastIndex: this._storageIndex - 1,
|
|
277
|
-
lastTimestamp: lastTimestamp
|
|
278
|
-
};
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
async saveInferenceMetrics(metrics: string): Promise<void> {
|
|
282
|
-
await fs.promises.writeFile(this._metricsPath, metrics);
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
async getInferenceMetrics(): Promise<string | undefined> {
|
|
286
|
-
if (await checkFileExists(this._metricsPath) === true) {
|
|
287
|
-
return await fs.promises.readFile(this._metricsPath, 'utf-8');
|
|
288
|
-
}
|
|
289
|
-
return undefined;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
// we pass raw data separately, so the storage manager can decide how to store it
|
|
293
|
-
// JPEGs are stored in the files on disk, while WAVs are stored in the JSONs (so far)
|
|
294
|
-
async saveRecord(record: ImpulseRecord): Promise<void> {
|
|
295
|
-
let recordSize: number = 0;
|
|
296
|
-
let rawDataSize: number = 0;
|
|
297
|
-
|
|
298
|
-
record.index = this._storageIndex++;
|
|
299
|
-
await this._config.storeStorageIndex(this._storageIndex);
|
|
300
|
-
|
|
301
|
-
const recordPath = Path.join(await this.getPathByIndex(record.index), record.index.toString() + '.json');
|
|
302
|
-
|
|
303
|
-
if (record.rawData.type === 'jpg') {
|
|
304
|
-
const imgPath = Path.join(await this.getPathByIndex(record.index), record.index.toString() + '.jpg');
|
|
305
|
-
const buf = Buffer.from(record.rawData.bufferBase64, 'base64');
|
|
306
|
-
await fs.promises.writeFile(imgPath, buf);
|
|
307
|
-
rawDataSize = buf.length;
|
|
308
|
-
record.rawData.bufferBase64 = imgPath;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
const recordStr = JSON.stringify(record, null, 4);
|
|
312
|
-
await fs.promises.writeFile(recordPath, recordStr, 'utf-8');
|
|
313
|
-
recordSize = recordStr.length;
|
|
314
|
-
|
|
315
|
-
this._storageSize += (recordSize + rawDataSize);
|
|
316
|
-
|
|
317
|
-
if (this._storageSize > this._storageSizeMaxBytes) {
|
|
318
|
-
console.log(MONITOR_PREFIX, 'Storage size exceeded the limit, cleaning up the storage');
|
|
319
|
-
await this.cleanupStorage();
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
async getRecord(index: number): Promise<ImpulseRecord | undefined> {
|
|
324
|
-
const recordPath = Path.join(await this.getPathByIndex(index), index.toString() + '.json');
|
|
325
|
-
|
|
326
|
-
if (await checkFileExists(recordPath) === false) {
|
|
327
|
-
return undefined;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
let record = <ImpulseRecord>JSON.parse(await fs.promises.readFile(recordPath, 'utf-8'));
|
|
331
|
-
if (record.rawData.type === 'jpg') {
|
|
332
|
-
let fileBuf: Buffer;
|
|
333
|
-
if (await checkFileExists(record.rawData.bufferBase64) === false) {
|
|
334
|
-
// looks like this record has the raw data embedded
|
|
335
|
-
// try to decode the base64 and return it as a buffer
|
|
336
|
-
try {
|
|
337
|
-
fileBuf = Buffer.from(record.rawData.bufferBase64, 'base64');
|
|
338
|
-
}
|
|
339
|
-
catch (ex) {
|
|
340
|
-
throw new Error(`Record ${index} doesn't have the raw data file and the base64 is invalid`);
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
fileBuf = <Buffer>await fs.promises.readFile(record.rawData.bufferBase64);
|
|
344
|
-
record.rawData.bufferBase64 = fileBuf.toString('base64');
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
return record;
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
interface MetricCalculator {
|
|
352
|
-
name: string;
|
|
353
|
-
serialize(): string;
|
|
354
|
-
deserialize(data: string): void;
|
|
355
|
-
update(classification: { [label: string]: number } | undefined): void;
|
|
356
|
-
getMetric(): { label: string; value: number }[];
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
type MeanValues = {
|
|
360
|
-
[label: string]: {
|
|
361
|
-
count: number;
|
|
362
|
-
sum: number;
|
|
363
|
-
};
|
|
364
|
-
};
|
|
365
|
-
|
|
366
|
-
class MeanCalculator implements MetricCalculator {
|
|
367
|
-
private _mean: MeanValues;
|
|
368
|
-
private _name: string = 'mean';
|
|
369
|
-
|
|
370
|
-
constructor() {
|
|
371
|
-
this._mean = { };
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
get name(): string {
|
|
375
|
-
return this._name;
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
serialize(): string {
|
|
379
|
-
return JSON.stringify(this._mean);
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
deserialize(data: string): void {
|
|
383
|
-
try {
|
|
384
|
-
this._mean = <MeanValues>JSON.parse(data);
|
|
385
|
-
}
|
|
386
|
-
catch (ex) {
|
|
387
|
-
this._mean = { };
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
update(classification: { [label: string]: number } | undefined): void {
|
|
392
|
-
if (classification === undefined) {
|
|
393
|
-
return;
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
for (const label in classification) {
|
|
397
|
-
if (!classification.hasOwnProperty(label)) {
|
|
398
|
-
continue;
|
|
399
|
-
}
|
|
400
|
-
try {
|
|
401
|
-
this._mean[label].count += 1;
|
|
402
|
-
this._mean[label].sum += Number(classification[label]);
|
|
403
|
-
}
|
|
404
|
-
catch (ex) {
|
|
405
|
-
this._mean[label] = { count: 1, sum: Number(classification[label]) };
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
getMeanByLabel(label: string): number {
|
|
411
|
-
if (this._mean[label] === undefined) {
|
|
412
|
-
return 0;
|
|
413
|
-
}
|
|
414
|
-
return this._mean[label].sum / this._mean[label].count;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
getMetric(): { label: string; value: number }[] {
|
|
418
|
-
let ret: { label: string; value: number }[] = [];
|
|
419
|
-
|
|
420
|
-
for (const label in this._mean) {
|
|
421
|
-
if (!this._mean.hasOwnProperty(label)) {
|
|
422
|
-
continue;
|
|
423
|
-
}
|
|
424
|
-
ret.push({ label: label, value: this._mean[label].sum / this._mean[label].count });
|
|
425
|
-
}
|
|
426
|
-
return ret;
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
type StdDevValues = {
|
|
431
|
-
[label: string]: {
|
|
432
|
-
count: number;
|
|
433
|
-
m2: number;
|
|
434
|
-
mean: number;
|
|
435
|
-
};
|
|
436
|
-
};
|
|
437
|
-
|
|
438
|
-
class StdDevCalculator implements MetricCalculator {
|
|
439
|
-
private _stdDev: StdDevValues;
|
|
440
|
-
private _name: string = 'standardDeviation';
|
|
441
|
-
|
|
442
|
-
constructor() {
|
|
443
|
-
this._stdDev = { };
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
get name(): string {
|
|
447
|
-
return this._name;
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
serialize(): string {
|
|
451
|
-
return JSON.stringify(this._stdDev);
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
deserialize(data: string): void {
|
|
455
|
-
try {
|
|
456
|
-
this._stdDev = <StdDevValues>JSON.parse(data);
|
|
457
|
-
}
|
|
458
|
-
catch (ex) {
|
|
459
|
-
this._stdDev = { };
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
// based on Welford's online algorithm
|
|
464
|
-
// https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Welford's_online_algorithm
|
|
465
|
-
update(classification: { [label: string]: number } | undefined ): void {
|
|
466
|
-
if (classification === undefined) {
|
|
467
|
-
return;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
for (const label in classification) {
|
|
471
|
-
if (!classification.hasOwnProperty(label)) {
|
|
472
|
-
continue;
|
|
473
|
-
}
|
|
474
|
-
try {
|
|
475
|
-
const x = classification[label];
|
|
476
|
-
this._stdDev[label].count += 1;
|
|
477
|
-
|
|
478
|
-
const delta = x - this._stdDev[label].mean;
|
|
479
|
-
this._stdDev[label].mean += delta / this._stdDev[label].count;
|
|
480
|
-
const delta2 = x - this._stdDev[label].mean;
|
|
481
|
-
this._stdDev[label].m2 += delta * delta2;
|
|
482
|
-
}
|
|
483
|
-
catch (ex) {
|
|
484
|
-
this._stdDev[label] = { count: 1, m2: 0, mean: 0 };
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
getStdDevByLabel(label: string): number {
|
|
490
|
-
if (this._stdDev[label] === undefined) {
|
|
491
|
-
return 0;
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
return Math.sqrt(this._stdDev[label].m2 / (this._stdDev[label].count));
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
getMetric(): { label: string; value: number }[] {
|
|
498
|
-
let ret: { label: string; value: number }[] = [];
|
|
499
|
-
|
|
500
|
-
for (const label in this._stdDev) {
|
|
501
|
-
if (!this._stdDev.hasOwnProperty(label)) {
|
|
502
|
-
continue;
|
|
503
|
-
}
|
|
504
|
-
let val = Math.sqrt(this._stdDev[label].m2 / (this._stdDev[label].count));
|
|
505
|
-
ret.push({ label: label, value: val });
|
|
506
|
-
}
|
|
507
|
-
return ret;
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
type InferenceMetricsCache = {
|
|
512
|
-
metrics: InferenceMetrics;
|
|
513
|
-
meanCalculator: string;
|
|
514
|
-
stdDevCalculator: string;
|
|
515
|
-
};
|
|
516
|
-
|
|
517
|
-
class MetricsCalculator {
|
|
518
|
-
private _storageManager: StorageManager;
|
|
519
|
-
private _meanCalculator: MeanCalculator;
|
|
520
|
-
private _stdDevCalculator: StdDevCalculator;
|
|
521
|
-
private _metrics: InferenceMetrics;
|
|
522
|
-
private _model: ModelInformation;
|
|
523
|
-
private _confidenceThreshold: number;
|
|
524
|
-
// parameters and variables used to determine summary period
|
|
525
|
-
private _inferenceSummaryPeriod: number = 10;
|
|
526
|
-
private _inferenceSummaryCounter: number = 0;
|
|
527
|
-
|
|
528
|
-
// because we need to initialize the class with async method, the constructor is private
|
|
529
|
-
// and any new object should be created using getMetricsInstance
|
|
530
|
-
static async getMetricsInstance(storage: StorageManager, model: ModelInformation): Promise<MetricsCalculator> {
|
|
531
|
-
let metrics = new MetricsCalculator(storage, model);
|
|
532
|
-
await metrics.restoreMetrics(model);
|
|
533
|
-
|
|
534
|
-
return metrics;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
// private constructor to prevent direct object creation, use getMetricsInstance instead
|
|
538
|
-
private constructor(storage: StorageManager, model: ModelInformation) {
|
|
539
|
-
this._meanCalculator = new MeanCalculator();
|
|
540
|
-
this._stdDevCalculator = new StdDevCalculator();
|
|
541
|
-
this._storageManager = storage;
|
|
542
|
-
this._model = model;
|
|
543
|
-
|
|
544
|
-
if (model.modelParameters.threshold === undefined) {
|
|
545
|
-
console.warn(MONITOR_PREFIX, 'Model threshold is not defined, using default value of 0.5');
|
|
546
|
-
this._confidenceThreshold = 0.5;
|
|
547
|
-
}
|
|
548
|
-
else {
|
|
549
|
-
this._confidenceThreshold = model.modelParameters.threshold ?? 0.5;
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
// init as empty, will be overwritten by restoreMetrics
|
|
553
|
-
this._metrics = {
|
|
554
|
-
firstIndex: 0,
|
|
555
|
-
lastIndex: 0,
|
|
556
|
-
classificationCounter: [],
|
|
557
|
-
mean: [],
|
|
558
|
-
standardDeviation: [],
|
|
559
|
-
metrics: []
|
|
560
|
-
};
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
// restore saved metrics from the storage
|
|
564
|
-
private async restoreMetrics(model: ModelInformation): Promise<void> {
|
|
565
|
-
// load serialized metrics from the storage
|
|
566
|
-
const cache = await this._storageManager.getInferenceMetrics();
|
|
567
|
-
if (cache) {
|
|
568
|
-
// if cache exists, then try to deserialize it
|
|
569
|
-
const data = <InferenceMetricsCache>JSON.parse(cache);
|
|
570
|
-
this._meanCalculator.deserialize(data.meanCalculator);
|
|
571
|
-
this._stdDevCalculator.deserialize(data.stdDevCalculator);
|
|
572
|
-
this._metrics = data.metrics;
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
async updateMetrics(record: ImpulseRecord): Promise<boolean> {
|
|
577
|
-
// check if property classification exists in record.impulseRecord.result
|
|
578
|
-
if (record.impulseRecord.result.classification !== undefined) {
|
|
579
|
-
// iterate over properites in impulseRecord.result.classification
|
|
580
|
-
for (const key in record.impulseRecord.result.classification) {
|
|
581
|
-
if (!record.impulseRecord.result.classification.hasOwnProperty(key)) {
|
|
582
|
-
continue;
|
|
583
|
-
}
|
|
584
|
-
// check if value is above threshold
|
|
585
|
-
if (Number(record.impulseRecord.result.classification[key]) > this._confidenceThreshold) {
|
|
586
|
-
// find key index in classificationCounter
|
|
587
|
-
let index = this._metrics.classificationCounter
|
|
588
|
-
.findIndex((element) => element.label === key);
|
|
589
|
-
if (index < 0) {
|
|
590
|
-
this._metrics.classificationCounter.push({ label: key, value: 1 });
|
|
591
|
-
}
|
|
592
|
-
else {
|
|
593
|
-
this._metrics.classificationCounter[index].value++;
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
else if (record.impulseRecord.result.bounding_boxes !== undefined) {
|
|
599
|
-
// iterate over list of bounding boxes
|
|
600
|
-
for (const box of record.impulseRecord.result.bounding_boxes) {
|
|
601
|
-
// check if value is above threshold
|
|
602
|
-
if (box.value > this._confidenceThreshold) {
|
|
603
|
-
// find key index in classificationCounter
|
|
604
|
-
let index = this._metrics.classificationCounter
|
|
605
|
-
.findIndex((element) => element.label === box.label);
|
|
606
|
-
if (index < 0) {
|
|
607
|
-
this._metrics.classificationCounter.push({ label: box.label, value: 1 });
|
|
608
|
-
}
|
|
609
|
-
else {
|
|
610
|
-
this._metrics.classificationCounter[index].value++;
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
// update mean partial values
|
|
617
|
-
this._meanCalculator.update(record.impulseRecord.result.classification);
|
|
618
|
-
this._stdDevCalculator.update(record.impulseRecord.result.classification);
|
|
619
|
-
|
|
620
|
-
// update the last index
|
|
621
|
-
this._metrics.lastIndex = record.index;
|
|
622
|
-
|
|
623
|
-
// store metrics with storage manager
|
|
624
|
-
await this.saveMetrics();
|
|
625
|
-
|
|
626
|
-
// send inference summary if needed
|
|
627
|
-
this._inferenceSummaryCounter++;
|
|
628
|
-
if (this._inferenceSummaryCounter === this._inferenceSummaryPeriod) {
|
|
629
|
-
this._inferenceSummaryCounter = 0;
|
|
630
|
-
return true;
|
|
631
|
-
}
|
|
632
|
-
return false;
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
getMetrics(): InferenceMetrics {
|
|
636
|
-
// get actual mean values
|
|
637
|
-
this._metrics.mean = this._meanCalculator.getMetric();
|
|
638
|
-
this._metrics.standardDeviation = this._stdDevCalculator.getMetric();
|
|
639
|
-
return this._metrics;
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
async saveMetrics(): Promise<void> {
|
|
643
|
-
const cache: InferenceMetricsCache = {
|
|
644
|
-
metrics: this.getMetrics(),
|
|
645
|
-
meanCalculator: this._meanCalculator.serialize(),
|
|
646
|
-
stdDevCalculator: this._stdDevCalculator.serialize()
|
|
647
|
-
};
|
|
648
|
-
|
|
649
|
-
await this._storageManager.saveInferenceMetrics(JSON.stringify(cache, null, 2));
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
/**
|
|
654
|
-
* Represents a model monitor that emits events related to impulse records and inference summaries.
|
|
655
|
-
*/
|
|
656
|
-
export class ModelMonitor extends EventEmitter<{
|
|
657
|
-
'impulse-record': (ev: ImpulseRecord) => void,
|
|
658
|
-
'impulse-records-response': (ev: ImpulseRecord | ImpulseRecordError) => void,
|
|
659
|
-
'inference-summary': (ev: InferenceMetrics) => void,
|
|
660
|
-
}> {
|
|
661
|
-
private _storageManager: StorageManager | undefined;
|
|
662
|
-
private _metricsCalculator: MetricsCalculator | undefined;
|
|
663
|
-
private _streamState: 'idle' | 'debug' | 'records-request' = 'idle';
|
|
664
|
-
private _streamPrevState: 'idle' | 'debug' | 'records-request' = 'idle';
|
|
665
|
-
|
|
666
|
-
private constructor(_config: Config) {
|
|
667
|
-
super();
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
/**
|
|
671
|
-
* Creates a new instance of ModelMonitor with the provided configuration and model information.
|
|
672
|
-
* @param config The configuration object.
|
|
673
|
-
* @param model The model information object.
|
|
674
|
-
* @returns A promise that resolves to a ModelMonitor instance.
|
|
675
|
-
*/
|
|
676
|
-
static async getModelMonitor(config: Config, model: ModelInformation): Promise<ModelMonitor> {
|
|
677
|
-
let monitor = new ModelMonitor(config);
|
|
678
|
-
|
|
679
|
-
monitor._storageManager = await StorageManager.getStorageManager(config, model);
|
|
680
|
-
monitor._metricsCalculator = await MetricsCalculator.getMetricsInstance(monitor._storageManager, model);
|
|
681
|
-
|
|
682
|
-
return monitor;
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
get impulseDebug() {
|
|
686
|
-
return this._streamState === 'debug';
|
|
687
|
-
}
|
|
688
|
-
|
|
689
|
-
/**
|
|
690
|
-
* Enable the Model Debugging mode.
|
|
691
|
-
* When enabled, the model monitor will emit impulse records as they are processed.
|
|
692
|
-
* When disabled, the model monitor will not emit impulse records.
|
|
693
|
-
* In the 'records-request' state, setting impulseDebug to true will abort the records-request state.
|
|
694
|
-
* In the 'records-request' state, setting impulseDebug to false has no effect.
|
|
695
|
-
*/
|
|
696
|
-
set impulseDebug(enabled: boolean) {
|
|
697
|
-
if (this._streamState === 'records-request' && enabled === true) {
|
|
698
|
-
// TODO: send abort/error message
|
|
699
|
-
console.log(MONITOR_PREFIX, 'Stream was in records-request state, but impulseDebug was set to ' + enabled);
|
|
700
|
-
console.log(MONITOR_PREFIX, 'Aborting the records-request state');
|
|
701
|
-
}
|
|
702
|
-
if (enabled) {
|
|
703
|
-
this._streamState = 'debug';
|
|
704
|
-
this._streamPrevState = 'idle';
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
async getStorageStatus(): Promise<StorageStatus> {
|
|
709
|
-
if (this._storageManager) {
|
|
710
|
-
return await this._storageManager.getStorageStatus();
|
|
711
|
-
}
|
|
712
|
-
return {
|
|
713
|
-
firstIndex: 0,
|
|
714
|
-
firstTimestamp: 0,
|
|
715
|
-
lastIndex: 0,
|
|
716
|
-
lastTimestamp: 0
|
|
717
|
-
};
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
abortImpulseRecordsRequest() {
|
|
721
|
-
this._streamState = this._streamPrevState;
|
|
722
|
-
this._streamPrevState = 'idle';
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
/**
|
|
726
|
-
* Retrieves impulse records based on the provided request.
|
|
727
|
-
* @param impulseRequest The request object specifying the index, range, or list of indices to retrieve.
|
|
728
|
-
* One of the following properties must be provided:
|
|
729
|
-
* - index: The index of the single impulse record to retrieve.
|
|
730
|
-
* - range: An object with first and last properties specifying the range of impulse records to retrieve.
|
|
731
|
-
* - list: An array of indices of impulse records to retrieve (in any order)
|
|
732
|
-
* @throws Error if the request is invalid or the first index is greater than the last index.
|
|
733
|
-
*/
|
|
734
|
-
getImpulseRecords(impulseRequest: {
|
|
735
|
-
index?: number,
|
|
736
|
-
range?: { first: number, last: number },
|
|
737
|
-
list?: number[]
|
|
738
|
-
}): void {
|
|
739
|
-
if (this._streamState === 'debug') {
|
|
740
|
-
console.log(MONITOR_PREFIX, 'Stream is in debug mode, pausing the debug stream');
|
|
741
|
-
}
|
|
742
|
-
this._streamPrevState = this._streamState;
|
|
743
|
-
this._streamState = 'records-request';
|
|
744
|
-
|
|
745
|
-
if (impulseRequest.index) {
|
|
746
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
747
|
-
this._storageManager?.getRecord(impulseRequest.index)
|
|
748
|
-
.then(record => {
|
|
749
|
-
if (record) {
|
|
750
|
-
this.emit('impulse-records-response', record);
|
|
751
|
-
}
|
|
752
|
-
else {
|
|
753
|
-
// TODO: is this sanity check needed?
|
|
754
|
-
if (impulseRequest.index === undefined) {
|
|
755
|
-
throw new Error('Index is undefined');
|
|
756
|
-
}
|
|
757
|
-
this.emit('impulse-records-response', {
|
|
758
|
-
index: impulseRequest.index,
|
|
759
|
-
error: 'Record not found'
|
|
760
|
-
});
|
|
761
|
-
}
|
|
762
|
-
});
|
|
763
|
-
}
|
|
764
|
-
else if (impulseRequest.range) {
|
|
765
|
-
if (impulseRequest.range.first > impulseRequest.range.last) {
|
|
766
|
-
this.emit('impulse-records-response', { index: impulseRequest.range.first, error: 'First index higher than the last one' });
|
|
767
|
-
this.abortImpulseRecordsRequest();
|
|
768
|
-
return;
|
|
769
|
-
}
|
|
770
|
-
for (let i = impulseRequest.range.first; i <= impulseRequest.range.last; i++) {
|
|
771
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
772
|
-
this._storageManager?.getRecord(i)
|
|
773
|
-
.then(record => {
|
|
774
|
-
if (record) {
|
|
775
|
-
this.emit('impulse-records-response', record);
|
|
776
|
-
}
|
|
777
|
-
else {
|
|
778
|
-
this.emit('impulse-records-response', { index: i, error: 'Record not found' });
|
|
779
|
-
}
|
|
780
|
-
});
|
|
781
|
-
if (this._streamState !== 'records-request') {
|
|
782
|
-
console.log(MONITOR_PREFIX, 'Stream state changed, aborting the records-request');
|
|
783
|
-
break;
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
else if (impulseRequest.list) {
|
|
788
|
-
// sort the list of indices in ascending order
|
|
789
|
-
impulseRequest.list.sort((a, b) => a - b);
|
|
790
|
-
for (const index of impulseRequest.list) {
|
|
791
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
792
|
-
this._storageManager?.getRecord(index)
|
|
793
|
-
.then(record => {
|
|
794
|
-
if (record) {
|
|
795
|
-
this.emit('impulse-records-response', record);
|
|
796
|
-
}
|
|
797
|
-
else {
|
|
798
|
-
this.emit('impulse-records-response', { index: index, error: 'Record not found' });
|
|
799
|
-
}
|
|
800
|
-
});
|
|
801
|
-
if (this._streamState !== 'records-request') {
|
|
802
|
-
console.log(MONITOR_PREFIX, 'Stream state changed, aborting the records-request');
|
|
803
|
-
break;
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
|
-
else {
|
|
808
|
-
throw new Error('Invalid impulse request');
|
|
809
|
-
}
|
|
810
|
-
|
|
811
|
-
// restore the previous state
|
|
812
|
-
this._streamState = this._streamPrevState;
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
async processResult(result: RunnerClassifyResponseSuccess, rawData: {
|
|
816
|
-
type: 'wav' | 'jpg',
|
|
817
|
-
buffer: Buffer,
|
|
818
|
-
}): Promise<void> {
|
|
819
|
-
let record: ImpulseRecord = {
|
|
820
|
-
impulseRecord: result,
|
|
821
|
-
timestamp: Date.now(),
|
|
822
|
-
index: -1,
|
|
823
|
-
rawData: {
|
|
824
|
-
type: rawData.type,
|
|
825
|
-
bufferBase64: rawData.buffer.toString('base64'),
|
|
826
|
-
},
|
|
827
|
-
};
|
|
828
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
829
|
-
this._storageManager?.saveRecord(record);
|
|
830
|
-
if (this._metricsCalculator?.updateMetrics(record)) {
|
|
831
|
-
this.emit('inference-summary', this._metricsCalculator.getMetrics());
|
|
832
|
-
}
|
|
833
|
-
|
|
834
|
-
if (this.impulseDebug) {
|
|
835
|
-
this.emit('impulse-record', record);
|
|
836
|
-
}
|
|
837
|
-
}
|
|
838
|
-
}
|