Commit 9b88b3355509616cf2eec6d087818ffd69e04351
1 parent
2ae58093
恢复代码
Showing
3 changed files
with
51 additions
and
51 deletions
src/PicAnalysis.cpp
@@ -17,43 +17,43 @@ int PicAnalysis::init(int dev_id) { | @@ -17,43 +17,43 @@ int PicAnalysis::init(int dev_id) { | ||
17 | 17 | ||
18 | int ret = SY_FAILED; | 18 | int ret = SY_FAILED; |
19 | 19 | ||
20 | - // ret = m_vehicle_analysis.init(dev_id, 16); | ||
21 | - // if(0 != ret){ | ||
22 | - // return -1; | ||
23 | - // } | ||
24 | - | ||
25 | - // head_tail_param ht_param; | ||
26 | - // ht_param.devId = dev_id; | ||
27 | - // ht_param.max_batch = 16; | ||
28 | - // ret = m_head_tail_algorithm.init(ht_param); | ||
29 | - // if(0 != ret){ | ||
30 | - // return -1; | ||
31 | - // } | ||
32 | - | ||
33 | - // ret = m_clothes_algorithm.init(dev_id); | ||
34 | - // if(0 != ret){ | ||
35 | - // return -1; | ||
36 | - // } | ||
37 | - | ||
38 | - // ret = m_human_algorithm.init(dev_id); | ||
39 | - // if(0 != ret){ | ||
40 | - // return -1; | ||
41 | - // } | ||
42 | - | ||
43 | - // ret = m_human_car_algorithm.init(dev_id); | ||
44 | - // if(0 != ret){ | ||
45 | - // return -1; | ||
46 | - // } | ||
47 | - | ||
48 | - // ret = m_motor_rainshed_algorithm.init(dev_id); | ||
49 | - // if(0 != ret){ | ||
50 | - // return -1; | ||
51 | - // } | ||
52 | - | ||
53 | - // ret = m_motor_phone_algorithm.init(dev_id); | ||
54 | - // if(0 != ret){ | ||
55 | - // return -1; | ||
56 | - // } | 20 | + ret = m_vehicle_analysis.init(dev_id, 16); |
21 | + if(0 != ret){ | ||
22 | + return -1; | ||
23 | + } | ||
24 | + | ||
25 | + head_tail_param ht_param; | ||
26 | + ht_param.devId = dev_id; | ||
27 | + ht_param.max_batch = 16; | ||
28 | + ret = m_head_tail_algorithm.init(ht_param); | ||
29 | + if(0 != ret){ | ||
30 | + return -1; | ||
31 | + } | ||
32 | + | ||
33 | + ret = m_clothes_algorithm.init(dev_id); | ||
34 | + if(0 != ret){ | ||
35 | + return -1; | ||
36 | + } | ||
37 | + | ||
38 | + ret = m_human_algorithm.init(dev_id); | ||
39 | + if(0 != ret){ | ||
40 | + return -1; | ||
41 | + } | ||
42 | + | ||
43 | + ret = m_human_car_algorithm.init(dev_id); | ||
44 | + if(0 != ret){ | ||
45 | + return -1; | ||
46 | + } | ||
47 | + | ||
48 | + ret = m_motor_rainshed_algorithm.init(dev_id); | ||
49 | + if(0 != ret){ | ||
50 | + return -1; | ||
51 | + } | ||
52 | + | ||
53 | + ret = m_motor_phone_algorithm.init(dev_id); | ||
54 | + if(0 != ret){ | ||
55 | + return -1; | ||
56 | + } | ||
57 | 57 | ||
58 | ret = m_road_seg_algorithm.init(dev_id); | 58 | ret = m_road_seg_algorithm.init(dev_id); |
59 | if(0 != ret){ | 59 | if(0 != ret){ |
@@ -105,24 +105,24 @@ int PicAnalysis::analysis_sync(vector<string> vec_file_path){ | @@ -105,24 +105,24 @@ int PicAnalysis::analysis_sync(vector<string> vec_file_path){ | ||
105 | vec_img.push_back(img); | 105 | vec_img.push_back(img); |
106 | } | 106 | } |
107 | 107 | ||
108 | - // m_vehicle_analysis.detect(vec_img); | 108 | + m_vehicle_analysis.detect(vec_img); |
109 | 109 | ||
110 | - // vector<HeadTailResult> head_tail_result; | ||
111 | - // ret = m_head_tail_algorithm.detect(vec_img, head_tail_result); | ||
112 | - // if (0 != ret) { | ||
113 | - // LOG_ERROR("m_head_tail_algorithm failed!"); | ||
114 | - // head_tail_result.clear(); | ||
115 | - // } | 110 | + vector<HeadTailResult> head_tail_result; |
111 | + ret = m_head_tail_algorithm.detect(vec_img, head_tail_result); | ||
112 | + if (0 != ret) { | ||
113 | + LOG_ERROR("m_head_tail_algorithm failed!"); | ||
114 | + head_tail_result.clear(); | ||
115 | + } | ||
116 | 116 | ||
117 | - // m_clothes_algorithm.detect(vec_img); | 117 | + m_clothes_algorithm.detect(vec_img); |
118 | 118 | ||
119 | - // m_human_algorithm.detect(vec_img); | 119 | + m_human_algorithm.detect(vec_img); |
120 | 120 | ||
121 | - // m_human_car_algorithm.detect(vec_img); | 121 | + m_human_car_algorithm.detect(vec_img); |
122 | 122 | ||
123 | - // m_motor_rainshed_algorithm.detect(vec_img); | 123 | + m_motor_rainshed_algorithm.detect(vec_img); |
124 | 124 | ||
125 | - // m_motor_phone_algorithm.detect(vec_img); | 125 | + m_motor_phone_algorithm.detect(vec_img); |
126 | 126 | ||
127 | m_road_seg_algorithm.detect(vec_img); | 127 | m_road_seg_algorithm.detect(vec_img); |
128 | 128 |
src/ai_engine_module/RoadSegAnalysis.cpp
@@ -31,7 +31,7 @@ int RoadSegAnalysis::init(int devId){ | @@ -31,7 +31,7 @@ int RoadSegAnalysis::init(int devId){ | ||
31 | 31 | ||
32 | int RoadSegAnalysis::detect(vector<sy_img> vec_img){ | 32 | int RoadSegAnalysis::detect(vector<sy_img> vec_img){ |
33 | 33 | ||
34 | - ACL_CALL(aclrtSetCurrentContext(ctx), SY_SUCCESS, SY_FAILED); | 34 | + ACL_CALL(aclrtSetCurrentContext(ctx), SY_SUCCESS, SY_FAILED); |
35 | 35 | ||
36 | const int batchsize = vec_img.size(); | 36 | const int batchsize = vec_img.size(); |
37 | rs_result results[batchsize]; | 37 | rs_result results[batchsize]; |
src/main.cpp
@@ -14,7 +14,7 @@ int main() { | @@ -14,7 +14,7 @@ int main() { | ||
14 | 14 | ||
15 | pic_analysis.analysis_sync(vec_path); | 15 | pic_analysis.analysis_sync(vec_path); |
16 | 16 | ||
17 | - while (getchar() != 'q'); | 17 | + // while (getchar() != 'q'); |
18 | 18 | ||
19 | return 0; | 19 | return 0; |
20 | } | 20 | } |
21 | \ No newline at end of file | 21 | \ No newline at end of file |