48 #ifndef GIE_INFERENCE_H_
49 #define GIE_INFERENCE_H_
54 #include "NvCaffeParser.h"
55 #include "opencv2/video/tracking.hpp"
56 #include "opencv2/imgproc/imgproc.hpp"
57 #include "opencv2/highgui/highgui.hpp"
58 #include <opencv2/objdetect/objdetect.hpp>
59 using namespace nvinfer1;
60 using namespace nvcaffeparser1;
64 #define GOOGLENET_SINGLE_CLASS 0
65 #define GOOGLENET_THREE_CLASS 1
66 #define HELNET_THREE_CLASS 2
100 {-640, -368, 640, 368}
106 {0.8, 0xffff, 0xffff},
112 {-640, -480, 640, 480}
124 int getNetWidth()
const;
126 int getNetHeight()
const;
128 int getBatchSize()
const;
130 int getChannel()
const;
132 int getModelClassCnt()
const;
136 void*& getBuffer(
const int& index);
138 float*& getInputBuf();
140 int getNumGieInstances()
const;
142 void setForcedFp32(
const bool& forced_fp32);
144 void setDumpResult(
const bool& dump_result);
146 void setGieProfilerEnabled(
const bool& enable_gie_profiler);
148 int getFilterNum()
const;
149 void setFilterNum(
const unsigned int& filter_num);
153 void setModelIndex(
int modelIndex);
155 void buildGieContext(
const string& deployfile,
156 const string& modelfile,
bool bUseCPUBuf =
false);
159 queue< vector<cv::Rect> >* rectList_queue,
160 float *input = NULL);
162 void destroyGieContext(
bool bUseCPUBuf =
false);
172 float *output_cov_buf;
173 float *output_bbox_buf;
174 float helnet_scale[4];
177 IExecutionContext *context;
178 uint32_t *pResultArray;
186 bool enable_gie_profiler;
187 stringstream gieModelStream;
188 vector<string> outputs;
193 uint64_t elapsed_frame_num;
194 uint64_t elapsed_time;
200 Dims3 outputDimsBBOX;
203 size_t outputSizeBBOX;
205 int parseNet(
const string& deployfile);
206 void parseBbox(vector<cv::Rect>* rectList,
int batch_th);
207 void allocateMemory(
bool bUseCPUBuf);
208 void releaseMemory(
bool bUseCPUBuf);
209 void caffeToGIEModel(
const string& deployfile,
const string& modelfile);
float bbox_output_scales[4]
struct @0 gModelNetAttr[3]
const char * OUTPUT_BBOX_NAME
const char * OUTPUT_BLOB_NAME
const char * INPUT_BLOB_NAME
struct @0 * g_pModelNetAttr