-
Notifications
You must be signed in to change notification settings - Fork 744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MXNet embedding extraction issue #912
Comments
I'm not an expert in MXNet, but I'm sure someone over there would know. @frankfliu Would you know how to do that with the C API? |
Here is working example using C++ api. This line extracts the embeddings for the aligned face image. Generally, everything works as expected in C api, for the each face image the model outputs unique embedding. |
I don't see them subtracting the mean. You'll need to give it exactly the same input to have a chance of getting the same output. |
the c_predict_api in MXNet has not been maintained, and is removed in 2.0.
Both the code you pointed to are in MXNet repo. I didn't see an obvious
issue there. But I won't be surprised if it has a bug since it's not been
maintained for a while.
Frank
…On Mon, Jul 20, 2020 at 3:09 AM Adika ***@***.***> wrote:
I'm not an expert in MXNet, but I'm sure someone over there would know.
If you have a working example in C/C++ though, please provide it!
@frankfliu <https://github.com/frankfliu> Would you know how to do that
with the C API?
Here
<https://github.com/solevarr/mxnet-insightface-cpp/blob/master/src/main.cpp>
is working example using C++ api. This
<https://github.com/solevarr/mxnet-insightface-cpp/blob/8c6a39ace9d5d6726f2cbc121ecac5db60a8701e/src/main.cpp#L91>
line extracts the embeddings for the aligned face image. Generally,
everything works as expected in C api, for the each face image the model
outputs unique embedding.
The something weird happens when it comes to JNI. I've also tried to
implement the simple JNI bridge using C++ api like here
<https://github.com/apache/incubator-mxnet-test/tree/master/amalgamation/jni>
but unfortunately when I call the native functions it always outputs the
same embedding for the completely different images. Im trying to figure out
whats the problem, because everything works fine for the different type of
problems like predicting the class of an object or the face detection (both
C++ and Java).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#912 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AF2LITY6SRNFJFHTL7M7PVLR4QJW5ANCNFSM4PB356GA>
.
|
Which API do you recommend to use? |
@frankfliu According to apache/mxnet#17676, it doesn't sound like c_predict_api is going away? |
https://github.com/apache/incubator-mxnet/blob/master/include/mxnet/c_api.h
is official MXNet API, you might need include:
https://github.com/apache/incubator-tvm/blob/9bd2c7b44208ed992061f8c2688e1137357f1db1/nnvm/include/nnvm/c_api.h
for
some functionality.
c_predict_api is using old module API, and module API is removed in 2.0.
You can see c_predict_api.h is removed in master branch.
Frank
…On Thu, Jul 23, 2020 at 3:05 AM Samuel Audet ***@***.***> wrote:
@frankfliu <https://github.com/frankfliu> According to
apache/mxnet#17676
<apache/mxnet#17676>, it doesn't
sound like c_predict_api is going away?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#912 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AF2LIT3TSR3W5SUMZFMVYHDR5ADNXANCNFSM4PB356GA>
.
|
|
c predict API was temporarily removed as it relied on the old graph executor instead of the new cached op. in 2.0, we will maintain cached op only. if you need the c predict API soon, we can provide some pointers on how to use the cached op as executor. |
Thanks to all. I solved this issue by implementing JNI bridge but instead of using MXNet C api, I've compiled and executed my model using TVM stack. |
Hello everyone. I've slightly modified the example which is located in the samples folder in order to extract embeddings from an image. I'm using MXNet models which can be derived from here https://github.com/deepinsight/insightface/wiki/Model-Zoo. The problem is running the model inference always outputs the same embedding for different images. So for aligned faces of completely different people the model outputs the same embedding. Could you please give me some guidance, how to fix this?
The text was updated successfully, but these errors were encountered: