What are valid values for model-color-format? (Segmentation configuration file model-color-format=2)

Hi,

I found that model-color-format should be “0” for RGB and “1” for BGR configuration. I also found that the Segmentation configuration file “dstest_segmentation_config_industrial.txt” contain “model-color-format = 2”. Could you provide more details please? What this “2” option mean?

Documentation: https://docs.nvidia.com/metropolis/deepstream/4.0/DeepStream_Plugin_Manual.pdf

Thank you,

Ondra

In gstnvinfer_property_parser.cpp

} else if (!g_strcmp0 (*key, CONFIG_GROUP_INFER_MODEL_COLOR_FORMAT)) {
       guint val = g_key_file_get_integer (key_file, CONFIG_GROUP_PROPERTY,
           CONFIG_GROUP_INFER_MODEL_COLOR_FORMAT, &error);
       CHECK_ERROR (error);
       switch (val) {
         case 0:
           nvinfer->init_params->networkInputFormat = NvDsInferFormat_RGB;
           break;
         case 1:
           nvinfer->init_params->networkInputFormat = NvDsInferFormat_BGR;
           break;
         case 2:
           nvinfer->init_params->networkInputFormat = <b>NvDsInferFormat_GRAY</b>;
           break;
         default:
           g_printerr ("Error. Invalid value for '%s':'%d'\n",
               CONFIG_GROUP_INFER_MODEL_COLOR_FORMAT, val);
           goto done;
           break;
       }

nvdsinfer_context.h

/**
 * Enum for color formats.
 */
typedef enum
{
    /** 24-bit interleaved R-G-B */
    NvDsInferFormat_RGB,
    /** 24-bit interleaved B-G-R */
    NvDsInferFormat_BGR,
    /** 8-bit Luma */
    NvDsInferFormat_GRAY,
    /** 32-bit interleaved R-G-B-A */
    NvDsInferFormat_RGBA,
    /** 32-bit interleaved B-G-R-x */
    NvDsInferFormat_BGRx,
    NvDsInferFormat_Unknown = 0xFFFFFFFF,
} NvDsInferFormat;

nvinfer supports not only rgb/bgr, but also gray format.