FastDPM-2015-Nov.zip


C++版本DPM的行人检测,效果比hog要好,速度没Hog快。
资源截图
代码片段和文件信息
#include “FastDPM.h“

FastDPM::FastDPM( string model_file )
{
// 1.
load_model( model_file model );
analyze_model( model );
}

Mat FastDPM::prepareImg( Mat &img_uint8 )
// Make a uint8 type image into a float type mat with 3 channels
{
if( img_uint8.depth()!=CV_8U || (img_uint8.channels()!=1 && img_uint8.channels()!=3) ){
printf(“Function prepareImg() only takes as input an image of 1 or 3 channels of uint8 type!“);
throw runtime_error(““);
}
if( img_uint8.channels()==1 )
cvtColor( img_uint8 img_color CV_GRAY2RGB );
else if( img_uint8.channels()==3 )
img_color = img_uint8;
Mat img;
img_color.convertTo( img CV_32FC3 );
return img;
}

void loadPyramid( const string FileName FEATURE_PYRAMID &pyra );
void FastDPM::detect( Mat &img float score_thresh /* = -FLOAT_INF */ bool show_hints /* = true */ bool show_img /* = true */ string save_img /* = */ )
{
hints = show_hints;
detections.clear();
prag_start = yuGetCurrentTime(‘M‘);
// 1. Feature pyramid <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
if( hints ){ printf(“Calculating feature pyramid ... “); start_clock = prag_start; }
/* method 1. */
featpyramid( img model pyra );
//loadPyramid( “pyramid.txt“ pyra );
/* method 2. */
//featpyramid2( img model pyra );
if( hints ){ end_clock = yuGetCurrentTime(‘M‘); printf(“_featpyramid takes %gs
“(end_clock-start_clock)/1000.f); }

update_ruleData( model pyra.num_levels );

// 2. Filter responses & Deformation rules & Structural rules<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
if( hints ){ printf(“Applying rules ... “); start_clock = end_clock; }
/* method 1. */
//apply_rules( model pyra );
/* method 2. */
//apply_rules2( model pyra );
/* method 3. */
apply_rules3( model pyra );
if( hints ){ end_clock = yuGetCurrentTime(‘M‘); printf(“_apply_rules takes %gs
“(end_clock-start_clock)/1000.f); }

// 3. Parse detections <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
if( hints ){ printf(“Parsing detections ... “); start_clock = end_clock; }
detections = parse_detections( model pyra score_thresh );
if( detections.empty() ) { printf(“NO DETECTIONS!
“); return; }
if( hints ){ end_clock = yuGetCurrentTime(‘M‘); printf(“_parse_detections takes %gs
“(end_clock-start_clock)/1000.f); }

// 4. Show results <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
float Elapsed_Time = 0;
if (hints) { prag_end = end_clock; Elapsed_Time = (prag_end - prag_start) / 1000.f; }
if (show_img || !save_img.empty()){
draw_img(img_color detections Elapsed_Time);
if (show_img)
imshow(“FAST_DPM“ img_color);
if (!save_img.empty())
imwrite(save_img img_color);
}

}


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-09-22 19:23  FastDPM-2015-Nov
     目录           0  2016-09-22 19:23  FastDPM-2015-NovFastDPM-2014-May
     文件    71237632  2016-09-22 18:45  FastDPM-2015-NovFastDPM-2014-May.sdf
     文件         915  2014-06-13 21:55  FastDPM-2015-NovFastDPM-2014-May.sln
     文件       20992  2014-05-05 15:19  FastDPM-2015-NovFastDPM-2014-May.suo
     文件       65536  2016-09-22 18:45  FastDPM-2015-NovFastDPM-2014-May.v12.suo
     文件       35236  2016-07-22 08:44  FastDPM-2015-NovFastDPM-2014-May2.jpg
     目录           0  2016-09-22 19:23  FastDPM-2015-NovFastDPM-2014-Mayauxiliary
     文件        1049  2014-05-05 12:33  FastDPM-2015-NovFastDPM-2014-MayauxiliarycvPrint.cpp
     文件         327  2013-11-27 22:23  FastDPM-2015-NovFastDPM-2014-MayauxiliarygetCurrentTime.cpp
     文件         194  2013-11-30 22:13  FastDPM-2015-NovFastDPM-2014-MayauxiliaryyuSaveMat.cpp
     文件        7628  2014-05-05 12:54  FastDPM-2015-NovFastDPM-2014-MayFastDPM-2014-May.vcproj
     文件        1427  2014-05-05 15:19  FastDPM-2015-NovFastDPM-2014-MayFastDPM-2014-May.vcproj.BYQLMZZOY8QMW15.Administrator.user
     文件        8007  2016-09-22 18:29  FastDPM-2015-NovFastDPM-2014-MayFastDPM-2014-May.vcxproj
     文件        5043  2016-07-26 12:36  FastDPM-2015-NovFastDPM-2014-MayFastDPM-2014-May.vcxproj.filters
     文件         164  2015-09-09 22:09  FastDPM-2015-NovFastDPM-2014-MayFastDPM-2014-May.vcxproj.user
     文件        2688  2016-09-22 18:41  FastDPM-2015-NovFastDPM-2014-MayFastDPM.cpp
     文件         934  2013-11-25 17:03  FastDPM-2015-NovFastDPM-2014-MayFastDPM.h
     目录           0  2016-09-22 19:23  FastDPM-2015-NovFastDPM-2014-Mayfuns
     文件        3505  2014-06-13 22:21  FastDPM-2015-NovFastDPM-2014-Mayfunsanalyze_model.cpp
     文件        4612  2015-11-04 23:11  FastDPM-2015-NovFastDPM-2014-Mayfunsapply_rules.cpp
     文件        4603  2015-11-04 23:12  FastDPM-2015-NovFastDPM-2014-Mayfunsapply_rules2.cpp
     文件        5477  2015-11-04 23:12  FastDPM-2015-NovFastDPM-2014-Mayfunsapply_rules3.cpp
     文件        2211  2015-09-17 22:06  FastDPM-2015-NovFastDPM-2014-Mayfunsboxpred_get.cpp
     文件        1735  2013-11-30 22:10  FastDPM-2015-NovFastDPM-2014-Mayfunsboxpred_input.cpp
     文件        2788  2013-11-30 13:02  FastDPM-2015-NovFastDPM-2014-Mayfunsounded_dt.cpp
     文件        2701  2013-11-30 13:35  FastDPM-2015-NovFastDPM-2014-Mayfunsounded_dt2.cpp
     文件        1194  2013-11-30 19:52  FastDPM-2015-NovFastDPM-2014-Mayfunsclipboxes.cpp
     文件        1307  2013-11-14 12:32  FastDPM-2015-NovFastDPM-2014-MayfunscvPermutate.cpp
     文件        2504  2013-11-30 20:49  FastDPM-2015-NovFastDPM-2014-Mayfunsdetections_trees2.cpp
     文件        1868  2016-09-22 18:43  FastDPM-2015-NovFastDPM-2014-Mayfunsdraw_img.cpp
............此处省略24个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)