69f6cb1e25e014952b409cd906e319415c43e1d0,doc_seg/utils.py,,multiclass_to_label_image,#Any#Any#,133

Before Change



    with tf.name_scope("Label2Img"):
        classes_color_values = tf.cast(get_classes_color_from_file(classes_file), tf.int32)
        fn = lambda x: tf.py_func(multilabel_to_img, [x, classes_color_values], tf.int32, name="py_label2img")
        image_tf = tf.map_fn(fn, class_label_tensor, name="map_for_batch")
        _shape = class_label_tensor.get_shape().as_list()
        image_tf.set_shape([_shape[0], _shape[1], _shape[2], 3])
        return image_tf


def get_classes_color_from_file(classes_file: str) -> np.ndarray:

After Change


    classes_color_values, colors_labels = get_classes_color_from_file_multilabel(classes_file)

    n_classes = colors_labels.shape[1]
    c = np.zeros((2,)*n_classes+(3,), np.int32)
    for c_value, inds in zip(classes_color_values, colors_labels):
        c[tuple(inds)] = c_value
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: dhlab-epfl/dhSegment
Commit Name: 69f6cb1e25e014952b409cd906e319415c43e1d0
Time: 2017-10-23
Author: seg.benoit@gmail.com
File Name: doc_seg/utils.py
Class Name:
Method Name: multiclass_to_label_image


Project Name: keras-team/keras
Commit Name: b688192cbd74495c9907b6dcfce47e9a582ae1af
Time: 2016-01-31
Author: francois.chollet@gmail.com
File Name: keras/backend/tensorflow_backend.py
Class Name:
Method Name: rnn


Project Name: tensorflow/models
Commit Name: 9a30bb661ffbf93d095c48d2ba7971f88c10eb38
Time: 2018-02-16
Author: karmel@arcaio.com
File Name: official/resnet/vgg_preprocessing.py
Class Name:
Method Name: _aspect_preserving_resize