@@ -208,10 +208,10 @@ protected List < float[] > filter_box(float[][][] model_outputs, float iou_thres
208
208
int max_index ;
209
209
float max ;
210
210
for (int i = 0 ; i < rows ; i ++) {
211
- x1 = (model_outputs [0 ][i ][0 ] - model_outputs [0 ][i ][2 ] / 2 f ) * input_width ;
212
- y1 = (model_outputs [0 ][i ][1 ] - model_outputs [0 ][i ][3 ] / 2 f ) * input_height ;
213
- x2 = (model_outputs [0 ][i ][0 ] + model_outputs [0 ][i ][2 ] / 2 f ) * input_width ;
214
- y2 = (model_outputs [0 ][i ][1 ] + model_outputs [0 ][i ][3 ] / 2 f ) * input_height ;
211
+ x1 = (model_outputs [0 ][i ][0 ] - model_outputs [0 ][i ][2 ] / 2f ) * input_width ;
212
+ y1 = (model_outputs [0 ][i ][1 ] - model_outputs [0 ][i ][3 ] / 2f ) * input_height ;
213
+ x2 = (model_outputs [0 ][i ][0 ] + model_outputs [0 ][i ][2 ] / 2f ) * input_width ;
214
+ y2 = (model_outputs [0 ][i ][1 ] + model_outputs [0 ][i ][3 ] / 2f ) * input_height ;
215
215
conf = model_outputs [0 ][i ][conf_index ];
216
216
if (conf < conf_threshold ) continue ;
217
217
max_index = class_index ;
@@ -230,12 +230,12 @@ protected List < float[] > filter_box(float[][][] model_outputs, float iou_thres
230
230
tmp [2 ] = x2 ;
231
231
tmp [3 ] = y2 ;
232
232
tmp [4 ] = model_outputs [0 ][i ][max_index ];
233
- tmp [5 ] = (max_index - class_index ) * 1 f ;
233
+ tmp [5 ] = (max_index - class_index ) * 1f ;
234
234
pre_box .add (tmp );
235
235
}
236
236
}
237
237
if (pre_box .isEmpty ()) return new ArrayList < > ();
238
- Comparator < float [] > compareValues = (v1 , v2 ) - > Float .compare (v2 [4 ], v1 [4 ]);
238
+ Comparator <float []> compareValues = (v1 , v2 ) -> Float .compare (v2 [4 ], v1 [4 ]);
239
239
Collections .sort (pre_box , compareValues );
240
240
return nms (pre_box , iou_threshold );
241
241
} catch (Exception e ) {
@@ -293,8 +293,8 @@ protected List < float[] > restore_size(List < float[] > nms,
293
293
nms .get (i )[3 ] = min (src_height , Math .max (nms .get (i )[3 ] * gainy , 0 ));
294
294
}
295
295
} else {
296
- float padx = (src_width - input_width ) / 2 f ;
297
- float pady = (src_height - input_height ) / 2 f ;
296
+ float padx = (src_width - input_width ) / 2f ;
297
+ float pady = (src_height - input_height ) / 2f ;
298
298
for (int i = 0 ; i < nms .size (); i ++) {
299
299
nms .get (i )[0 ] = min (src_width , Math .max (nms .get (i )[0 ] + padx , 0 ));
300
300
nms .get (i )[1 ] = min (src_height , Math .max (nms .get (i )[1 ] + pady , 0 ));
0 commit comments