mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 15:23:05 +04:00
final refactoring and test for training
This commit is contained in:
@@ -1,7 +1,3 @@
|
||||
if(IOS OR ANDROID)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(name sft)
|
||||
set(the_target opencv_${name})
|
||||
|
||||
|
||||
+3
-3
@@ -108,9 +108,9 @@ void sft::write(cv::FileStorage& fs, const string&, const Config& x)
|
||||
|
||||
void sft::read(const cv::FileNode& node, Config& x, const Config& default_value)
|
||||
{
|
||||
if(node.empty())
|
||||
x = default_value;
|
||||
else
|
||||
x = default_value;
|
||||
|
||||
if(!node.empty())
|
||||
x.read(node);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,27 +40,16 @@
|
||||
//
|
||||
//M*/
|
||||
|
||||
#include <sft/fpool.hpp>
|
||||
#include <sft/dataset.hpp>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
|
||||
#include <iostream>
|
||||
#include <queue>
|
||||
|
||||
// ============ Dataset ============ //
|
||||
namespace {
|
||||
using namespace sft;
|
||||
|
||||
string itoa(long i)
|
||||
{
|
||||
char s[65];
|
||||
sprintf(s, "%ld", i);
|
||||
return std::string(s);
|
||||
}
|
||||
|
||||
}
|
||||
inline std::string itoa(long i) { return cv::format("%ld", i); }
|
||||
|
||||
#if !defined (_WIN32) && ! defined(__MINGW32__)
|
||||
|
||||
#include <glob.h>
|
||||
# include <glob.h>
|
||||
|
||||
namespace {
|
||||
using namespace sft;
|
||||
@@ -84,7 +73,7 @@ void glob(const string& path, svector& ret)
|
||||
}
|
||||
#else
|
||||
|
||||
#include <windows.h>
|
||||
# include <windows.h>
|
||||
namespace {
|
||||
using namespace sft;
|
||||
void glob(const string& refRoot, const string& refExt, svector &refvecFiles)
|
||||
@@ -138,7 +127,6 @@ void glob(const string& refRoot, const string& refExt, svector &refvecFiles)
|
||||
ScaledDataset::ScaledDataset(const string& path, const int oct)
|
||||
{
|
||||
dprintf("%s\n", "get dataset file names...");
|
||||
|
||||
dprintf("%s\n", "Positives globing...");
|
||||
|
||||
#if !defined (_WIN32) && ! defined(__MINGW32__)
|
||||
@@ -44,6 +44,7 @@
|
||||
#define __SFT_COMMON_HPP__
|
||||
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/softcascade/softcascade.hpp>
|
||||
|
||||
namespace sft
|
||||
{
|
||||
@@ -58,7 +59,7 @@ namespace sft
|
||||
}
|
||||
|
||||
// used for noisy printfs
|
||||
#define WITH_DEBUG_OUT
|
||||
//#define WITH_DEBUG_OUT
|
||||
|
||||
#if defined WITH_DEBUG_OUT
|
||||
# include <stdio.h>
|
||||
|
||||
@@ -75,9 +75,7 @@ struct Config
|
||||
|
||||
string resPath(ivector::const_iterator it) const
|
||||
{
|
||||
char s[65];
|
||||
sprintf(s, "%d", *it);
|
||||
return std::string(cascadeName) + s + ".xml";
|
||||
return cv::format("%s%d.xml",cascadeName.c_str(), *it);
|
||||
}
|
||||
|
||||
// Paths to a rescaled data
|
||||
|
||||
@@ -44,10 +44,6 @@
|
||||
#define __SFT_OCTAVE_HPP__
|
||||
|
||||
#include <sft/common.hpp>
|
||||
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/softcascade/softcascade.hpp>
|
||||
namespace sft
|
||||
{
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@
|
||||
|
||||
#include <sft/common.hpp>
|
||||
#include <iostream>
|
||||
#include <sft/fpool.hpp>
|
||||
#include <sft/dataset.hpp>
|
||||
#include <sft/config.hpp>
|
||||
|
||||
#include <opencv2/core/core_c.h>
|
||||
|
||||
Reference in New Issue
Block a user