From 4b2c7aee13c3396c20faf740042e3c2357615f00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20M=E1=BA=A1nh=20D=C5=A9ng?= <48562727+manhdung20112000@users.noreply.github.com> Date: Wed, 14 Apr 2021 20:29:55 +0700 Subject: [PATCH] [Retry] Overcome IValue error on custom model --- .../java/org/pytorch/demo/objectdetection/PrePostProcessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ObjectDetection/app/src/main/java/org/pytorch/demo/objectdetection/PrePostProcessor.java b/ObjectDetection/app/src/main/java/org/pytorch/demo/objectdetection/PrePostProcessor.java index 305a943c..26d9cdf2 100644 --- a/ObjectDetection/app/src/main/java/org/pytorch/demo/objectdetection/PrePostProcessor.java +++ b/ObjectDetection/app/src/main/java/org/pytorch/demo/objectdetection/PrePostProcessor.java @@ -140,7 +140,7 @@ static ArrayList outputsToNMSPredictions(float[] outputs, float imgScale } Rect rect = new Rect((int)(startX+ivScaleX*left), (int)(startY+top*ivScaleY), (int)(startX+ivScaleX*right), (int)(startY+ivScaleY*bottom)); - Result result = new Result(cls, outputs[i*85+4], rect); + Result result = new Result(cls, outputs[i*mOutputColumn+4], rect); results.add(result); } }