b776ae08e9e676435c5cf8d1f31a86dfd3e1897f,chainercv/utils/image/read_image.py,,read_image,#Any#Any#Any#,5
Before Change
f = Image.open(path)
try:
if color:
img = f.convert("RGB")
else:
img = f.convert("P")
img = np.asarray(img, dtype=dtype)
finally:
After Change
Returns:
~numpy.ndarray: An image.
if chainer.config.cv_read_image_backend == "cv2":
if _cv2_available:
return _read_image_cv2(path, dtype, color)
else:
warnings.warn(
"Although `chainer.config.cv_read_image_backend == "cv2"`, "
"cv2 is not found. As a fallback option, read_image uses "
"PIL. Either install cv2 or set "
"`chainer.config.cv_read_image_backend = "PIL" to suppress "
"this warning.")
return _read_image_pil(path, dtype, color)
elif chainer.config.cv_read_image_backend == "PIL":
return _read_image_pil(path, dtype, color)
else:
raise ValueError("chainer.config.cv_read_image_backend should be "
"either "cv2" or "PIL".")
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 4
Instances
Project Name: chainer/chainercv
Commit Name: b776ae08e9e676435c5cf8d1f31a86dfd3e1897f
Time: 2018-10-20
Author: yuyuniitani@gmail.com
File Name: chainercv/utils/image/read_image.py
Class Name:
Method Name: read_image
Project Name: tsurumeso/waifu2x-chainer
Commit Name: 7c57e6f2de0795edef5aed8cbcebb1243ba86191
Time: 2018-02-23
Author: nstm101339@gmail.com
File Name: lib/reconstruct.py
Class Name:
Method Name: image_tta
Project Name: tsurumeso/waifu2x-chainer
Commit Name: f992515537c72c9b2a74cd213416a4d7956ef639
Time: 2018-10-16
Author: tsurumeso@gmail.com
File Name: appendix/benchmark.py
Class Name:
Method Name: benchmark
Project Name: tsurumeso/waifu2x-chainer
Commit Name: 7c57e6f2de0795edef5aed8cbcebb1243ba86191
Time: 2018-02-23
Author: nstm101339@gmail.com
File Name: lib/reconstruct.py
Class Name:
Method Name: image