from gen_flow import gen_flow_circle
case = 1 # 1 or 2
height = 101
width = 101
if case == 1:
flow = gen_flow_circle([height//2, width//2], height, width)
flow = flow / 3
else:
flow = gen_flow_circle([0,0], height, width)
flow = flow / 5
print(flow[:,:,0])
print(flow[:,:,1])
from flow_display import dense_flow
dense_flow(flow)
from flow_display import sparse_flow
sparse_flow(flow, stride=10)
from image_warp import image_warp
# nearest or bilinear
deformed_nearest = image_warp(img.copy(), flow, mode='nearest')
deformed_bilinear = image_warp(img.copy(), flow, mode='bilinear')