* fix the svm train problem.

v1.6alpha
liuruoze 9 years ago
parent 767c4fd15a
commit 3a8f35dfe5

@ -2,7 +2,7 @@
EasyPR Option:
1. 测试;
2. 批量测试;
3. SVM训练(暂时关闭请用1.3版的);
3. SVM训练;
4. ANN训练;
5. GDTS生成;
6. 开发团队;

@ -2148,3 +2148,13 @@ Recall:84.2263%, Precise:70.6573%, Fscore:76.8474%.
Recall:84.2263%, Precise:70.6573%, Fscore:76.8474%.
0-error:60.4%, 1-error:71.6%, Chinese-precise:73.2%
总时间:286秒, 平均执行时间:1.11719秒
2016-12-25 11:04:59
总图片数:256, Plates count:297, 未定位车牌:29, 定位率:90.2357%
Recall:84.2263%, Precise:70.6573%, Fscore:76.8474%.
0-error:60.4%, 1-error:71.6%, Chinese-precise:73.2%
总时间:176秒, 平均执行时间:0.6875秒
2016-12-25 12:15:52
总图片数:256, Plates count:297, 未定位车牌:29, 定位率:90.2357%
Recall:84.2263%, Precise:70.6573%, Fscore:76.8474%.
0-error:60.4%, 1-error:71.6%, Chinese-precise:73.2%
总时间:178秒, 平均执行时间:0.695313秒

@ -46,19 +46,20 @@ void SvmTrain::train() {
fprintf(stdout, ">> Your SVM Model was saved to %s\n", svm_xml_);
fprintf(stdout, ">> Testing...\n");
this->test();
this->test();
}
void SvmTrain::test() {
// 1.4 bug fix: old 1.4 ver there is no null judge
if (NULL == svm_)
// if (NULL == svm_)
svm_ = cv::ml::SVM::load<cv::ml::SVM>(svm_xml_);
if (test_file_list_.empty()) {
this->prepare();
}
double count_all = test_file_list_.size();
double ptrue_rtrue = 0;
double ptrue_rfalse = 0;
@ -76,7 +77,7 @@ void SvmTrain::test() {
getLBPFeatures(image, feature);
auto predict = int(svm_->predict(feature));
std::cout << "predict: " << predict << std::endl;
//std::cout << "predict: " << predict << std::endl;
auto real = item.label;
if (predict == kForward && real == kForward) ptrue_rtrue++;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -170,6 +170,7 @@
<ClCompile Include="..\thirdparty\LBP\helper.cpp" />
<ClCompile Include="..\thirdparty\LBP\lbp.cpp" />
<ClCompile Include="..\thirdparty\mser\mser2.cpp" />
<ClCompile Include="..\thirdparty\svm\corrected_svm.cpp" />
<ClCompile Include="..\thirdparty\textDetect\erfilter.cpp" />
</ItemGroup>
<ItemGroup>
@ -200,6 +201,7 @@
<ClInclude Include="..\thirdparty\LBP\helper.hpp" />
<ClInclude Include="..\thirdparty\LBP\lbp.hpp" />
<ClInclude Include="..\thirdparty\mser\mser2.hpp" />
<ClInclude Include="..\thirdparty\svm\precomp.hpp" />
<ClInclude Include="..\thirdparty\textDetect\erfilter.hpp" />
</ItemGroup>
<ItemGroup>

@ -52,6 +52,9 @@
<Filter Include="源文件\thirdparty">
<UniqueIdentifier>{53b2336b-7946-4a0d-b8ec-540d0e1e1fb2}</UniqueIdentifier>
</Filter>
<Filter Include="源文件\svm">
<UniqueIdentifier>{9d5550a4-3ffe-4cb9-9c43-42dc7ac5aef6}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\core\chars_identify.cpp">
@ -123,6 +126,9 @@
<ClCompile Include="..\thirdparty\mser\mser2.cpp">
<Filter>源文件\thirdparty</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\svm\corrected_svm.cpp">
<Filter>源文件\svm</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\easypr\preprocess\deface.h">
@ -209,6 +215,9 @@
<ClInclude Include="..\thirdparty\textDetect\erfilter.hpp">
<Filter>头文件\thirdparty</Filter>
</ClInclude>
<ClInclude Include="..\thirdparty\svm\precomp.hpp">
<Filter>源文件\svm</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\LICENSE" />

Loading…
Cancel
Save