-
Notifications
You must be signed in to change notification settings - Fork 42
Add the OpenVINO.js framework #1383
base: master
Are you sure you want to change the base?
Conversation
semantic_segmentation, speech_commands, and speech_recognition. It only works when the Electron Application with integrated node.js.
package.json
Outdated
"webpack-dev-server": "^3.1.10", | ||
"@webgpu/glslang": "0.0.12", | ||
"@webgpu/types": "0.0.24", | ||
"@tensorflow/tfjs-backend-webgpu": "0.0.1-alpha.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BruceDai Does it mean @lionkunonly has added WebGPU backend support successfully?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lionkunonly We've already added WebGPU backend support on Line#30, Line#32, Line#33, please remove these duplicated devDependencies, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lionkunonly I have left some coding style suggestions, please update them.
package.json
Outdated
"webpack-dev-server": "^3.1.10", | ||
"@webgpu/glslang": "0.0.12", | ||
"@webgpu/types": "0.0.24", | ||
"@tensorflow/tfjs-backend-webgpu": "0.0.1-alpha.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lionkunonly We've already added WebGPU backend support on Line#30, Line#32, Line#33, please remove these duplicated devDependencies, thanks.
@@ -20,6 +20,8 @@ class ImageClassificationExample extends BaseCameraExample { | |||
case 'OpenCV.js': | |||
runner = new ImageClassificationOpenCVRunner(); | |||
break; | |||
case 'OpenVINO.js': | |||
runner = new ImageClassificationOpenVINORunner(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lionkunonly Here missed a 'break'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -36,6 +39,8 @@ class ImageClassificationExample extends BaseCameraExample { | |||
case 'OpenCV.js': | |||
labelClasses = getTopClasses(output.tensor, output.labels, 3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lionkunonly The case 'OpenVINO.js' uses the same code as case 'OpenCV.js', you could code as
case 'OpenCV.js':
case 'OpenVINO.js':
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
runner = new WebNNRunner(); | ||
break; | ||
case 'OpenVINO.js': | ||
runner = new OpenVINORunner(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lionkunonly Here missed a 'break'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
runner = new SpeechRecognitionRunner(); | ||
break; | ||
case 'OpenVINO.js': | ||
runner = new SpeechRecognitionOpenVINORunner(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lionkunonly ditto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -28,6 +30,7 @@ class ImageClassificationExample extends BaseCameraExample { | |||
/** @override */ | |||
_processExtra = (output) => { | |||
let labelClasses; | |||
console.log(output); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lionkunonly Please remove this console.log
line, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@BruceDai @ibelem Here is the result of the comparison between the WebNN on the Chrome and OpenVINO.js on Electron Environment: Environment: Electron v11.01 Chrome: 86.0.4209.0 OpenVINO 2020.3.194 Windows 10 TGL i7-1165G7
|
examples/util/OpenVINORunner.js
Outdated
this._setBackend(null); | ||
}; | ||
|
||
// _configureBackend = ()=> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lionkunonly Please remove these commented lines, thanks.
The OpenVINO.js framework exists in the example for image classification, semantic_segmentation, speech_commands, and speech_recognition. It works when the Electron Application with integrated node.js.