diff --git a/vehicle_structure_platform.git0708-3080-trt-face/src/FFNvDecoder/logger.hpp b/vehicle_structure_platform.git0708-3080-trt-face/src/FFNvDecoder/logger.hpp index d031a0a..3f71c87 100644 --- a/vehicle_structure_platform.git0708-3080-trt-face/src/FFNvDecoder/logger.hpp +++ b/vehicle_structure_platform.git0708-3080-trt-face/src/FFNvDecoder/logger.hpp @@ -6,7 +6,8 @@ * @Description: */ -#pragma once +#ifndef __LOGGER_HPP__ +#define __LOGGER_HPP__ #include @@ -344,3 +345,6 @@ static std::shared_ptr get_simple_logger(const LogLevel &level, static LoggerGenerator loggerGenerator; return loggerGenerator.gen_logger(level, logger_name, file_path, max_file_size, max_keep_days); } + + +#endif // __LOGGER_HPP__ \ No newline at end of file diff --git a/vehicle_structure_platform.git0708-3080-trt-face/src/VPT/snapshot_analysis/snapshot_helper.cpp b/vehicle_structure_platform.git0708-3080-trt-face/src/VPT/snapshot_analysis/snapshot_helper.cpp index 65a5e23..7ca824d 100644 --- a/vehicle_structure_platform.git0708-3080-trt-face/src/VPT/snapshot_analysis/snapshot_helper.cpp +++ b/vehicle_structure_platform.git0708-3080-trt-face/src/VPT/snapshot_analysis/snapshot_helper.cpp @@ -155,10 +155,6 @@ void snapshot_helper::snapshot_helper_init(int gpuid, double gpu_total_memory, c #endif v_analysis = V_ANALYSIS_TYPE::VC_ANALYSIS; - batch_hp = new sy_img[OBJ_BATCH_COUNT]{}; - batch_vehicle = new sy_img[OBJ_BATCH_COUNT_VEHICLE]{}; - batch_vehicle_vf = new sy_img[OBJ_BATCH_COUNT_VEHICLE]{}; - m_bExit = false; ProcessSnapshotThread = new std::thread(SnapshotThreadProcess, this); for (size_t i = 0; i < 12; i++) @@ -182,37 +178,10 @@ void snapshot_helper::snapshot_helper_release() m_human_fea.release(); m_face_det_module.face_det_module_release(); - if (batch_hp != NULL) - { - delete[] batch_hp; - batch_hp = NULL; - } - - if (batch_vehicle != NULL) - { - delete[] batch_vehicle; - batch_vehicle = NULL; - } - if (batch_vehicle_vf != NULL) - { - for (int i = 0; i < OBJ_BATCH_COUNT_VEHICLE; ++i) - { - if (batch_vehicle_vf[i].data_ != 0) - { - cudaFree(batch_vehicle_vf[i].data_); - batch_vehicle_vf[i].data_ = NULL; - } - } - delete[] batch_vehicle_vf; - batch_vehicle_vf = NULL; - } - - while (1) - { - { - std::lock_guard lock(threadMutex); - if (snapshotImageQueue.empty()) - break; + while (1) { + std::lock_guard lock(threadMutex); + if (snapshotImageQueue.empty()) { + snapshotImageQueue.pop(); } } @@ -826,6 +795,8 @@ void snapshot_helper::hp_analysis() int obj_batch_count = 0; int cur_batchsize = index == 0 ? per_batchsize : OBJ_BATCH_COUNT - per_batchsize; + + sy_img batch_hp[cur_batchsize]; for (int i = 0; i < cur_batchsize/*OBJ_BATCH_COUNT / OBJ_SCALE*/; i++) { OBJ_KEY cur_obj_key = count_person.front(); @@ -1046,6 +1017,7 @@ bool snapshot_helper::vehicle_color_analysis() int cur_batchsize = index == 0 ? cur_iter_count : OBJ_BATCH_COUNT_VEHICLE - cur_iter_count; + sy_img batch_vehicle[cur_batchsize]; for (int i = 0; i < /*OBJ_BATCH_COUNT_VEHICLE/ OBJ_SCALE*/cur_batchsize; i++) { @@ -1127,6 +1099,7 @@ bool snapshot_helper::vehicle_plate_dr_analysis() int start_idx = cur_iter_count * index; int cur_batchsize = index == 0 ? cur_iter_count : OBJ_BATCH_COUNT_VEHICLE - cur_iter_count; + sy_img batch_vehicle[cur_batchsize]; for (int i = 0; i < cur_batchsize/*OBJ_BATCH_COUNT_VEHICLE / OBJ_SCALE*/; i++) { OBJ_KEY cur_obj_key = count_vehicle_v[i+ start_idx]; @@ -1363,6 +1336,7 @@ bool snapshot_helper::vehicle_recg_analysis() { int cur_batchsize = index == 0 ? cur_iter_count : OBJ_BATCH_COUNT_VEHICLE - cur_iter_count; + sy_img batch_vehicle[cur_batchsize]; for (int i = 0; i < cur_batchsize/*OBJ_BATCH_COUNT_VEHICLE / OBJ_SCALE*/; i++) { OBJ_KEY cur_obj_key = count_vehicle_v[i]; diff --git a/vehicle_structure_platform.git0708-3080-trt-face/src/VPT/snapshot_analysis/snapshot_helper.h b/vehicle_structure_platform.git0708-3080-trt-face/src/VPT/snapshot_analysis/snapshot_helper.h index 10e325f..1a856a0 100644 --- a/vehicle_structure_platform.git0708-3080-trt-face/src/VPT/snapshot_analysis/snapshot_helper.h +++ b/vehicle_structure_platform.git0708-3080-trt-face/src/VPT/snapshot_analysis/snapshot_helper.h @@ -234,10 +234,6 @@ private: vector count_vehicle_v; //车的二次属性分析拆为三部分时,不再使用队列,只能使用数组 vector vehicle_result_v; - - sy_img * batch_hp = nullptr; - sy_img * batch_vehicle = nullptr; - sy_img * batch_vehicle_vf = nullptr; sy_command hp_analysis_cf; sy_command hcp_analysis_cf;