mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 05:16:51 +08:00
Using detector mode in detectorfactory
This commit is contained in:
@@ -1,15 +1,16 @@
|
|||||||
#include "detectorfactory.h"
|
#include "detectorfactory.h"
|
||||||
|
#include "detectormorph.h"
|
||||||
|
|
||||||
namespace alpr
|
namespace alpr
|
||||||
{
|
{
|
||||||
Detector* createDetector(Config* config)
|
Detector* createDetector(Config* config)
|
||||||
{
|
{
|
||||||
if (config->gpu_mode == 0)
|
if (config->detector == DETECTOR_LBP_CPU)
|
||||||
{
|
{
|
||||||
// CPU mode
|
// CPU mode
|
||||||
return new DetectorCPU(config);
|
return new DetectorCPU(config);
|
||||||
}
|
}
|
||||||
else if (config->gpu_mode == 1)
|
else if (config->detector == DETECTOR_LBP_GPU)
|
||||||
{
|
{
|
||||||
#ifdef COMPILE_GPU
|
#ifdef COMPILE_GPU
|
||||||
return new DetectorCUDA(config);
|
return new DetectorCUDA(config);
|
||||||
@@ -20,6 +21,15 @@ namespace alpr
|
|||||||
return new DetectorCPU(config);
|
return new DetectorCPU(config);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
else if (config->detector == DETECTOR_MORPH_CPU)
|
||||||
|
{
|
||||||
|
return new DetectorMorph(config);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::cerr << "Unknown detector requested. Using LBP CPU" << std::endl;
|
||||||
|
return new DetectorCPU(config);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user