Skip to content

Commit 14906b2

Browse files
committed
fix register plugin and cmp
1 parent 21d2bc1 commit 14906b2

File tree

15 files changed

+15
-23
lines changed

15 files changed

+15
-23
lines changed

yolov3-spp/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Ofast -Wfatal-errors -
2828

2929
#cuda_add_library(leaky ${PROJECT_SOURCE_DIR}/leaky.cu)
3030
cuda_add_library(yololayer SHARED ${PROJECT_SOURCE_DIR}/yololayer.cu)
31+
target_link_libraries(yololayer nvinfer cudart)
3132

3233
find_package(OpenCV)
3334
include_directories(OpenCV_INCLUDE_DIRS)

yolov3-spp/yololayer.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,7 @@ namespace nvinfer1
151151
static PluginFieldCollection mFC;
152152
static std::vector<PluginField> mPluginAttributes;
153153
};
154-
155-
156-
154+
REGISTER_TENSORRT_PLUGIN(YoloPluginCreator);
157155
};
158156

159157
#endif

yolov3-spp/yolov3-spp.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ static const int OUTPUT_SIZE = 1000 * 7 + 1; // we assume the yololayer outputs
3737
const char* INPUT_BLOB_NAME = "data";
3838
const char* OUTPUT_BLOB_NAME = "prob";
3939
static Logger gLogger;
40-
REGISTER_TENSORRT_PLUGIN(YoloPluginCreator);
4140

4241
cv::Mat preprocess_img(cv::Mat& img) {
4342
int w, h, x, y;
@@ -102,7 +101,7 @@ float iou(float lbox[4], float rbox[4]) {
102101
return interBoxS/(lbox[2]*lbox[3] + rbox[2]*rbox[3] -interBoxS);
103102
}
104103

105-
bool cmp(Yolo::Detection& a, Yolo::Detection& b) {
104+
bool cmp(const Yolo::Detection& a, const Yolo::Detection& b) {
106105
return a.det_confidence > b.det_confidence;
107106
}
108107

yolov3-tiny/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Ofast -Wfatal-errors -
2828

2929
#cuda_add_library(leaky ${PROJECT_SOURCE_DIR}/leaky.cu)
3030
cuda_add_library(yololayer SHARED ${PROJECT_SOURCE_DIR}/yololayer.cu)
31+
target_link_libraries(yololayer nvinfer cudart)
3132

3233
find_package(OpenCV)
3334
include_directories(OpenCV_INCLUDE_DIRS)

yolov3-tiny/yololayer.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,7 @@ namespace nvinfer1
142142
static PluginFieldCollection mFC;
143143
static std::vector<PluginField> mPluginAttributes;
144144
};
145-
146-
147-
145+
REGISTER_TENSORRT_PLUGIN(YoloPluginCreator);
148146
};
149147

150148
#endif

yolov3-tiny/yolov3-tiny.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ static const int OUTPUT_SIZE = 1000 * 7 + 1; // we assume the yololayer outputs
3636
const char* INPUT_BLOB_NAME = "data";
3737
const char* OUTPUT_BLOB_NAME = "prob";
3838
static Logger gLogger;
39-
REGISTER_TENSORRT_PLUGIN(YoloPluginCreator);
4039

4140
cv::Mat preprocess_img(cv::Mat& img) {
4241
int w, h, x, y;
@@ -101,7 +100,7 @@ float iou(float lbox[4], float rbox[4]) {
101100
return interBoxS/(lbox[2]*lbox[3] + rbox[2]*rbox[3] -interBoxS);
102101
}
103102

104-
bool cmp(Yolo::Detection& a, Yolo::Detection& b) {
103+
bool cmp(const Yolo::Detection& a, const Yolo::Detection& b) {
105104
return a.det_confidence > b.det_confidence;
106105
}
107106

yolov3/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Ofast -Wfatal-errors -
2828

2929
#cuda_add_library(leaky ${PROJECT_SOURCE_DIR}/leaky.cu)
3030
cuda_add_library(yololayer SHARED ${PROJECT_SOURCE_DIR}/yololayer.cu)
31+
target_link_libraries(yololayer nvinfer cudart)
3132

3233
find_package(OpenCV)
3334
include_directories(OpenCV_INCLUDE_DIRS)

yolov3/yololayer.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,7 @@ namespace nvinfer1
151151
static PluginFieldCollection mFC;
152152
static std::vector<PluginField> mPluginAttributes;
153153
};
154-
155-
156-
154+
REGISTER_TENSORRT_PLUGIN(YoloPluginCreator);
157155
};
158156

159157
#endif

yolov3/yolov3.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ static const int OUTPUT_SIZE = 1000 * 7 + 1; // we assume the yololayer outputs
3737
const char* INPUT_BLOB_NAME = "data";
3838
const char* OUTPUT_BLOB_NAME = "prob";
3939
static Logger gLogger;
40-
REGISTER_TENSORRT_PLUGIN(YoloPluginCreator);
4140

4241
cv::Mat preprocess_img(cv::Mat& img) {
4342
int w, h, x, y;
@@ -102,7 +101,7 @@ float iou(float lbox[4], float rbox[4]) {
102101
return interBoxS/(lbox[2]*lbox[3] + rbox[2]*rbox[3] -interBoxS);
103102
}
104103

105-
bool cmp(Yolo::Detection& a, Yolo::Detection& b) {
104+
bool cmp(const Yolo::Detection& a, const Yolo::Detection& b) {
106105
return a.det_confidence > b.det_confidence;
107106
}
108107

yolov4/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ endif()
2727
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Ofast -Wfatal-errors -D_MWAITXINTRIN_H_INCLUDED")
2828

2929
cuda_add_library(myplugins SHARED ${PROJECT_SOURCE_DIR}/yololayer.cu ${PROJECT_SOURCE_DIR}/mish.cu)
30+
target_link_libraries(myplugins nvinfer cudart)
3031

3132
find_package(OpenCV)
3233
include_directories(OpenCV_INCLUDE_DIRS)

0 commit comments

Comments
 (0)