b09454afb34000634c8a77050135e3201f6f365d,chainercv/utils/testing/assertions/assert_is_semantic_segmentation_dataset.py,,assert_is_semantic_segmentation_dataset,#Any#Any#Any#,7

Before Change



    for _ in six.moves.range(repeat):
        i = np.random.randint(0, len(dataset))
        sample = dataset[i]

        assert len(sample) >= 2, \
            "Each example must have at least two elements:" \
            "img and label."

        img, label = sample[:2]

        assert_is_image(img, color=True)

        assert isinstance(label, np.ndarray), \

After Change



    assert len(dataset) > 0, "The length of dataset must be greater than zero."

    if n_example:
        for _ in six.moves.range(n_example):
            i = np.random.randint(0, len(dataset))
            _check_example(dataset[i], n_class)
    else:
        for i in six.moves.range(len(dataset)):
            _check_example(dataset[i], n_class)


def _check_example(example, n_class):
    assert len(example) >= 2, \
        "Each example must have at least two elements:" \
        "img and label."
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 10

Instances


Project Name: chainer/chainercv
Commit Name: b09454afb34000634c8a77050135e3201f6f365d
Time: 2017-06-14
Author: Hakuyume@users.noreply.github.com
File Name: chainercv/utils/testing/assertions/assert_is_semantic_segmentation_dataset.py
Class Name:
Method Name: assert_is_semantic_segmentation_dataset


Project Name: chainer/chainercv
Commit Name: 19c8ee690ccf74947b379862a5290c9b53f96de7
Time: 2017-03-15
Author: yuyuniitani@gmail.com
File Name: chainercv/transforms/image/chw_to_pil_image.py
Class Name:
Method Name: chw_to_pil_image


Project Name: chainer/chainercv
Commit Name: b09454afb34000634c8a77050135e3201f6f365d
Time: 2017-06-14
Author: Hakuyume@users.noreply.github.com
File Name: chainercv/utils/testing/assertions/assert_is_detection_dataset.py
Class Name:
Method Name: assert_is_detection_dataset