Commit d024aaf5 authored by oscar's avatar oscar

提交测试

parent 14b44c60
......@@ -11,6 +11,7 @@
#include "Iou.h"
#include "LogBase.h"
#include <memory.h>
#include "Component.h"
#ifdef _KF_IOU_CUDA_
#include "bev_overlap_online.h"
#include "kalman_update_batch_online.h"
......@@ -215,6 +216,10 @@ void BaseTracker<T>::AssociateDetectionsToTrackers(const std::vector<std::vector
tracker_ptr.get()[i * tra_size + j] = tracker_states[i][j];
}
}
std::string dete_str = GetMatrixStr(detect_ptr.get(), measure_size, detections.size());
std::string track_str = GetMatrixStr(tracker_ptr.get(), tra_size, tracker_states.size());
SDK_LOG(SDK_INFO, "detections = [%s]",dete_str.c_str());
SDK_LOG(SDK_INFO, "tracker_states = [%s]", track_str.c_str());
#ifdef _KF_IOU_CUDA_
bev_overlap(detections.size(), detect_ptr.get(), tracker_states.size(), tracker_ptr.get(), iou_ptr.get());
#endif
......@@ -227,16 +232,7 @@ void BaseTracker<T>::AssociateDetectionsToTrackers(const std::vector<std::vector
}
// Find association
std::string str;
for (int i = 0; i < detections.size(); i++)
{
for (int j = 0; j < tracks.size(); j++)
{
char log[128] = {};
sprintf(log, "%f,", iou_matrix[i][j]);
str += log;
}
}
std::string str = GetMatrixStr(iou_matrix, detections.size(), tracks.size());
SDK_LOG(SDK_INFO, "iou_matrix = [%s]",str.c_str());
HungarianMatching(iou_matrix, detections.size(), tracks.size(), association);
......
......@@ -10,4 +10,34 @@ uint64_t GetCurTime()
uint64_t seconds = time.tv_sec;
uint64_t ttt = seconds * 1000 * 1000 + time.tv_usec;
return ttt;
}
\ No newline at end of file
}
std::string GetMatrixStr(float* data_ptr, int col, int row)
{
std::string str;
for (int i = 0; i < row; i++)
{
for (int j = 0; j < col; j++)
{
char log[128] = {};
sprintf(log, "%f,", data_ptr[i][j]);
str += log;
}
}
return str;
}
std::string GetMatrixStr(std::vector<std::vector<float>>& data_ptr, int col, int row)
{
std::string str;
for (int i = 0; i < row; i++)
{
for (int j = 0; j < col; j++)
{
char log[128] = {};
sprintf(log, "%f,", data_ptr[i][j]);
str += log;
}
}
return str;
}
#pragma once
#include <string>
#include <vector>
uint64_t GetCurTime();
std::string GetMatrixStr(float* data_ptr, int col, int row);
std::string GetMatrixStr(std::vector<std::vector<float>>& data_ptr, int col, int row);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment