派生自 Algorithm/baseDetector

Scheaven
2021-08-11 8e10c57c7e053d8789747cf1e2c5fa78f2f65cc7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//
// Created by Scheaven on 2020/3/24.
//
 
#ifndef INC_01_CPP_SORT_CONFIG_H
#define INC_01_CPP_SORT_CONFIG_H
#include "utils/time_util.h"
 
#include <opencv2/opencv.hpp>
#include <algorithm>
#include <assert.h>
#include <cmath>
#include <fstream>
#include <iomanip>
#include <sstream>
#include <sys/stat.h>
#include <time.h>
#include <cstdlib>
#include <iostream>
#include <string>
#include "argsParser.h"
#include "buffers.h"
#include "common.h"
// #include "parserOnnxConfig.h"
 
#include <map>
#include <chrono>
#include "logging.h"
#include "cuda_runtime_api.h"
#include "NvInfer.h"
 
const int nn_budget=100;
const float max_cosine_distance=0.7;
 
#define NN_BUDGET 100
#define MAX_COSINE_DISTANCE 0.7
#define MAX_IOU_DISTANCE 0.9
#define MAX_AGE 450
#define MAX_OUT_TIME 30.0
#define N_INIT 5
 
struct bbox_t {
    unsigned int x, y, w, h;       // (x,y) - top-left corner, (w, h) - width & height of bounded box
    float prob;                    // confidence - probability that the object was found correctly
    unsigned int obj_id;           // class of object - from range [0, classes-1]
    unsigned int track_id;         // tracking id for video (0 - untracked, 1 - inf - tracked object)
    unsigned int frames_counter;   // counter of frames on which the object was detected
    float x_3d, y_3d, z_3d;        // center of object (in Meters) if ZED 3D Camera is used
};
 
typedef struct m_staticStruct
{
    static std::string model_path;
    static int type;
    static bool isTrack;
    static int max_cam_num;
    static int wander_time;
    static float mv_velocity;
    static float fall_rate;
}M_STATICSTRUCT, *P_STATICSTRUCT;
#endif //INC_01_CPP_SORT_CONFIG_H
 
#define CLASS_BUM 9