Comments (9)
@huningxin Hi, Ningxin. In the native OpenVINO, the user can get and set the PreProcessChannel
by overloading []
operator.
It can be seen here https://github.com/openvinotoolkit/openvino/blob/ffe4a74169da049f39a8590199636de1bf6d9c42/inference-engine/include/ie_preprocess.hpp#L75 and https://github.com/openvinotoolkit/openvino/blob/ffe4a74169da049f39a8590199636de1bf6d9c42/inference-engine/include/ie_preprocess.hpp#L93
I think the overloaded function is hard to implement by using N-API, and it needs to return the class PreProcessChannel::Ptr&
. So, could I create two different function object getPreProcessChannel(int index)
and setPreProcessChannel(int index, object Channel)
to get PreProcessChannel and set PreProcessChannel respectively? Do you have any suggestions?
from inference-engine-node.
could I create two different function
object getPreProcessChannel(int index)
andsetPreProcessChannel(int index, object Channel)
to get PreProcessChannel and set PreProcessChannel respectively? Do you have any suggestions?
It sounds good. I think we can support the usage like
preprocessinfo.setPreProcessChannel(0, {stdScale: 127.5, meanValue: 127.5});
The API could be
dictionary PreProcessChannel {
optional float stdScale = 1;
optional float meanValue = 0;
optional ArrayBuffer meanData = null;
};
partial interface PreProcessInfo {
PreProcessChannel getPreProcessChannel(unsigned long channel);
void setPreProcessChannel(unsigned long channel, PreProcessChannel preProcessChannel);
};
from inference-engine-node.
@huningxin . In the test of API getPreProcessChannel()
, I find the size of _channelsInfo
in class PreProcessInfo
in file network.js
is 0. It means that I can not take the action _channelsInfo[index]
, because the channel vector is empty. So I can not test the API successfully.
Defination of _channelsInfo
in the class PreProcessInfo
: https://github.com/openvinotoolkit/openvino/blob/ffe4a74169da049f39a8590199636de1bf6d9c42/inference-engine/include/ie_preprocess.hpp#L57
Meanwhile, should I add a data structure for PreProcessChannel
in utils.h
and utils.cc
. Or just finish it as a object like version
in core.cc
and core.h
. I am on the second way now.
from inference-engine-node.
@huningxin . In the test of API
getPreProcessChannel()
, I find the size of_channelsInfo
in classPreProcessInfo
in filenetwork.js
is 0. It means that I can not take the action_channelsInfo[index]
, because the channel vector is empty. So I can not test the API successfully.
I think you should expose the PreProcessInfo.init
that allows the js code to initialize the _channelsInfo
.
Meanwhile, should I add a data structure for
PreProcessChannel
inutils.h
andutils.cc
. Or just finish it as a object likeversion
incore.cc
andcore.h
. I am on the second way now.
I am fine with the second way.
from inference-engine-node.
@huningxin . I meet a issue here in the implementation. I find that the Blob::Ptr meanData
in the initialized PreProcessInfo
can not be casted to MemoryBlob
. It blocks me to get the rmap()
and wmap()
from the MemoryBlob
so that the data in the meanData
can not be changed easily by using ArrayBuffer
data.
Do you know what causes the casting error? I am not sure about it, but I think it may cause by the defination of the meanData
. The code only declares this variable but no value is assigned to it. Do you have any suggestions?
from inference-engine-node.
@huningxin . I meet a issue here in the implementation. I find that the
Blob::Ptr meanData
in the initializedPreProcessInfo
can not be casted toMemoryBlob
. It blocks me to get thermap()
andwmap()
from theMemoryBlob
so that the data in themeanData
can not be changed easily by usingArrayBuffer
data.
Could you please show me the code? You can create a PR for your work in progress.
Did you check whether meanData
is a null ptr? if (meanData.get() == nullptr)
And in your first PR, probably you can skip the meanData
support, we can leave it to following PR.
from inference-engine-node.
Did you check whether
meanData
is a null ptr?if (meanData.get() == nullptr)
You are right, Ningxin. The meanData
is a null ptr. It is the reason that it can not cast to the MemoryBlob
.
from inference-engine-node.
@lionkunonly , during review the PR #30 , I am thinking about we need to allow js code to specify the tensor description of the meanData
. The change is to introduce the TensorDesc
and MeanData
to combine tensor description and data together.
dictionary TensorDesc {
required Precision precision;
required sequence<unsigned long long> dims,
required Layout layout;
};
dictionary MeanData {
required TensorDesc desc;
required ArrayBuffer data;
};
dictionary PreProcessChannel {
optional float stdScale = 1;
optional float meanValue = 0;
optional MeanData meanData = null;
};
from inference-engine-node.
With the PR Preprocesschannel with meanData
merged, this issue should be closed.
from inference-engine-node.
Related Issues (20)
- What is the license of hello_classification_electron/main.js HOT 2
- Use getAvailableDevices in Electron.js example HOT 1
- Add an Electron.js example for SSD object detection
- [Example] use preprocess to optimize hello_classification_node example HOT 14
- node.js crash when call InferRequest.getBlob with invalid argument HOT 1
- Compare gaps between Node.js API vs Python IE API HOT 8
- A test bug on Core.getVersions('GPU') HOT 4
- Update inference-engine-node in npmjs.com HOT 1
- Support loading extension HOT 29
- Inference Engine can not make full use of logic CPUs. HOT 1
- Fix tests, doc and electron example after removing createCore API
- Update inference-engine-node 0.5 in npmjs HOT 1
- `npm i inference-engine-node` meets error for version 0.1.5 HOT 2
- Add getAvailableDevices into Core interface HOT 2
- Add PreProcessInfo interface and preProcess property into InputInfo interface HOT 2
- Multiple Async Models for MYRIAD HOT 9
- Transition to the OpenVINO 2.0 API
- Run webml-polyfill/examples/image_classification in Electron.js with inference-engine-node HOT 1
- Add GitHub icon into the Electron.js example
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from inference-engine-node.