diff --git a/src/ai_platform/MultiSourceProcess.cpp b/src/ai_platform/MultiSourceProcess.cpp index 83d5c67..b058fb7 100644 --- a/src/ai_platform/MultiSourceProcess.cpp +++ b/src/ai_platform/MultiSourceProcess.cpp @@ -364,7 +364,18 @@ bool CMultiSourceProcess::task_has_vpt_algor(const std::string &task_id){ if (algor_map == nullptr) return false; - return (algor_map->find(algorithm_type_t::HUMAN_GATHER) != algor_map->end() || + return (algor_map->find(algorithm_type_t::HUMAN_GATHER) != algor_map->end() || + algor_map->find(algorithm_type_t::VEHICLE_GATHER) != algor_map->end() || + algor_map->find(algorithm_type_t::HUMAN_CROSSING_LINE) != algor_map->end() || + algor_map->find(algorithm_type_t::HUMAN_DENSITY) != algor_map->end() || + algor_map->find(algorithm_type_t::HUMAN_CLIMB) != algor_map->end() || + algor_map->find(algorithm_type_t::VEHICLE_ILLEGAL_CROSSING_LINE) != algor_map->end() || + algor_map->find(algorithm_type_t::HUMAN_LINGER) != algor_map->end() || + algor_map->find(algorithm_type_t::VEHICLE_ILLEGAL_PARKING) != algor_map->end() || + algor_map->find(algorithm_type_t::HUMAN_REGION_GATHER) != algor_map->end() || + algor_map->find(algorithm_type_t::HUMAN_LEAVE_REGION) != algor_map->end() || + algor_map->find(algorithm_type_t::HUMAN_REGION_DISMISS) != algor_map->end() || + algor_map->find(algorithm_type_t::HUMAN_REGION_FAST_MOVING) != algor_map->end() || algor_map->find(algorithm_type_t::HUMAN_SNAPSHOT) != algor_map->end() || algor_map->find(algorithm_type_t::NONMOTOR_VEHICLE_SNAPSHOT) != algor_map->end() || algor_map->find(algorithm_type_t::SMOKING_DET) != algor_map->end() || @@ -378,7 +389,11 @@ bool CMultiSourceProcess::task_has_vpt_algor(const std::string &task_id){ algor_map->find(algorithm_type_t::PEDESTRIAN_RETROGRADE) != algor_map->end() || algor_map->find(algorithm_type_t::VEHICLE_RETROGRADE) != algor_map->end() || algor_map->find(algorithm_type_t::PEDESTRIAN_TRESPASS) != algor_map->end() || - algor_map->find(algorithm_type_t::VEHICLE_TRESPASS) != algor_map->end()); + algor_map->find(algorithm_type_t::VEHICLE_TRESPASS) != algor_map->end() || + algor_map->find(algorithm_type_t::VEHICLE_TIMING_SNAPSHOT) != algor_map->end() || + algor_map->find(algorithm_type_t::HUMAN_TIMING_SNAPSHOT) != algor_map->end() || + algor_map->find(algorithm_type_t::NONMOTOR_VEHICLE_TIMING_SNAPSHOT) != algor_map->end() + ); } void CMultiSourceProcess::decoded_cbk(DeviceMemory* devFrame){ @@ -625,18 +640,18 @@ int CMultiSourceProcess::algorthim_vpt(vector vec_gpuMem){ m_snapshot_reprocessing->screen_effective_snapshot(vptResult); -#ifndef VEHICLE_MULTI_BOXES +// #ifndef VEHICLE_MULTI_BOXES /* 快照优选(内部可实现不同的快照优选策略) */ m_snapshot_reprocessing->update_bestsnapshot(vec_vptMem, vptResult, deleteObjectID); /* for snapshot algorithm. 轨迹结束目标 做最后的结果返回(当前返回算法结果+快照保存路径)*/ vehicle_snapshot(vpt_interest_task_id, deleteObjectID); -#else +// #else algorithm_timing_snapshot(vec_vptMem, vptResult, algorithm_type_t::HUMAN_TIMING_SNAPSHOT); - algorithm_timing_snapshot(vec_vptMem, vptResult, algorithm_type_t::VEHICLE_TIMING_SNAPSHOT); - algorithm_timing_snapshot(vec_vptMem, vptResult, algorithm_type_t::NONMOTOR_VEHICLE_TIMING_SNAPSHOT); + // algorithm_timing_snapshot(vec_vptMem, vptResult, algorithm_type_t::VEHICLE_TIMING_SNAPSHOT); + // algorithm_timing_snapshot(vec_vptMem, vptResult, algorithm_type_t::NONMOTOR_VEHICLE_TIMING_SNAPSHOT); send_locus_finished_msg(vpt_interest_task_id, deleteObjectID); -#endif +// #endif // #ifdef WITH_SECOND_PROCESS /* for pedestrian safety det. 行人安全分析算法模块 */ diff --git a/src/ai_platform/task_param_manager.cpp b/src/ai_platform/task_param_manager.cpp index c120a41..cb93e9f 100644 --- a/src/ai_platform/task_param_manager.cpp +++ b/src/ai_platform/task_param_manager.cpp @@ -35,6 +35,16 @@ bool copy_algor_param_aux(const algorithm_type_t &algor_type, const std::string case algorithm_type_t::VEHICLE_SNAPSHOT: m_algor_config_params[task_id].vehicle_algors.insert(algor_type); goto _snapshot_param_copy; + case algorithm_type_t::VEHICLE_TIMING_SNAPSHOT: // 车辆轨迹定时抓拍 + m_algor_config_params[task_id].vehicle_algors.insert(algor_type); + goto _snapshot_param_copy; + case algorithm_type_t::HUMAN_TIMING_SNAPSHOT: // 行人轨迹定时抓拍 + m_algor_config_params[task_id].human_algors.insert(algor_type); + goto _snapshot_param_copy; + case algorithm_type_t::NONMOTOR_VEHICLE_TIMING_SNAPSHOT: // 非机动车轨迹定时抓拍 + m_algor_config_params[task_id].nonmotor_vehicle_algors.insert(algor_type); + goto _snapshot_param_copy; + case algorithm_type_t::NONMOTOR_VEHICLE_SNAPSHOT: { m_algor_config_params[task_id].nonmotor_vehicle_algors.insert(algor_type); _snapshot_param_copy : { diff --git a/src/demo/demo.cpp b/src/demo/demo.cpp index b3174ba..cb9dd30 100644 --- a/src/demo/demo.cpp +++ b/src/demo/demo.cpp @@ -879,6 +879,88 @@ void set_task_params(task_param &tparam, const unsigned &idx, const algorithm_ty algor_init_params->basic_param = basic_params; } break; + case algorithm_type_t::VEHICLE_TIMING_SNAPSHOT: { + + auto basic_params = new algor_basic_config_param_t; + { + basic_params->result_folder = "res/vehicle_timing_snapshot"; + basic_params->result_folder_little = "res/vehicle_timing_little"; + + auto adapt_params = new universal_algor_adapt_param; + { + adapt_params->points_count = 4; // 0表示不生效 + adapt_params->points[0].x_ = 0; adapt_params->points[0].y_ = 0; + adapt_params->points[1].x_ = 1920; adapt_params->points[1].y_ = 0; + adapt_params->points[2].x_ = 1920; adapt_params->points[2].y_ = 1080; + adapt_params->points[3].x_ = 0; adapt_params->points[3].y_ = 1080; + } + basic_params->adapt_param = adapt_params; + } + + auto algor_params = new algor_config_param_snapshot; + { + algor_params->threshold = 0.6f; + algor_params->snap_frame_interval = 25; + } + algor_init_params->algor_param = algor_params; + algor_init_params->basic_param = basic_params; + } break; + + case algorithm_type_t::HUMAN_TIMING_SNAPSHOT: { + + auto basic_params = new algor_basic_config_param_t; + { + basic_params->result_folder = "res/human_timing_snapshot"; + basic_params->result_folder_little = "res/human_timing_little"; + + //共性算法适配测试用 + auto adapt_params = new universal_algor_adapt_param; + { + adapt_params->points_count = 4; // 0表示不生效 + adapt_params->points[0].x_ = 0; adapt_params->points[0].y_ = 0; + adapt_params->points[1].x_ = 1920; adapt_params->points[1].y_ = 0; + adapt_params->points[2].x_ = 1920; adapt_params->points[2].y_ = 1080; + adapt_params->points[3].x_ = 0; adapt_params->points[3].y_ = 1080; + } + basic_params->adapt_param = adapt_params; + } + + auto algor_params = new algor_config_param_snapshot; + { + algor_params->threshold = 0.6f; + algor_params->snap_frame_interval = 25; + } + algor_init_params->algor_param = algor_params; + algor_init_params->basic_param = basic_params; + } break; + + case algorithm_type_t::NONMOTOR_VEHICLE_TIMING_SNAPSHOT: { + + auto basic_params = new algor_basic_config_param_t; + { + basic_params->result_folder = "res/nonvehicle_timing_snapshot"; + basic_params->result_folder_little = "res/nonvehicle_timing_little"; + + auto adapt_params = new universal_algor_adapt_param; + { + adapt_params->points_count = 4; // 0表示不生效 + adapt_params->points[0].x_ = 0; adapt_params->points[0].y_ = 0; + adapt_params->points[1].x_ = 1920; adapt_params->points[1].y_ = 0; + adapt_params->points[2].x_ = 1920; adapt_params->points[2].y_ = 1080; + adapt_params->points[3].x_ = 0; adapt_params->points[3].y_ = 1080; + } + basic_params->adapt_param = adapt_params; + } + + auto algor_params = new algor_config_param_snapshot; + { + algor_params->threshold = 0.6f; + algor_params->snap_frame_interval = 25; + } + algor_init_params->algor_param = algor_params; + algor_init_params->basic_param = basic_params; + } break; + default: { if (algor_init_params != nullptr) { delete algor_init_params; @@ -1231,7 +1313,8 @@ void test_gpu(int gpuID){ ,algorithm_type_t::VEHICLE_ILLEGAL_CROSSING_LINE}; std::vector algor_wenhuagong = {algorithm_type_t::NONMOTOR_VEHICLE_SNAPSHOT, algorithm_type_t::VEHICLE_TRESPASS,algorithm_type_t::VEHICLE_SNAPSHOT,algorithm_type_t::VEHICLE_GATHER,algorithm_type_t::VEHICLE_ILLEGAL_PARKING,algorithm_type_t::VEHICLE_ILLEGAL_CROSSING_LINE - ,algorithm_type_t::HUMAN_GATHER, algorithm_type_t::FACE_SNAPSHOT, algorithm_type_t::HUMAN_LEAVE_REGION, algorithm_type_t::HUMAN_REGION_DISMISS, algorithm_type_t::HUMAN_REGION_FAST_MOVING, algorithm_type_t::HUMAN_SNAPSHOT, algorithm_type_t::HUMAN_REGION_GATHER, algorithm_type_t::HUMAN_DENSITY, algorithm_type_t::HUMAN_CROSSING_LINE, algorithm_type_t::HUMAN_CLIMB, algorithm_type_t::HUMAN_LINGER + ,algorithm_type_t::HUMAN_GATHER, algorithm_type_t::FACE_SNAPSHOT, algorithm_type_t::HUMAN_LEAVE_REGION, algorithm_type_t::HUMAN_REGION_DISMISS, algorithm_type_t::HUMAN_REGION_FAST_MOVING, algorithm_type_t::HUMAN_SNAPSHOT, algorithm_type_t::HUMAN_REGION_GATHER, algorithm_type_t::HUMAN_DENSITY + , algorithm_type_t::HUMAN_CROSSING_LINE, algorithm_type_t::HUMAN_CLIMB, algorithm_type_t::HUMAN_LINGER, algorithm_type_t::VEHICLE_TIMING_SNAPSHOT, algorithm_type_t::HUMAN_TIMING_SNAPSHOT, algorithm_type_t::NONMOTOR_VEHICLE_TIMING_SNAPSHOT }; // int repeat_num = 1000; diff --git a/src/reprocessing_module/snapshot_reprocessing.cpp b/src/reprocessing_module/snapshot_reprocessing.cpp index bfc2d7e..e560636 100644 --- a/src/reprocessing_module/snapshot_reprocessing.cpp +++ b/src/reprocessing_module/snapshot_reprocessing.cpp @@ -736,8 +736,6 @@ vector snapshot_reprocessing::get_timing_snapshot(vector