mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 07:16:56 +08:00
Turning off compilation for GPU detector by default.
Compiler flag can be used to re-enable it
This commit is contained in:
@@ -35,6 +35,7 @@ override_dh_auto_configure:
|
||||
dh_auto_configure -- \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DCMAKE_INSTALL_SYSCONFDIR=/etc \
|
||||
-DCOMPILE_GPU=1 \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=OFF \
|
||||
-DCMAKE_COLOR_MAKEFILE=ON
|
||||
|
||||
|
@@ -57,5 +57,8 @@ install (FILES alpr.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
|
||||
install (TARGETS openalpr-static DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
|
||||
install (TARGETS openalpr DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
|
||||
|
||||
# Compile GPU detector
|
||||
#add_definitions(-DCOMPILE_GPU=1)
|
||||
|
||||
# Add definition for default config file
|
||||
add_definitions(-DDEFAULT_CONFIG_FILE="${CMAKE_INSTALL_SYSCONFDIR}/openalpr/openalpr.conf")
|
||||
|
@@ -31,6 +31,10 @@
|
||||
#define DEFAULT_CONFIG_FILE "/etc/openalpr/openalpr.conf"
|
||||
#endif
|
||||
|
||||
#ifndef COMPILE_GPU
|
||||
#define COMPILE_GPU 0
|
||||
#endif
|
||||
|
||||
#define ENV_VARIABLE_CONFIG_FILE "OPENALPR_CONFIG_FILE"
|
||||
|
||||
#endif // OPENALPR_CONSTANTS_H
|
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "detectorcuda.h"
|
||||
|
||||
#if COMPILE_GPU
|
||||
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
@@ -138,3 +139,5 @@ namespace alpr
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@@ -20,6 +20,8 @@
|
||||
#ifndef OPENALPR_DETECTORCUDA_H
|
||||
#define OPENALPR_DETECTORCUDA_H
|
||||
|
||||
#if COMPILE_GPU
|
||||
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
@@ -51,5 +53,7 @@ namespace alpr
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* OPENALPR_DETECTORCUDA_H */
|
||||
|
||||
|
@@ -11,7 +11,13 @@ namespace alpr
|
||||
}
|
||||
else if (config->gpu_mode == 1)
|
||||
{
|
||||
#if COMPILE_GPU
|
||||
return new DetectorCUDA(config);
|
||||
#else
|
||||
std::cerr << "Error: GPU detector requested, but GPU extensions are not compiled. " <<
|
||||
"Add COMPILE_GPU=1 to the compiler definitions to enable GPU compilation." <<
|
||||
std::endl;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user