tkDNN works with trt8!!,need to test int8 and mobilenet,dla_cnet (fps seems to be a bit low 350 on trt8 compared to 396 on trt7)

This commit is contained in:
perseusdg
2021-09-07 22:00:28 +05:30
parent 9fa116ce4a
commit 03473743c4
30 changed files with 43 additions and 16 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
namespace tk { namespace dnn {
bool CenternetDetection::init(const std::string& tensor_path, const int n_classes, const int n_batches, const float conf_thresh){
bool CenternetDetection::init(const std::string& tensor_path, const std::string& cfg_path,const std::string& name_path,const int n_classes, const int n_batches, const float conf_thresh){
std::cout<<(tensor_path).c_str()<<"\n";
netRT = new tk::dnn::NetworkRT(NULL, (tensor_path).c_str() );
classes = n_classes;
+1 -1
View File
@@ -126,7 +126,7 @@ float MobilenetDetection::iou(const tk::dnn::box &a, const tk::dnn::box &b){
return iou;
}
bool MobilenetDetection::init(const std::string& tensor_path, const int n_classes, const int n_batches, const float conf_thresh){
bool MobilenetDetection::init(const std::string& tensor_path, const std::string& cfg_path,const std::string& name_path,const int n_classes, const int n_batches, const float conf_thresh){
std::cout<<(tensor_path).c_str()<<"\n";
netRT = new tk::dnn::NetworkRT(NULL, (tensor_path).c_str());
imageSize = netRT->input_dim.h;
+1 -1
View File
@@ -657,8 +657,8 @@ bool NetworkRT::deserialize(const char *filename) {
void NetworkRT::destroy() {
contextRT->destroy();
configRT->destroy();
engineRT->destroy();
configRT->destroy();
builderRT->destroy();
}
+1 -1
View File
@@ -29,7 +29,7 @@ namespace tk { namespace dnn {
for(int i=0; i<noYolos.size(); i++) {
std::vector<float> maskTemp,anchorsTemp;
std::vector<std::string> classNamesTemp;
int classes,nms_kind,coords,numTemp;
int nms_kind,coords,numTemp;
float nmsthresh;
loadYoloInfo(cfg_path,yolosLine[i],maskTemp,anchorsTemp,numTemp,classes,nmsthresh,nms_kind,coords);
classNamesTemp = darknetReadNames(name_path);