diff --git a/demo/demo/demo_mobilenet.cpp b/demo/demo/demo_mobilenet.cpp index 1c4099a..f46df39 100644 --- a/demo/demo/demo_mobilenet.cpp +++ b/demo/demo/demo_mobilenet.cpp @@ -3,12 +3,7 @@ #include /* srand, rand */ #include #include -#include "utils.h" -#include -#include -#include -#include #include "MobilenetDetection.h" diff --git a/include/sorting.h b/include/sorting.h index 7e90f11..5153f3c 100644 --- a/include/sorting.h +++ b/include/sorting.h @@ -1,3 +1,6 @@ +#ifndef SORTING_H +#define SORTING_H + #include #include #include @@ -32,3 +35,5 @@ void topKxyAddOffset(int * ids_begin, const int K, const int size, int *intxs_be float *xs_begin, float *ys_begin, dnnType *src_begin, float *src_out, int *ids_out); void bboxes(int * ids_begin, const int K, const int size, float *xs_begin, float *ys_begin, dnnType *src_begin, float *bbx0, float *bbx1, float *bby0, float *bby1, float *src_out, int *ids_out); + +#endif /*SORTING_H*/ \ No newline at end of file diff --git a/include/tkDNN/MobilenetDetection.h b/include/tkDNN/MobilenetDetection.h index 6bfd1b2..840a2cc 100644 --- a/include/tkDNN/MobilenetDetection.h +++ b/include/tkDNN/MobilenetDetection.h @@ -2,13 +2,14 @@ #define MOBILENETDETECTION_H #include -#include "tkdnn.h" #include #include #include #include +#include "tkdnn.h" + #define N_COORDS 4 diff --git a/include/tkDNN/Yolo3Detection.h b/include/tkDNN/Yolo3Detection.h index ac12a4f..72ea3f8 100644 --- a/include/tkDNN/Yolo3Detection.h +++ b/include/tkDNN/Yolo3Detection.h @@ -1,3 +1,6 @@ +#ifndef YOLODETECTION_H +#define YOLODETECTION_H + #include #include #include /* srand, rand */ @@ -66,3 +69,5 @@ class Yolo3Detection { }; }} + +#endif /* YOLODETECTION_H*/ \ No newline at end of file diff --git a/include/tkDNN/pluginsRT/SoftmaxRT.h b/include/tkDNN/pluginsRT/SoftmaxRT.h deleted file mode 100644 index 226f6f6..0000000 --- a/include/tkDNN/pluginsRT/SoftmaxRT.h +++ /dev/null @@ -1,64 +0,0 @@ -#include - -class SoftmaxRT : public IPlugin { - -public: - SoftmaxRT(const tk::dnn::dataDim_t* dim) { - assert(dim != nullptr); - this->dim.n = dim->n; - this->dim.c = dim->c; - this->dim.h = dim->h; - this->dim.w = dim->w; - this->dim.l = dim->l; - } - - ~SoftmaxRT(){ - - } - - int getNbOutputs() const override { - return 1; - } - - Dims getOutputDimensions(int index, const Dims* inputs, int nbInputDims) override { - return DimsNCHW{this->dim.n,this->dim.c,this->dim.h,this->dim.w }; - } - - void configure(const Dims* inputDims, int nbInputs, const Dims* outputDims, int nbOutputs, int maxBatchSize) override { - } - - int initialize() override { - return 0; - } - - virtual void terminate() override { - } - - virtual size_t getWorkspaceSize(int maxBatchSize) const override { - return 0; - } - - virtual int enqueue(int batchSize, const void*const * inputs, void** outputs, void* workspace, cudaStream_t stream) override { - dnnType *srcData = (dnnType*)reinterpret_cast(inputs[0]); - dnnType *dstData = reinterpret_cast(outputs[0]); - - - return 0; - } - - - virtual size_t getSerializationSize() override { - return 5*sizeof(int); - } - - virtual void serialize(void* buffer) override { - char *buf = reinterpret_cast(buffer); - tk::dnn::writeBUF(buf, this->dim.n); - tk::dnn::writeBUF(buf, this->dim.c); - tk::dnn::writeBUF(buf, this->dim.h); - tk::dnn::writeBUF(buf, this->dim.w); - tk::dnn::writeBUF(buf, this->dim.l); - } - - dataDim_t dim; -}; diff --git a/src/CenternetDetection.cpp b/src/CenternetDetection.cpp index edfe1c2..512d0e0 100644 --- a/src/CenternetDetection.cpp +++ b/src/CenternetDetection.cpp @@ -1,3 +1,6 @@ +#ifndef CENTERNETDETECTION_H +#define CENTERNETDETECTION_H + #include "CenternetDetection.h" namespace tk { namespace dnn { @@ -226,7 +229,7 @@ void CenternetDetection::update(cv::Mat &imageORIG) { sz_old = sz; cv::cuda::GpuMat im_Orig; im_Orig = cv::cuda::GpuMat(imageORIG); - // cv::cuda::resize (im_Orig, imageF1_d, cv::Size(new_width, new_height)); + cv::cuda::resize (im_Orig, imageF1_d, cv::Size(new_width, new_height)); checkCuda( cudaDeviceSynchronize() ); sz = imageF1_d.size(); @@ -235,7 +238,7 @@ void CenternetDetection::update(cv::Mat &imageORIG) { std::cout << " TIME resize: " << std::chrono::duration_cast(end_t - step_t).count() << " us" << std::endl; step_t = end_t; - // cv::cuda::warpAffine(imageF1_d, imageF2_d, trans, cv::Size(inp_width, inp_height), cv::INTER_LINEAR ); + cv::cuda::warpAffine(imageF1_d, imageF2_d, trans, cv::Size(inp_width, inp_height), cv::INTER_LINEAR ); checkCuda( cudaDeviceSynchronize() ); end_t = std::chrono::steady_clock::now(); std::cout << " TIME warpAffine: " << std::chrono::duration_cast(end_t - step_t).count() << " us" << std::endl; @@ -248,7 +251,7 @@ void CenternetDetection::update(cv::Mat &imageORIG) { step_t = end_t; dim2 = dim; - // cv::cuda::split(imageF1_d,bgr);//split source + cv::cuda::split(imageF1_d,bgr);//split source end_t = std::chrono::steady_clock::now(); std::cout << " TIME split: " << std::chrono::duration_cast(end_t - step_t).count() << " us" << std::endl; step_t = end_t; @@ -413,4 +416,6 @@ void CenternetDetection::update(cv::Mat &imageORIG) { TIMER_STOP stats.push_back(t_ns); } -}} \ No newline at end of file +}} + +#endif /*CENTERNETDETECTION_H*/ \ No newline at end of file diff --git a/tests/mobilenetv2ssd/mobilenetv2ssd.cpp b/tests/mobilenetv2ssd/mobilenetv2ssd.cpp index f2ec51b..cec97e2 100644 --- a/tests/mobilenetv2ssd/mobilenetv2ssd.cpp +++ b/tests/mobilenetv2ssd/mobilenetv2ssd.cpp @@ -1,10 +1,6 @@ #include #include "tkdnn.h" -#include -#include -#include -#include const char *output_bin1 = "../tests/mobilenetv2ssd/debug/classification_headers-5.bin"; const char *output_bin2 = "../tests/mobilenetv2ssd/debug/regression_headers-5.bin";