e6b96bad22deecea56e666f3d98eb4d065e99317,plantcv/plantcv/transform/resize.py,,resize_factor,#Any#Any#Any#,101
Before Change
if factor_x <= 0 or factor_y <= 0:
fatal_error("Resize values both cannot be 0 or negative values!")
if "interp_mtd" in kw:
interp_mtd = kw["interp_mtd"]
else:
interp_mtd = _set_interpolation(factor_x=factor_x, factor_y=factor_y)
resized_im = cv2.resize(img, (0, 0), fx=factor_x, fy=factor_y, interpolation=interp_mtd)
if params.debug == "print":
print_image(resized_im, os.path.join(params.debug_outdir, str(params.device) + "_resize.png"))
After Change
:return resized_img: numpy.ndarray
params.device += 1
if not isinstance(factors, tuple) or len(factors) != 2 or not all([n > 0 for n in factors]):
fatal_error(f"The input factors={factors} should be a tuple of length 2 with values greater than 0.")
interp_mtd = _set_interpolation(input_size=(1, 1), output_size=factors, method=interpolation)
resized_img = cv2.resize(img, (0, 0), fx=factors[0], fy=factors[1], interpolation=interp_mtd)
if params.debug == "print":
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances
Project Name: danforthcenter/plantcv
Commit Name: e6b96bad22deecea56e666f3d98eb4d065e99317
Time: 2020-10-30
Author: noahfahlgren@gmail.com
File Name: plantcv/plantcv/transform/resize.py
Class Name:
Method Name: resize_factor
Project Name: home-assistant/home-assistant
Commit Name: c56701baaf312882f33829441a9156fa0ec43e37
Time: 2016-03-09
Author: marhje52@kth.se
File Name: homeassistant/helpers/state.py
Class Name:
Method Name: reproduce_state
Project Name: rlworkgroup/garage
Commit Name: eff8fbd2e3fb295d3c42dbc28d9d7cbcb6ca64ad
Time: 2018-08-02
Author: eric-heiden@users.noreply.github.com
File Name: tests/envs/test_envs.py
Class Name: TestEnvs
Method Name: test_env