Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

the 1st convolution layer in your network complains, that the number of channnels did not fit. ;)

we don't know, what kind of model you're using, but most likely it expects BGR or RGB input, not grayscale, so try a

Imgproc.cvtColor(frame, frame, Imgproc.COLOR_RGBA2BGR);

instead.

the 1st convolution layer in your network complains, that the number of channnels channels in your input did not fit. ;)

we don't know, what kind of model you're using, but most likely it expects BGR or RGB input, not grayscale, so try a

Imgproc.cvtColor(frame, frame, Imgproc.COLOR_RGBA2BGR);

instead. instead.

the 1st convolution layer in your network complains, that the number of channels in your input did not fit. ;)

we don't know, what kind of model you're using, but most likely it expects BGR or RGB input, not grayscale, so try a

Imgproc.cvtColor(frame, frame, Imgproc.COLOR_RGBA2BGR);

instead.

edit:

(see 1st comment !)

leNet is a classification model, NOT a detection one. you simply cannot infer bounding boxes from it.

all you can do is apply minMaxLoc() on the softmax output, and infer the classID from there.

the 1st convolution layer in your network complains, that the number of channels in your input did not fit. ;)

we don't know, what kind of model you're using, but most likely it expects BGR or RGB input, not grayscale, so try a

Imgproc.cvtColor(frame, frame, Imgproc.COLOR_RGBA2BGR);

instead.

edit:

(see 1st comment !)

you probably took the code from the android sample here, but mistook someting:

leNet is a classification model, NOT a detection one. you simply cannot infer bounding boxes from it.

all you can do is apply minMaxLoc() on the softmax output, and infer the classID from there.there:

Mat detections = net.forward("Softmax").reshape(1,1);
MinMaxLocResult mm = Core.minMaxLoc(detections);
int classID = mm.maxPos.x;

the 1st convolution layer in your network complains, that the number of channels in your input did not fit. ;)

we don't know, what kind of model you're using, but most likely it expects BGR or RGB input, not grayscale, so try a

Imgproc.cvtColor(frame, frame, Imgproc.COLOR_RGBA2BGR);

instead.

edit:

(see 1st comment !)

you probably took the code from the android sample here, but mistook someting:something:

leNet is a classification model, NOT a detection one. you simply cannot infer bounding boxes from it.

all you can do is apply minMaxLoc() on the softmax output, and infer the classID from there:

Mat detections = net.forward("Softmax").reshape(1,1);
MinMaxLocResult mm = Core.minMaxLoc(detections);
int classID = mm.maxPos.x;

the 1st convolution layer in your network complains, that the number of channels in your input did not fit. ;)

we don't know, what kind of model you're using, but most likely it expects BGR or RGB input, not grayscale, so try a

Imgproc.cvtColor(frame, frame, Imgproc.COLOR_RGBA2BGR);

instead.

edit:

(see 1st comment !)

you probably took the code from the android sample here, but mistook something:

leNet is a classification model, NOT a detection one. you simply cannot infer bounding boxes from it.

all you can do is apply minMaxLoc() on the softmax output, and infer the classID from there:

Mat detections = net.forward("Softmax").reshape(1,1);
MinMaxLocResult mm = Core.minMaxLoc(detections);
int classID = mm.maxPos.x;
mm.maxLoc.x;

the 1st convolution layer in your network complains, that the number of channels in your input did not fit. ;)

we don't know, what kind of model you're using, but most likely it expects BGR or RGB input, not grayscale, so try a

Imgproc.cvtColor(frame, frame, Imgproc.COLOR_RGBA2BGR);

instead.

edit:

(see 1st comment !)

you probably took the code from the android sample here, but mistook something:

leNet is a classification model, NOT a detection one. you simply cannot infer bounding boxes from it.

all you can do is apply minMaxLoc() on the softmax output, and infer the classID from there:

Mat detections = net.forward("Softmax").reshape(1,1);
MinMaxLocResult mm = Core.minMaxLoc(detections);
int classID = mm.maxLoc.x;
double probability = mm.maxVal;