daquexian / daquexian/dnnlibrary-example

DAQ file fails

Open
#8 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
13
Forks
9
PR merge metrics
No merged PRs in 30d

Description

[example_files.zip](https://github.com/daquexian/dnnlibrary-example/files/2804899/example_files.zip)
ONNX and DAQ file that are failing in the example app. Had to make some changes to the input sizes to get the non-square 270x480 image, but those were fine. It runs through the layer names then prints out
input name: 0
E/libc++abi: terminating with uncaught exception of type std::__ndk1::basic_string, std::__ndk1::allocator >
A/libc: Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 13852 (an.nnapiexample), pid 13852 (an.nnapiexample)

Here's the new image crop function in case you want to test it out

private float[] getInputDataCompatNet(Bitmap bitmap) {
final int INPUT_HEIGHT = 270;
final int INPUT_WIDTH = 480;

Mat imageMat = new Mat();

Utils.bitmapToMat(bitmap, imageMat);

Imgproc.cvtColor(imageMat, imageMat, Imgproc.COLOR_RGBA2RGB);
imageMat = scaleAndCenterCropTwo(imageMat, INPUT_HEIGHT,INPUT_WIDTH);
imageMat.convertTo(imageMat, CvType.CV_32FC3, 1. / 255);
imageMat = normalize(imageMat,
new Scalar(0.485, 0.456, 0.406), new Scalar(0.229, 0.224, 0.225));

float[] inputData = new float[imageMat.width() * imageMat.height() * imageMat.channels()];

imageMat.get(0, 0, inputData);

return inputData;
}

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.