YOLO IN TENSORT :)

This commit is contained in:
Francesco Gatti
2017-08-03 16:50:57 +02:00
parent 4e189755cf
commit 0ff47ad6ba
5 changed files with 111 additions and 3 deletions
+13
View File
@@ -7,6 +7,7 @@
using namespace nvinfer1;
#include "pluginsRT/ActivationLeakyRT.cpp"
#include "pluginsRT/ReorgRT.cpp"
#include "pluginsRT/RegionRT.cpp"
// Logger for info/warning/errors
class Logger : public ILogger
@@ -111,6 +112,8 @@ ITensor* NetworkRT::convert_layer(ITensor *input, Layer *l) {
return convert_layer(input, (Route*) l);
if(type == LAYER_REORG)
return convert_layer(input, (Reorg*) l);
if(type == LAYER_REGION)
return convert_layer(input, (Region*) l);
FatalError("Layer not implemented in tensorRT");
return NULL;
@@ -237,4 +240,14 @@ ITensor* NetworkRT::convert_layer(ITensor *input, Reorg *l) {
return lRT->getOutput(0);
}
ITensor* NetworkRT::convert_layer(ITensor *input, Region *l) {
std::cout<<"convert Region\n";
std::cout<<"New plugin REGION\n";
IPlugin *plugin = new RegionRT(l->classes, l->coords, l->num, l->thresh);
IPluginLayer *lRT = networkRT->addPlugin(&input, 1, *plugin);
checkNULL(lRT);
return lRT->getOutput(0);
}
}