Skip to content

Commit 30300f9

Browse files
committed
minor update
1 parent b7b5269 commit 30300f9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/javaaidev/birdclassifier/Classifier.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ OnnxTensor imageDataToTensor(URL url) throws IOException, OrtException {
8282
System.arraycopy(r, 0, data, 0, r.length);
8383
System.arraycopy(g, 0, data, r.length, g.length);
8484
System.arraycopy(b, 0, data, r.length + g.length, b.length);
85-
int total = data.length;
86-
float[] float32Data = new float[total];
87-
for (int i = 0; i < total; i++) {
85+
int length = data.length;
86+
float[] float32Data = new float[length];
87+
for (int i = 0; i < length; i++) {
8888
float32Data[i] = (float) (data[i] / 255.0);
8989
}
9090
return OnnxTensor.createTensor(env, FloatBuffer.wrap(float32Data),

0 commit comments

Comments
 (0)