Add support for mobilenet in map_demo
Signed-off-by: Micaela Verucchi <micaelaverucchi@gmail.com>
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
#include "Yolo3Detection.h"
|
#include "Yolo3Detection.h"
|
||||||
#include "CenternetDetection.h"
|
#include "CenternetDetection.h"
|
||||||
|
#include "MobilenetDetection.h"
|
||||||
|
|
||||||
#include "evaluation.h"
|
#include "evaluation.h"
|
||||||
|
|
||||||
@@ -64,6 +65,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
tk::dnn::Yolo3Detection yolo;
|
tk::dnn::Yolo3Detection yolo;
|
||||||
tk::dnn::CenternetDetection cnet;
|
tk::dnn::CenternetDetection cnet;
|
||||||
|
tk::dnn::MobilenetDetection mbnet;
|
||||||
|
|
||||||
switch(ntype)
|
switch(ntype)
|
||||||
{
|
{
|
||||||
@@ -73,6 +75,9 @@ int main(int argc, char *argv[])
|
|||||||
case 'c':
|
case 'c':
|
||||||
cnet.init(net);
|
cnet.init(net);
|
||||||
break;
|
break;
|
||||||
|
case 'm':
|
||||||
|
mbnet.init(net, 512, 81);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
FatalError("Network type not allowed (3rd parameter)\n");
|
FatalError("Network type not allowed (3rd parameter)\n");
|
||||||
}
|
}
|
||||||
@@ -122,6 +127,18 @@ int main(int argc, char *argv[])
|
|||||||
cnet.update(dnn_input);
|
cnet.update(dnn_input);
|
||||||
detected_bbox = cnet.detected;
|
detected_bbox = cnet.detected;
|
||||||
break;
|
break;
|
||||||
|
case 'm':
|
||||||
|
mbnet.update(dnn_input);
|
||||||
|
detected_bbox = mbnet.detected;
|
||||||
|
for(auto& d:detected_bbox)
|
||||||
|
{
|
||||||
|
d.x = d.x;
|
||||||
|
d.y = d.y;
|
||||||
|
d.w = d.w - d.x; //in mobilenet b.w represents x1
|
||||||
|
d.h = d.h - d.y; //in mobilenet b.h repsresnts y1
|
||||||
|
d.cl = d.cl -1; //remove background class
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
FatalError("Network type not allowed!\n");
|
FatalError("Network type not allowed!\n");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user