mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 07:16:56 +08:00
Fixed GPU compile flag
This commit is contained in:
@@ -31,10 +31,6 @@
|
|||||||
#define DEFAULT_CONFIG_FILE "/etc/openalpr/openalpr.conf"
|
#define DEFAULT_CONFIG_FILE "/etc/openalpr/openalpr.conf"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef COMPILE_GPU
|
|
||||||
#define COMPILE_GPU 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define ENV_VARIABLE_CONFIG_FILE "OPENALPR_CONFIG_FILE"
|
#define ENV_VARIABLE_CONFIG_FILE "OPENALPR_CONFIG_FILE"
|
||||||
|
|
||||||
#endif // OPENALPR_CONSTANTS_H
|
#endif // OPENALPR_CONSTANTS_H
|
@@ -17,14 +17,14 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "detectorcuda.h"
|
#include "detectorcuda.h"
|
||||||
|
|
||||||
#if COMPILE_GPU
|
|
||||||
|
|
||||||
using namespace cv;
|
using namespace cv;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
#ifdef COMPILE_GPU
|
||||||
|
|
||||||
namespace alpr
|
namespace alpr
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@@ -20,7 +20,6 @@
|
|||||||
#ifndef OPENALPR_DETECTORCUDA_H
|
#ifndef OPENALPR_DETECTORCUDA_H
|
||||||
#define OPENALPR_DETECTORCUDA_H
|
#define OPENALPR_DETECTORCUDA_H
|
||||||
|
|
||||||
#if COMPILE_GPU
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@@ -33,6 +32,10 @@
|
|||||||
#include "opencv2/gpu/gpu.hpp"
|
#include "opencv2/gpu/gpu.hpp"
|
||||||
|
|
||||||
#include "detector.h"
|
#include "detector.h"
|
||||||
|
#include "detectorcpu.h"
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef COMPILE_GPU
|
||||||
|
|
||||||
namespace alpr
|
namespace alpr
|
||||||
{
|
{
|
||||||
|
@@ -11,12 +11,13 @@ namespace alpr
|
|||||||
}
|
}
|
||||||
else if (config->gpu_mode == 1)
|
else if (config->gpu_mode == 1)
|
||||||
{
|
{
|
||||||
#if COMPILE_GPU
|
#ifdef COMPILE_GPU
|
||||||
return new DetectorCUDA(config);
|
return new DetectorCUDA(config);
|
||||||
#else
|
#else
|
||||||
std::cerr << "Error: GPU detector requested, but GPU extensions are not compiled. " <<
|
std::cerr << "Error: GPU detector requested, but GPU extensions are not compiled. " <<
|
||||||
"Add COMPILE_GPU=1 to the compiler definitions to enable GPU compilation." <<
|
"Add COMPILE_GPU=1 to the compiler definitions to enable GPU compilation." <<
|
||||||
std::endl;
|
std::endl;
|
||||||
|
return new DetectorCPU(config);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user