yolo3 flir ok
This commit is contained in:
@@ -89,6 +89,9 @@ target_link_libraries(test_yolo3_coco4 tkDNN)
|
||||
|
||||
add_executable(test_yolo3_berkeley tests/yolo3_berkeley/yolo3_berkeley.cpp)
|
||||
target_link_libraries(test_yolo3_berkeley tkDNN)
|
||||
|
||||
add_executable(test_yolo3_flir tests/yolo3_flir/yolo3_flir.cpp)
|
||||
target_link_libraries(test_yolo3_flir tkDNN)
|
||||
################################################################################
|
||||
|
||||
|
||||
|
||||
+3
-1
@@ -12,7 +12,9 @@
|
||||
#include "Yolo3Detection.h"
|
||||
|
||||
bool gRun;
|
||||
std::string obj_class[10] {"person", "car", "truck", "bus", "motor", "bike", "rider", "traffic light", "traffic sign", "train"};
|
||||
//std::string obj_class[10] {"person", "car", "truck", "bus", "motor", "bike", "rider", "traffic light", "traffic sign", "train"};
|
||||
//std::string obj_class[3] {"person", "bike", "car"};
|
||||
std::string obj_class[10] {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
|
||||
|
||||
|
||||
void sig_handler(int signo) {
|
||||
|
||||
@@ -68,18 +68,19 @@ void Yolo3Detection::update(cv::Mat &imageORIG) {
|
||||
float yRatio = float(imageORIG.rows) / float(netRT->input_dim.h);
|
||||
|
||||
resize(imageORIG, imageORIG, cv::Size(netRT->input_dim.w, netRT->input_dim.h));
|
||||
|
||||
imageORIG.convertTo(imageF, CV_32FC3, 1/255.0);
|
||||
|
||||
//split channels
|
||||
cv::split(imageF,bgr);//split source
|
||||
|
||||
//write channels
|
||||
int idx = 0;
|
||||
memcpy((void*)&input[idx], (void*)bgr[2].data, imageF.rows*imageF.cols*sizeof(dnnType));
|
||||
idx = imageF.rows*imageF.cols;
|
||||
memcpy((void*)&input[idx], (void*)bgr[1].data, imageF.rows*imageF.cols*sizeof(dnnType));
|
||||
idx *= 2;
|
||||
memcpy((void*)&input[idx], (void*)bgr[0].data, imageF.rows*imageF.cols*sizeof(dnnType));
|
||||
for(int i=0; i<netRT->input_dim.c; i++) {
|
||||
int idx = i*imageF.rows*imageF.cols;
|
||||
int ch = netRT->input_dim.c-1 -i;
|
||||
memcpy((void*)&input[idx], (void*)bgr[ch].data, imageF.rows*imageF.cols*sizeof(dnnType));
|
||||
}
|
||||
|
||||
|
||||
//DO INFERENCE
|
||||
dnnType *rt_out[3];
|
||||
|
||||
@@ -17,7 +17,7 @@ hue=.1
|
||||
|
||||
learning_rate=0.001
|
||||
burn_in=1000
|
||||
max_batches = 10000
|
||||
max_batches = 20000
|
||||
policy=steps
|
||||
steps=8000,9000
|
||||
scales=.1,.1
|
||||
@@ -602,13 +602,13 @@ activation=leaky
|
||||
size=1
|
||||
stride=1
|
||||
pad=1
|
||||
filters=30
|
||||
filters=24
|
||||
activation=linear
|
||||
|
||||
[yolo]
|
||||
mask = 6,7,8
|
||||
anchors = 8.2087,8.5515, 18.4134,20.3391, 40.2194,29.2990, 31.6137,69.2240, 69.8497,48.3838, 108.8817,76.6316, 96.5753,145.5743, 165.9182,117.4493, 215.7497,198.4648
|
||||
classes=5
|
||||
classes=3
|
||||
num=9
|
||||
jitter=.3
|
||||
ignore_thresh = .5
|
||||
@@ -686,13 +686,13 @@ activation=leaky
|
||||
size=1
|
||||
stride=1
|
||||
pad=1
|
||||
filters=30
|
||||
filters=24
|
||||
activation=linear
|
||||
|
||||
[yolo]
|
||||
mask = 3,4,5
|
||||
anchors = 8.2087,8.5515, 18.4134,20.3391, 40.2194,29.2990, 31.6137,69.2240, 69.8497,48.3838, 108.8817,76.6316, 96.5753,145.5743, 165.9182,117.4493, 215.7497,198.4648
|
||||
classes=5
|
||||
classes=3
|
||||
num=9
|
||||
jitter=.3
|
||||
ignore_thresh = .5
|
||||
@@ -770,13 +770,13 @@ activation=leaky
|
||||
size=1
|
||||
stride=1
|
||||
pad=1
|
||||
filters=30
|
||||
filters=24
|
||||
activation=linear
|
||||
|
||||
[yolo]
|
||||
mask = 0,1,2
|
||||
anchors = 8.2087,8.5515, 18.4134,20.3391, 40.2194,29.2990, 31.6137,69.2240, 69.8497,48.3838, 108.8817,76.6316, 96.5753,145.5743, 165.9182,117.4493, 215.7497,198.4648
|
||||
classes=5
|
||||
classes=3
|
||||
num=9
|
||||
jitter=.3
|
||||
ignore_thresh = .5
|
||||
|
||||
@@ -11,7 +11,7 @@ int main() {
|
||||
|
||||
// create yolo3 model
|
||||
std::string bin_path = "../tests/yolo3_flir";
|
||||
int classes = 5;
|
||||
int classes = 3;
|
||||
tk::dnn::Yolo *yolo [3];
|
||||
#include "models/Yolo3.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user