@@ -76,10 +76,10 @@ class DetectionNN {
|
||||
~DetectionNN(){};
|
||||
|
||||
/**
|
||||
* Method used to inialize the class, allocate memory and compute
|
||||
* Method used to initialize the class, allocate memory and compute
|
||||
* needed data.
|
||||
*
|
||||
* @param tensor_path path to the rt file og the NN.
|
||||
* @param tensor_path path to the rt file of the NN.
|
||||
* @param n_classes number of classes for the given dataset.
|
||||
* @param n_batches maximum number of batches to use in inference
|
||||
* @return true if everything is correct, false otherwise.
|
||||
@@ -141,9 +141,9 @@ class DetectionNN {
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to draw boundixg boxes and labels on a frame.
|
||||
* Method to draw bounding boxes and labels on a frame.
|
||||
*
|
||||
* @param frames orginal frame to draw bounding box on.
|
||||
* @param frames original frame to draw bounding box on.
|
||||
*/
|
||||
void draw(std::vector<cv::Mat>& frames) {
|
||||
tk::dnn::box b;
|
||||
|
||||
@@ -44,7 +44,7 @@ class ImuOdom {
|
||||
virtual ~ImuOdom() {}
|
||||
|
||||
/**
|
||||
* Method used for inizialize the class
|
||||
* Method used for initialize the class
|
||||
*
|
||||
* @return Success of the initialization
|
||||
*/
|
||||
@@ -141,7 +141,7 @@ class ImuOdom {
|
||||
//odomPOS = odomPOS + deltaP.cast<double>(); // V2
|
||||
odomROT = odomROT * q.normalized().toRotationMatrix();
|
||||
|
||||
// compute euler
|
||||
// compute Euler
|
||||
auto newEULER = odomROT.eulerAngles(0, 1, 2);
|
||||
for(int i=0; i<3; i++) {
|
||||
while( fabs(newEULER(i) - odomEULER(i)) > M_PI_2 ) {
|
||||
|
||||
+10
-10
@@ -171,7 +171,7 @@ public:
|
||||
|
||||
|
||||
/**
|
||||
Input layer (it doesnt need weigths)
|
||||
Input layer (it doesn't need weights)
|
||||
*/
|
||||
class Input : public Layer {
|
||||
|
||||
@@ -207,7 +207,7 @@ public:
|
||||
|
||||
|
||||
/**
|
||||
Avaible activation functions
|
||||
Available activation functions
|
||||
*/
|
||||
typedef enum {
|
||||
ACTIVATION_ELU = 100,
|
||||
@@ -216,7 +216,7 @@ typedef enum {
|
||||
} tkdnnActivationMode_t;
|
||||
|
||||
/**
|
||||
Activation layer (it doesnt need weigths)
|
||||
Activation layer (it doesn't need weights)
|
||||
*/
|
||||
class Activation : public Layer {
|
||||
|
||||
@@ -318,9 +318,9 @@ public:
|
||||
virtual dnnType* infer(dataDim_t &dim, dnnType* srcData);
|
||||
|
||||
const bool bidirectional = true; /**> is the net bidir */
|
||||
bool returnSeq = false; /**> if false return only the result of last timestep */
|
||||
bool returnSeq = false; /**> if false return only the result of last timestamp */
|
||||
int stateSize = 0; /**> number of hidden states */
|
||||
int seqLen = 0; /**> number of timesteps */
|
||||
int seqLen = 0; /**> number of timestamp */
|
||||
int numLayers = 1; /**> number of internal layers */
|
||||
|
||||
protected:
|
||||
@@ -367,7 +367,7 @@ public:
|
||||
|
||||
|
||||
/**
|
||||
Deformable Convolutionl 2d layer
|
||||
Deformable Convolutional 2d layer
|
||||
*/
|
||||
class DeformConv2d : public LayerWgs {
|
||||
|
||||
@@ -449,7 +449,7 @@ protected:
|
||||
|
||||
|
||||
/**
|
||||
Avaible pooling functions (padding on tkDNN is not supported)
|
||||
Available pooling functions (padding on tkDNN is not supported)
|
||||
*/
|
||||
typedef enum {
|
||||
POOLING_MAX = 0,
|
||||
@@ -460,7 +460,7 @@ typedef enum {
|
||||
|
||||
/**
|
||||
Pooling layer
|
||||
currenty supported only 2d pooing (also on 3d input)
|
||||
currently supported only 2d pooing (also on 3d input)
|
||||
*/
|
||||
class Pooling : public Layer {
|
||||
|
||||
@@ -526,7 +526,7 @@ public:
|
||||
|
||||
/**
|
||||
Reorg layer
|
||||
Mantain same dimension but change C*H*W distribution
|
||||
Maintains same dimension but change C*H*W distribution
|
||||
*/
|
||||
class Reorg : public Layer {
|
||||
|
||||
@@ -559,7 +559,7 @@ public:
|
||||
|
||||
/**
|
||||
Upsample layer
|
||||
Mantain same dimension but change C*H*W distribution
|
||||
Maintains same dimension but change C*H*W distribution
|
||||
*/
|
||||
class Upsample : public Layer {
|
||||
|
||||
|
||||
@@ -7,12 +7,12 @@
|
||||
namespace tk { namespace dnn {
|
||||
|
||||
/**
|
||||
Data rapresentation beetween layers
|
||||
Data representation between layers
|
||||
n = batch size
|
||||
c = channels
|
||||
h = heigth (lines)
|
||||
h = height (lines)
|
||||
w = width (rows)
|
||||
l = lenght (3rd dimension)
|
||||
l = length (3rd dimension)
|
||||
*/
|
||||
struct dataDim_t {
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
void releaseLayers();
|
||||
|
||||
/**
|
||||
Do inferece for every added layer
|
||||
Do inference for every added layer
|
||||
*/
|
||||
dnnType* infer(dataDim_t &dim, dnnType* data);
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
Do inferece
|
||||
Do inference
|
||||
*/
|
||||
dnnType* infer(dataDim_t &dim, dnnType* data);
|
||||
void enqueue(int batchSize = 1);
|
||||
|
||||
@@ -73,12 +73,12 @@ double computeMap( std::vector<Frame> &images,const int classes,
|
||||
* all the recall levels are evaluated, otherwise only
|
||||
* map_point recall levels are used. For COCO evaluation
|
||||
* 101 points are used.
|
||||
* @param map_step step used to increment IoU theshold
|
||||
* @param map_step step used to increment IoU threshold
|
||||
* @param map_levels number of IoU step to perform
|
||||
* @param verbose is set to true, prints on screen additional info
|
||||
* @param write_on_file if set to true, the results produced by this function
|
||||
* are written on file
|
||||
* @param net name of the considerd neural network
|
||||
* @param net name of the considered neural network
|
||||
*
|
||||
* @return mAP IoU_tresh:IoU_tresh+map_step*map_levels (e.g. mAP 0.5:0.95 when
|
||||
* map_step=0.05 and map_levels=10)
|
||||
@@ -89,7 +89,7 @@ double computeMapNIoULevels(std::vector<Frame> &images,const int classes,
|
||||
const int map_levels=10, const bool verbose=false,
|
||||
const bool write_on_file = false, std::string net = "");
|
||||
/**
|
||||
* This method computes the numper of True Positive (TP), False Positive (FP),
|
||||
* This method computes the number of True Positive (TP), False Positive (FP),
|
||||
* False Negative (FN), precision, recall and f1-score.
|
||||
* Those values are computer over all the detections, over all the classes.
|
||||
*
|
||||
@@ -101,7 +101,7 @@ double computeMapNIoULevels(std::vector<Frame> &images,const int classes,
|
||||
* @param verbose is set to true, prints on screen additional info
|
||||
* @param write_on_file if set to true, the results produced by this function
|
||||
* are written on file
|
||||
* @param net name of the considerd neural network
|
||||
* @param net name of the considered neural network
|
||||
*/
|
||||
void computeTPFPFN( std::vector<Frame> &images,const int classes,
|
||||
const float IoU_thresh=0.5, const float conf_thresh=0.3,
|
||||
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
for(int b=0; b<batchSize; b++) {
|
||||
checkCuda(cudaMemcpy(offset, output_conv + b * 3 * chunk_dim, 2*chunk_dim*sizeof(dnnType), cudaMemcpyDeviceToDevice));
|
||||
checkCuda(cudaMemcpy(mask, output_conv + b * 3 * chunk_dim + 2*chunk_dim, chunk_dim*sizeof(dnnType), cudaMemcpyDeviceToDevice));
|
||||
// kernel sigmoide
|
||||
// kernel sigmoid
|
||||
activationSIGMOIDForward(mask, mask, chunk_dim);
|
||||
// deformable convolution
|
||||
dcnV2CudaForward(stat, handle,
|
||||
|
||||
@@ -20,7 +20,7 @@ int testInference(std::vector<std::string> input_bins, std::vector<std::string>
|
||||
}
|
||||
if(output_bins.size() != outputs.size()) {
|
||||
std::cout<<output_bins.size()<<" "<<outputs.size()<<"\n";
|
||||
FatalError("outputs size missmatch");
|
||||
FatalError("outputs size mismatch");
|
||||
}
|
||||
|
||||
// Load input
|
||||
|
||||
Reference in New Issue
Block a user