MCPcopy Index your code
hub / github.com/drinkingcoder/FlowFormer-Official / compute_grid_indices

Function compute_grid_indices

evaluate_FlowFormer_tile.py:57–65  ·  view source on GitHub ↗
(image_shape, patch_size=TRAIN_SIZE, min_overlap=20)

Source from the content-addressed store, hash-verified

55 return x[..., c[0]:c[1], c[2]:c[3]]
56
57def compute_grid_indices(image_shape, patch_size=TRAIN_SIZE, min_overlap=20):
58 if min_overlap >= patch_size[0] or min_overlap >= patch_size[1]:
59 raise ValueError("!!")
60 hs = list(range(0, image_shape[0], patch_size[0] - min_overlap))
61 ws = list(range(0, image_shape[1], patch_size[1] - min_overlap))
62 # Make sure the final patch is flush with the image boundary
63 hs[-1] = image_shape[0] - patch_size[0]
64 ws[-1] = image_shape[1] - patch_size[1]
65 return [(h, w) for h in hs for w in ws]
66
67import math
68def compute_weight(hws, image_shape, patch_size=TRAIN_SIZE, sigma=1.0, wtype='gaussian'):

Callers 4

create_sintel_submissionFunction · 0.70
create_kitti_submissionFunction · 0.70
validate_kittiFunction · 0.70
validate_sintelFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected