Skip to content

Commit

Permalink
fix(api): ensure gradient points are always in order
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Jun 10, 2023
1 parent ac2eceb commit 82a80bb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/onnx_web/chain/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,12 @@ def blend_tiles(
mask = np.ones_like(equalized[:, :, 0])

if adj_tile < tile:
# sort gradient points
p1 = adj_tile * scale
p2 = (tile - adj_tile) * scale
points = [0, min(p1, p2), max(p1, p2), tile * scale]

# gradient blending
points = [0, adj_tile * scale, (tile - adj_tile) * scale, (tile * scale) - 1]
grad_x, grad_y = get_tile_grads(left, top, adj_tile, width, height)
logger.trace("tile gradients: %s, %s, %s", points, grad_x, grad_y)

Expand Down

0 comments on commit 82a80bb

Please sign in to comment.