Fix dependencies problems
Signed-off-by: Micaela Verucchi <micaelaverucchi@gmail.com>
This commit is contained in:
@@ -3,12 +3,7 @@
|
||||
#include <stdlib.h> /* srand, rand */
|
||||
#include <unistd.h>
|
||||
#include <mutex>
|
||||
#include "utils.h"
|
||||
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/videoio.hpp>
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
|
||||
#include "MobilenetDetection.h"
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#ifndef SORTING_H
|
||||
#define SORTING_H
|
||||
|
||||
#include <thrust/sort.h>
|
||||
#include <thrust/execution_policy.h>
|
||||
#include <thrust/functional.h>
|
||||
@@ -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*/
|
||||
@@ -2,13 +2,14 @@
|
||||
#define MOBILENETDETECTION_H
|
||||
|
||||
#include <iostream>
|
||||
#include "tkdnn.h"
|
||||
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/videoio.hpp>
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
|
||||
#include "tkdnn.h"
|
||||
|
||||
#define N_COORDS 4
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#ifndef YOLODETECTION_H
|
||||
#define YOLODETECTION_H
|
||||
|
||||
#include <iostream>
|
||||
#include <signal.h>
|
||||
#include <stdlib.h> /* srand, rand */
|
||||
@@ -66,3 +69,5 @@ class Yolo3Detection {
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif /* YOLODETECTION_H*/
|
||||
@@ -1,64 +0,0 @@
|
||||
#include<cassert>
|
||||
|
||||
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<const dnnType*>(inputs[0]);
|
||||
dnnType *dstData = reinterpret_cast<dnnType*>(outputs[0]);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
virtual size_t getSerializationSize() override {
|
||||
return 5*sizeof(int);
|
||||
}
|
||||
|
||||
virtual void serialize(void* buffer) override {
|
||||
char *buf = reinterpret_cast<char*>(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;
|
||||
};
|
||||
@@ -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<std::chrono:: microseconds>(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<std::chrono:: microseconds>(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<std::chrono:: microseconds>(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);
|
||||
}
|
||||
}}
|
||||
}}
|
||||
|
||||
#endif /*CENTERNETDETECTION_H*/
|
||||
@@ -1,10 +1,6 @@
|
||||
#include <iostream>
|
||||
#include "tkdnn.h"
|
||||
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/videoio.hpp>
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
|
||||
const char *output_bin1 = "../tests/mobilenetv2ssd/debug/classification_headers-5.bin";
|
||||
const char *output_bin2 = "../tests/mobilenetv2ssd/debug/regression_headers-5.bin";
|
||||
|
||||
Reference in New Issue
Block a user