b8a5e5db6c2c0ff9540d84c11c05b21fc6023ae6,skimage/color/colorconv.py,,rgba2rgb,#,163
Before Change
channels = arr[..., :-1]
out = np.empty_like(channels)
for ichan in range(channels.shape[-1]):
out[..., ichan] = np.clip(
(1 - alpha) * background[ichan] + alpha * channels[..., ichan],
a_min=0, a_max=1)
After Change
arr = dtype.img_as_float(arr)
background = np.ravel(background).astype(arr.dtype)
if len(background) != 3:
raise ValueError("background must be an array-like containing 3 RGB "
f"values. Got {len(background)} items")
if np.any(background < 0) or np.any(background > 1):
raise ValueError("background RGB values must be floats between "
"0 and 1.")
background = background[np.newaxis, ...]
alpha = arr[..., -1, np.newaxis]
channels = arr[np.newaxis, ..., :-1]
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: scikit-image/scikit-image
Commit Name: b8a5e5db6c2c0ff9540d84c11c05b21fc6023ae6
Time: 2020-05-04
Author: rfezzani@gmail.com
File Name: skimage/color/colorconv.py
Class Name:
Method Name: rgba2rgb
Project Name: brian-team/brian2
Commit Name: fefe628658fbbca925a35d0fc741b77acee35bad
Time: 2017-10-03
Author: marcel.stimberg@inserm.fr
File Name: brian2/codegen/generators/GSL_generator.py
Class Name:
Method Name: valid_gsl_dir
Project Name: commonsense/conceptnet5
Commit Name: 2999e509688a82f8be65600727a5922b5739822b
Time: 2017-03-08
Author: joanna.teresa.duda@gmail.com
File Name: conceptnet5/vectors/evaluation/wordsim.py
Class Name:
Method Name: compute_semeval_score