Commit 773018881ff102b001a218f6d9d83f9d68eaa302

Authored by Hu Chunming
1 parent 3e43f0c7

代码优化

src/ai_engine_module/VehicleAnalysisDevice.cpp
... ... @@ -828,14 +828,6 @@ int va_batch(void * handle, sy_img * img_data_array, int batch_size, va_result *
828 828 LOG_DEBUG("1-2 vpd_process----- ");
829 829 vpd_result vpd_result_temp[car_body_num];
830 830 vpd_result vpd_result_[car_body_num];
831   - for(int b=0;b<car_body_num;b++)
832   - {
833   - vpd_result_temp[b].count = 0;
834   - vpd_result_temp[b].vpd_res=new vpd_info[OBJ_MAX_COUNT];
835   -
836   - vpd_result_[b].count = 0;
837   - vpd_result_[b].vpd_res=new vpd_info[OBJ_MAX_COUNT];
838   - }
839 831  
840 832 int p_idx=0;
841 833 for(int iter=0;iter<body_iter;iter++)
... ... @@ -849,7 +841,6 @@ int va_batch(void * handle, sy_img * img_data_array, int batch_size, va_result *
849 841 else
850 842 {
851 843 temp_batch=MAX_BATCHSIZE;
852   - //res_status=vpd_process10(tools->vpd_handle, vpd_img_data[iter], temp_batch, &vpd_result_temp[p_idx]);
853 844 res_status=vpd_process(tools->vpd_handle, vpd_img_data[iter], temp_batch, &vpd_result_temp[p_idx]);
854 845 }
855 846  
... ... @@ -964,23 +955,7 @@ int va_batch(void * handle, sy_img * img_data_array, int batch_size, va_result *
964 955 vpd_img_data = NULL;
965 956 }
966 957  
967   - //delete
968   - for(int b=0;b<car_body_num;b++)
969   - {
970   - if(vpd_result_temp[b].vpd_res !=NULL)
971   - {
972   - delete[] vpd_result_temp[b].vpd_res;
973   - vpd_result_temp[b].vpd_res = NULL;
974   - }
975   -
976   - if(vpd_result_[b].vpd_res !=NULL)
977   - {
978   - delete[] vpd_result_[b].vpd_res;
979   - vpd_result_[b].vpd_res = NULL;
980   - }
981   - }
982 958 LOG_DEBUG("1-2 vpd_process----- ");
983   -
984 959 }
985 960 }
986 961 LOG_DEBUG("body_num={} car_body_num={} motor_num={} tricycle_num={} ",body_num,car_body_num,motor_num,tricycle_num);
... ...
src/ai_engine_module/VehicleAnalysisDevice.h
... ... @@ -45,7 +45,7 @@ const char * va_get_version();
45 45 * return: success(0) or error code(<0)
46 46 * notes: null
47 47 *************************************************************************/
48   -int va_batch(void * handle, sy_img * img_data_array, int batch_size, va_result *result);
  48 +int va_batch(void * handle, sy_img * img_data_array, int batch_size, va_result *result);
49 49  
50 50  
51 51  
... ...