ceccocats / tkDNN

Deep neural network library and toolkit to do high performace inference on NVIDIA jetson platforms
GNU General Public License v2.0
718 stars 209 forks source link

Bouding boxes coords #113

Closed rafoliveira closed 4 years ago

rafoliveira commented 4 years ago

Having a hard time understanding the code since I am not very experienced with C++ Which variable describes the coordinates of the bounding boxes? I wanted to use them to make calculations

rafoliveira commented 4 years ago

Found it on this file, described by the res variable

mive93 commented 4 years ago

Hi @rafoliveira Sorry, I missed the issue. The boxes are stored as tk::dnn::box (defined here https://github.com/ceccocats/tkDNN/blob/master/include/tkDNN/Layer.h#L577 )

struct box {
    int cl;
    float x, y, w, h;
    float prob;
    std::vector<float> probs;

    void print() 
    {
        std::cout<<"x: "<<x<<"\ty: "<<y<<"\tw: "<<w<<"\th: "<<h<<"\tcl: "<<cl<<"\tprob: "<<prob<<std::endl;
    }
};

For each detector, they are stored in batchDetected (https://github.com/ceccocats/tkDNN/blob/master/include/tkDNN/DetectionNN.h#L71)

sharoseali commented 3 years ago

HI! I tested both FP32 and FP16 implementation with batch size = 4 but when I run the test I get this result as seen below. Every object is surrounded by 4 bounding boxes., Can anyone help? I think it's an NMS problem but don't know how to fix it. Screenshot from 2021-01-05 23-57-32 Thank You

sharoseali commented 3 years ago

HI! I tested both FP32 and FP16 implementation with batch size = 4 but when I run the test I get this result as seen below. Every object is surrounded by 4 bounding boxes., Can anyone help? I think it's an NMS problem but don't know how to fix it. Screenshot from 2021-01-05 23-57-32 Thank You

@mive93

mive93 commented 3 years ago

Hi @sharoseali

what are you using? Which platform? I never had that problem. Just run a bunch of models and everything is fine for me.

sharoseali commented 3 years ago

Hi @sharoseali

what are you using? Which platform? I never had that problem. Just run a bunch of models and everything is fine for me.

İ am running my custom trained yolo v4 on AGX xavier using your repo. When İ use batch size equals 1 .. its fine, but when i use batch size equals 4 then on display i see 4 bounding boxes running with each moving object as İ show above. What the thing come in mind is that its issue in NMS.. and bounding boxes are 4 times drawn .Also FPS get very less when i run with batch size equals 4. thanks for replying