Skip to content

Commit

Permalink
network updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dusty-nv committed Jun 19, 2020
1 parent 8924629 commit ff66dbd
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
12 changes: 12 additions & 0 deletions c/segNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,18 @@ bool segNet::Process( void* image, uint32_t width, uint32_t height, imageFormat
return false;
}

if( !imageFormatIsRGB(format) )
{
LogError(LOG_TRT "segNet -- unsupported image format (%s)\n", imageFormatToStr(format));
LogError(LOG_TRT " supported formats are:\n");
LogError(LOG_TRT " * rgb8\n");
LogError(LOG_TRT " * rgba8\n");
LogError(LOG_TRT " * rgb32f\n");
LogError(LOG_TRT " * rgba32f\n");

return cudaErrorInvalidValue;
}

PROFILER_BEGIN(PROFILER_PREPROCESS);

if( IsModelType(MODEL_ONNX) )
Expand Down
11 changes: 10 additions & 1 deletion c/segNet.cu
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include "cudaUtility.h"
#include "cudaVector.h"
#include "imageFormat.h"
#include "segNet.h"


// gpuSegOverlay
Expand Down Expand Up @@ -168,7 +168,16 @@ cudaError_t cudaSegOverlay( void* input, uint32_t in_width, uint32_t in_height,
return cudaErrorInvalidValue;

if( !imageFormatIsRGB(format) )
{
LogError(LOG_TRT "segNet -- unsupported image format (%s)\n", imageFormatToStr(format));
LogError(LOG_TRT " supported formats are:\n");
LogError(LOG_TRT " * rgb8\n");
LogError(LOG_TRT " * rgba8\n");
LogError(LOG_TRT " * rgb32f\n");
LogError(LOG_TRT " * rgba32f\n");

return cudaErrorInvalidValue;
}

// launch kernel
const dim3 blockDim(8, 8);
Expand Down
4 changes: 2 additions & 2 deletions c/tensorNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ bool tensorNet::LoadNetwork( const char* prototxt_path_, const char* model_path_
mModelType = model_fmt;
mModelPath = model_path;

LogSuccess(LOG_TRT "device %s, %s initialized.\n", deviceTypeToStr(device), mModelPath.c_str());
LogSuccess(LOG_TRT "device %s, initialized %s\n", deviceTypeToStr(device), mModelPath.c_str());
return true;
}

Expand Down Expand Up @@ -1025,7 +1025,7 @@ bool tensorNet::LoadNetwork( const char* prototxt_path_, const char* model_path_
return false;
}

LogSuccess(LOG_TRT "device %s, %s loaded\n", deviceTypeToStr(device), model_path.c_str());
LogSuccess(LOG_TRT "device %s, loaded %s\n", deviceTypeToStr(device), model_path.c_str());


/*
Expand Down

0 comments on commit ff66dbd

Please sign in to comment.