de3a472c09954065253c4c860d9eac5171fd9517,kraken/lib/util.py,,pil2array,#Any#Any#,19

Before Change



def pil2array(im, alpha=0):
    if im.mode == "L":
        a = np.fromstring(im.tobytes(), "B")
        a.shape = im.size[1], im.size[0]
        return a
    if im.mode == "RGB":
        a = np.fromstring(im.tobytes(), "B")
        a.shape = im.size[1], im.size[0], 3
        return a

After Change


def pil2array(im, alpha=0):
    if im.mode == "1":
        return np.array(im.convert("L"))
    return np.array(im)


def array2pil(a):
    if a.dtype == np.dtype("B"):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: mittagessen/kraken
Commit Name: de3a472c09954065253c4c860d9eac5171fd9517
Time: 2018-05-22
Author: mittagessen@l.unchti.me
File Name: kraken/lib/util.py
Class Name:
Method Name: pil2array


Project Name: scikit-video/scikit-video
Commit Name: a9f6a49ce99163d277ba04fa62496957c3e373e3
Time: 2018-06-08
Author: olivier.parmentier@gmail.com
File Name: skvideo/io/avconv.py
Class Name: LibAVReader
Method Name: _readFrame


Project Name: rlworkgroup/garage
Commit Name: eff8fbd2e3fb295d3c42dbc28d9d7cbcb6ca64ad
Time: 2018-08-02
Author: eric-heiden@users.noreply.github.com
File Name: garage/envs/mujoco/gather/gather_env.py
Class Name: GatherEnv
Method Name: render


Project Name: rlworkgroup/garage
Commit Name: eff8fbd2e3fb295d3c42dbc28d9d7cbcb6ca64ad
Time: 2018-08-02
Author: eric-heiden@users.noreply.github.com
File Name: garage/envs/mujoco/mujoco_env.py
Class Name: MujocoEnv
Method Name: render