From 4373f897f1a5efd1a58746c44430dc33df925415 Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Wed, 07 Feb 2018 22:07:19 +0000
Subject: [PATCH] Fixed densenet201_yolo.cfg - burn_in and poly policy, that changes learning rate

---
 src/yolo_v2_class.hpp |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/yolo_v2_class.hpp b/src/yolo_v2_class.hpp
index 57aeaf1..eaebb4e 100644
--- a/src/yolo_v2_class.hpp
+++ b/src/yolo_v2_class.hpp
@@ -59,7 +59,7 @@
 	YOLODLL_API int get_net_height() const;
 
 	YOLODLL_API std::vector<bbox_t> tracking_id(std::vector<bbox_t> cur_bbox_vec, bool const change_history = true, 
-												int const frames_story = 6, int const max_dist = 150);
+												int const frames_story = 10, int const max_dist = 150);
 
 #ifdef OPENCV
 	std::vector<bbox_t> detect(cv::Mat mat, float thresh = 0.2, bool use_mean = false)
@@ -158,7 +158,7 @@
 	const int flow_error;
 
 
-	Tracker_optflow(int _gpu_id = 0, int win_size = 9, int max_level = 3, int iterations = 2000, int _flow_error = -1) :
+	Tracker_optflow(int _gpu_id = 0, int win_size = 7, int max_level = 1, int iterations = 8000, int _flow_error = -1) :
 		gpu_count(cv::cuda::getCudaEnabledDeviceCount()), gpu_id(std::min(_gpu_id, gpu_count-1)),
 		flow_error((_flow_error > 0)? _flow_error:(win_size*4))
 	{
@@ -233,8 +233,9 @@
 
 			update_cur_bbox_vec(_cur_bbox_vec);
 
+			//src_grey_gpu.upload(src_mat, stream);	// use BGR
 			src_mat_gpu.upload(src_mat, stream);
-			cv::cuda::cvtColor(src_mat_gpu, src_grey_gpu, CV_BGR2GRAY, 0, stream);
+			cv::cuda::cvtColor(src_mat_gpu, src_grey_gpu, CV_BGR2GRAY, 1, stream);
 		}
 		if (old_gpu_id != gpu_id)
 			cv::cuda::setDevice(old_gpu_id);
@@ -257,9 +258,9 @@
 			dst_grey_gpu = cv::cuda::GpuMat(dst_mat.size(), CV_8UC1);
 		}
 
+		//dst_grey_gpu.upload(dst_mat, stream);	// use BGR
 		dst_mat_gpu.upload(dst_mat, stream);
-
-		cv::cuda::cvtColor(dst_mat_gpu, dst_grey_gpu, CV_BGR2GRAY, 0, stream);
+		cv::cuda::cvtColor(dst_mat_gpu, dst_grey_gpu, CV_BGR2GRAY, 1, stream);
 
 		if (src_grey_gpu.rows != dst_grey_gpu.rows || src_grey_gpu.cols != dst_grey_gpu.cols) {
 			stream.waitForCompletion();
@@ -295,7 +296,7 @@
 				float moved_y = cur_key_pt.y - prev_key_pt.y;
 
 				if (abs(moved_x) < 100 && abs(moved_y) < 100 && good_bbox_vec_flags[i])
-					if (!check_error || (err_cpu.at<float>(0, i) < flow_error && status_cpu.at<unsigned char>(0, i) != 0))
+					if (err_cpu.at<float>(0, i) < flow_error && status_cpu.at<unsigned char>(0, i) != 0)
 					{
 						cur_bbox_vec[i].x += moved_x + 0.5;
 						cur_bbox_vec[i].y += moved_y + 0.5;
@@ -303,6 +304,8 @@
 					}
 					else good_bbox_vec_flags[i] = false;
 				else good_bbox_vec_flags[i] = false;
+
+				//if(!check_error && !good_bbox_vec_flags[i]) result_bbox_vec.push_back(cur_bbox_vec[i]);
 			}
 		}
 

--
Gitblit v1.10.0