minor fixes for windows ,for release v0.6

This commit is contained in:
perseusdg
2021-07-24 08:51:44 -07:00
parent e58ddadb7d
commit 1412aa66c4
7 changed files with 31 additions and 13 deletions
+2
View File
@@ -1,7 +1,9 @@
#include <iostream>
#include <signal.h>
#include <stdlib.h> /* srand, rand */
#ifdef __linux__
#include <unistd.h>
#endif
#include <mutex>
#include "SegmentationNN.h"
+5
View File
@@ -13,6 +13,11 @@
#include "TrackingNN.h"
#ifdef _WIN32
#define _USE_MATH_DEFINES
#include <math.h>
#endif
#include "kernelsThrust.h"
+5
View File
@@ -9,6 +9,11 @@
#include <numeric> // std::iota
#include <algorithm> // std::sort
#ifdef _WIN32
#define _USE_MATH_DEFINES
#include <math.h>
#endif
#include "DetectionNN3D.h"
#include "kernelsThrust.h"
+2 -2
View File
@@ -56,8 +56,8 @@ public:
int id = 0;
bool final; //if the layer is the final one
uint n_params = 0;
uint feature_map_size = 0;
unsigned int n_params = 0;
unsigned int feature_map_size = 0;
long unsigned MACC = 0;
+2
View File
@@ -4,7 +4,9 @@
#include <iostream>
#include <signal.h>
#include <stdlib.h>
#ifdef __linux__
#include <unistd.h>
#endif
#include <mutex>
#include "utils.h"
+2 -1
View File
@@ -9,12 +9,13 @@
#ifdef __linux__
#include <unistd.h>
#endif
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <yaml-cpp/yaml.h>
#endif
void readCalibrationMatrix(const std::string& path, cv::Mat& calib_mat);
+13 -10
View File
@@ -17,6 +17,7 @@ bool CenterTrack::init(const std::string& tensor_path, const int n_classes, cons
init_pre_inf();
init_postprocessing();
init_visualization(n_classes);
return true;
}
bool CenterTrack::init_preprocessing(){
@@ -274,6 +275,8 @@ bool CenterTrack::init_visualization(const int n_classes){
faceId.push_back({3,0,4,7});
faceId.push_back({2,3,7,6});
// ([[0,1,5,4], [1,2,6, 5], [2,3,7,6], [3,0,4,7]]);
return true;
}
void CenterTrack::_get_additional_inputs(){
@@ -413,9 +416,9 @@ cv::Mat CenterTrack::transform_preds_with_trans(float x1, float x2){
}
void CenterTrack::tracking(const int bi) {
float item_size[countDet];
int item_cl[countDet];
float dets[2*countDet];
std::vector<float> item_size(countDet);
std::vector<int> item_cl(countDet);
std::vector<float> dets(2*countDet);
for(int i=0; i<countDet; i++){
item_size[i] = (detRes[i].bb1.at<float>(0,0) - detRes[i].bb0.at<float>(0,0)) *
(detRes[i].bb1.at<float>(0,1) - detRes[i].bb0.at<float>(0,1));
@@ -424,9 +427,9 @@ void CenterTrack::tracking(const int bi) {
dets[i*2+1] = detRes[i].ct.at<float>(0,1);
}
float track_size[countTr[bi]];
int track_cl[countTr[bi]];
float tracks[2*countTr[bi]];
std::vector<float> track_size(countTr[bi]);
std::vector<int> track_cl(countTr[bi]);
std::vector<float> tracks(2*countTr[bi]);
for(int i=0; i<countTr[bi]; i++){
track_size[i] = (trRes[bi][i].det_res.bb1.at<float>(0,0) - trRes[bi][i].det_res.bb0.at<float>(0,0)) *
(trRes[bi][i].det_res.bb1.at<float>(0,1) - trRes[bi][i].det_res.bb0.at<float>(0,1));
@@ -434,7 +437,7 @@ void CenterTrack::tracking(const int bi) {
tracks[i*2] = trRes[bi][i].det_res.ct.at<float>(0,0);
tracks[i*2+1] = trRes[bi][i].det_res.ct.at<float>(0,1);
}
float dist[countTr[bi]*countDet];
std::vector<float> dist(countTr[bi]*countDet);
bool invalid;
for(int i=0; i<countTr[bi]; i++){
for(int j=0; j<countDet; j++){
@@ -446,7 +449,7 @@ void CenterTrack::tracking(const int bi) {
dist[j*countTr[bi]+i] = dist[j*countTr[bi]+i] + invalid * (1 << 18);
}
}
int matched_indices[2*countTr[bi]];
std::vector<int> matched_indices(2*countTr[bi]);
float min_tr;
int min_idtr = -1;
for(int i=0; i<countTr[bi]; i++) {
@@ -469,10 +472,10 @@ void CenterTrack::tracking(const int bi) {
}
}
bool unmatched_dets[countDet];
std::vector<bool> unmatched_dets(countDet);
for(int i=0; i<countDet; i++)
unmatched_dets[i] = false;
bool unmatched_tracks[countTr[bi]];
std::vector<bool> unmatched_tracks(countTr[bi]);
for(int i=0; i<countTr[bi]; i++)
unmatched_tracks[i] = false;
for(int i=0; i<countTr[bi]; i++) {