import re


def _count_number_of_input_channels(cfg):
    """
    Returns the number of input channels of ResDepth.

    :param cfg: EasyDict, json configuration file imported as dictionary
    :return:    int, number of input channels
    """

    input_channels = cfg.model.input_channels

    if input_channels == 'geom':
        return 1

    elif input_channels in ['stereo', 'geom-mono']:
        return 2

    elif input_channels == 'geom-stereo':
        return 3

    elif input_channels == 'geom-multiview':
        num_views = int(re.findall(r'\d+', cfg.multiview.config)[0])
        return num_views + 1