@@ -270,8 +270,8 @@ static void draw_objects(const cv::Mat& bgr, const std::vector<FaceObject>& obje
270
270
void show_usage ()
271
271
{
272
272
fprintf (
273
- stderr,
274
- " [Usage]: [-h]\n [-m model_file] [-i image_file] [-r repeat_count] [-t thread_count]\n " );
273
+ stderr,
274
+ " [Usage]: [-h]\n [-m model_file] [-i image_file] [-r repeat_count] [-t thread_count]\n " );
275
275
}
276
276
277
277
void get_input_data_scrfd (const char * image_file, float * input_data, int letterbox_rows, int letterbox_cols, const float * mean, const float * scale)
@@ -334,8 +334,8 @@ int main(int argc, char* argv[])
334
334
const char * image_file = nullptr ;
335
335
336
336
int img_c = 3 ;
337
- const float mean[3 ] = { 127 .5f , 127 .5f , 127 .5f };
338
- const float scale[3 ] = { 1 / 128 .f , 1 / 128 .f , 1 / 128 .f };
337
+ const float mean[3 ] = {127 .5f , 127 .5f , 127 .5f };
338
+ const float scale[3 ] = {1 / 128 .f , 1 / 128 .f , 1 / 128 .f };
339
339
340
340
// allow none square letterbox, set default letterbox size
341
341
int letterbox_rows = 320 ;
@@ -409,9 +409,8 @@ int main(int argc, char* argv[])
409
409
}
410
410
fprintf (stderr, " tengine-lite library version: %s\n " , get_tengine_version ());
411
411
412
-
413
412
/* create NVIDIA TensorRT backend */
414
- trt_option trt_opt = { 0 };
413
+ trt_option trt_opt = {0 };
415
414
trt_opt.dev_name = " TensorRT" ;
416
415
trt_opt.dla_index = 0 ;
417
416
trt_opt.gpu_index = 0 ;
@@ -424,7 +423,6 @@ int main(int argc, char* argv[])
424
423
return -1 ;
425
424
}
426
425
427
-
428
426
/* create graph, load tengine model xxx.tmfile */
429
427
graph_t graph = create_graph (trt_context, " tengine" , model_file);
430
428
if (graph == nullptr )
@@ -434,7 +432,7 @@ int main(int argc, char* argv[])
434
432
}
435
433
436
434
int img_size = letterbox_rows * letterbox_cols * img_c;
437
- int dims[] = { 1 , 3 , letterbox_rows, letterbox_cols };
435
+ int dims[] = {1 , 3 , letterbox_rows, letterbox_cols};
438
436
std::vector<float > input_data (img_size);
439
437
440
438
tensor_t input_tensor = get_graph_input_tensor (graph, 0 , 0 );
@@ -485,15 +483,15 @@ int main(int argc, char* argv[])
485
483
max_time = (std::max)(max_time, cur);
486
484
}
487
485
fprintf (stderr, " Repeat %d times, thread %d, avg time %.2f ms, max_time %.2f ms, min_time %.2f ms\n " , repeat_count, num_thread,
488
- total_time / repeat_count, max_time, min_time);
486
+ total_time / repeat_count, max_time, min_time);
489
487
fprintf (stderr, " --------------------------------------\n " );
490
488
491
489
/* postprocess */
492
490
const float prob_threshold = 0 .3f ;
493
491
const float nms_threshold = 0 .45f ;
494
492
495
493
std::vector<FaceObject> proposals, objects;
496
- int strides[] = { 8 , 16 , 32 };
494
+ int strides[] = {8 , 16 , 32 };
497
495
for (int stride_index = 0 ; stride_index < 3 ; stride_index++)
498
496
{
499
497
tensor_t score_tensor = get_graph_tensor (graph, score_pred_name[stride_index]);
0 commit comments