apply lint
This commit is contained in:
parent
ec8f367316
commit
55e5f73d20
|
@ -114,7 +114,9 @@ def blend_inpaint(
|
||||||
|
|
||||||
return result.images[0]
|
return result.images[0]
|
||||||
|
|
||||||
output = process_tile_order(stage.tile_order, source, SizeChart.auto, 1, [outpaint], overlap=params.overlap)
|
output = process_tile_order(
|
||||||
|
stage.tile_order, source, SizeChart.auto, 1, [outpaint], overlap=params.overlap
|
||||||
|
)
|
||||||
|
|
||||||
logger.info("final output image size: %s", output.size)
|
logger.info("final output image size: %s", output.size)
|
||||||
return output
|
return output
|
||||||
|
|
|
@ -98,12 +98,18 @@ def blend_tiles(
|
||||||
scaled_right = min(scaled_left + equalized.shape[1], scaled_size[1])
|
scaled_right = min(scaled_left + equalized.shape[1], scaled_size[1])
|
||||||
|
|
||||||
# accumulation
|
# accumulation
|
||||||
value[
|
value[scaled_top:scaled_bottom, scaled_left:scaled_right, :] += equalized[
|
||||||
scaled_top : scaled_bottom, scaled_left : scaled_right, :
|
0 : scaled_bottom - scaled_top, 0 : scaled_right - scaled_left, :
|
||||||
] += equalized[0 : scaled_bottom - scaled_top, 0 : scaled_right - scaled_left, :]
|
]
|
||||||
count[
|
count[scaled_top:scaled_bottom, scaled_left:scaled_right, :] += np.repeat(
|
||||||
scaled_top : scaled_bottom, scaled_left : scaled_right, :
|
mask[
|
||||||
] += np.repeat(mask[0 : scaled_bottom - scaled_top, 0 : scaled_right - scaled_left, np.newaxis], 3, axis=2)
|
0 : scaled_bottom - scaled_top,
|
||||||
|
0 : scaled_right - scaled_left,
|
||||||
|
np.newaxis,
|
||||||
|
],
|
||||||
|
3,
|
||||||
|
axis=2,
|
||||||
|
)
|
||||||
|
|
||||||
pixels = np.where(count > 0, value / count, value)
|
pixels = np.where(count > 0, value / count, value)
|
||||||
return Image.fromarray(pixels)
|
return Image.fromarray(pixels)
|
||||||
|
@ -169,7 +175,9 @@ def process_tile_spiral(
|
||||||
tile_coords = generate_tile_spiral(width, height, tile, overlap=overlap)
|
tile_coords = generate_tile_spiral(width, height, tile, overlap=overlap)
|
||||||
for left, top in tile_coords:
|
for left, top in tile_coords:
|
||||||
counter += 1
|
counter += 1
|
||||||
logger.debug("processing tile %s of %s, %sx%s", counter, len(tile_coords), left, top)
|
logger.debug(
|
||||||
|
"processing tile %s of %s, %sx%s", counter, len(tile_coords), left, top
|
||||||
|
)
|
||||||
|
|
||||||
tile_image = image.crop((left, top, left + tile, top + tile))
|
tile_image = image.crop((left, top, left + tile, top + tile))
|
||||||
tile_image = complete_tile(tile_image, tile)
|
tile_image = complete_tile(tile_image, tile)
|
||||||
|
|
Loading…
Reference in New Issue