diff --git a/demo/demo/demo.cpp b/demo/demo/demo.cpp index e2d3322..b466905 100644 --- a/demo/demo/demo.cpp +++ b/demo/demo/demo.cpp @@ -23,6 +23,7 @@ #define MAX_DETECT_SIZE 100 bool gRun; +std::string obj_class[10]{"person", "car", "truck", "bus", "motor", "bike", "rider", "traffic light", "traffic sign", "train"}; cv::Mat frame_v; cv::Mat frame_top_v; @@ -205,24 +206,30 @@ int main(int argc, char *argv[]) int x1 = b.x + b.w; int y0 = b.y; int y1 = b.y + b.h; - int obj_class = b.cl; + int objClass = b.cl; + std::string det_class = obj_class[b.cl]; + float prob = b.prob; cv::Scalar intensity = mask.at(cv::Point(int(x0 + b.w / 2), y1)); if (intensity[0]) { - if (obj_class == 0 /*person*/ || obj_class == 1 /*bicycle*/ || obj_class == 2 /*car*/ - || obj_class == 3 /*motorbike*/ || obj_class == 5 /*bus*/) + if (objClass < 6) { - convert_coords(coords, coord_i, x0 + b.w / 2, y1, obj_class, H, adfGeoTransform, frame_nbr); + convert_coords(coords, coord_i, x0 + b.w / 2, y1, objClass, H, adfGeoTransform, frame_nbr); coord_i++; + + //std::cout<setHalf2Mode(true); } - + /* + if(net->dla && builderRT->getNbDLACores() > 0) { + dtRT = DataType::kHALF; + builderRT->setFp16Mode(true); + builderRT->allowGPUFallback(true); + builderRT->setDefaultDeviceType(DeviceType::kDLA); + builderRT->setDLACore(0); + } + */ + //add input layer ITensor *input = networkRT->addInput("data", DataType::kFLOAT, DimsCHW{ dim.c, dim.h, dim.w});