Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

DNN.net.forward() in Android

  String model = getPath("model.net", getApplicationContext());
  net = Dnn.readNet(model);    
 Mat frame = inputFrame.rgba();
 //   Imgproc.cvtColor(frame, frame, Imgproc.COLOR_RGBA2RGB);
    // Forward image through network.
    Imgproc.resize(frame,frame,new Size(500,441));
    Mat blob = Dnn.blobFromImage(frame, IN_SCALE_FACTOR,
            new Size(IN_WIDTH, IN_HEIGHT),
            new Scalar(MEAN_VAL, MEAN_VAL, MEAN_VAL), /*swapRB*/true);
    net.setInput(blob);
    Mat detections = net.forward()

following is the issue I get at net.forward()

Assertion failed (inputs[0] == inputs[i]) in virtual bool cv::dnn::EltwiseLayerImpl::getMemoryShapes(const std::vector<std::vector<int> >&, int, std::vector<std::vector<int> >&, std::vector<std::vector<int> >&) const, file /build/3_4_pack-android/opencv/modules/dnn/src/layers/eltwise_layer.cpp,

DNN.net.forward() in Android

  String model = getPath("model.net", getApplicationContext());
  net = Dnn.readNet(model);    
 Mat frame = inputFrame.rgba();
 //   Imgproc.cvtColor(frame, frame, Imgproc.COLOR_RGBA2RGB);
    // Forward image through network.
    Imgproc.resize(frame,frame,new Size(500,441));
    Mat blob = Dnn.blobFromImage(frame, IN_SCALE_FACTOR,
            new Size(IN_WIDTH, IN_HEIGHT),
            new Scalar(MEAN_VAL, MEAN_VAL, MEAN_VAL), /*swapRB*/true);
    net.setInput(blob);
    Mat detections = net.forward()

following is the issue I get at net.forward()

Assertion failed (inputs[0] == inputs[i]) in virtual bool cv::dnn::EltwiseLayerImpl::getMemoryShapes(const std::vector<std::vector<int> >&, int, std::vector<std::vector<int> >&, std::vector<std::vector<int> >&) const, file /build/3_4_pack-android/opencv/modules/dnn/src/layers/eltwise_layer.cpp,