MCPcopy
hub / github.com/richzhang/PerceptualSimilarity / zoom_to_res

Function zoom_to_res

util/visualizer.py:11–18  ·  view source on GitHub ↗
(img,res=256,order=0,axis=0)

Source from the content-addressed store, hash-verified

9# from IPython import embed
10
11def zoom_to_res(img,res=256,order=0,axis=0):
12 # img 3xXxX
13 from scipy.ndimage import zoom
14 zoom_factor = res/img.shape[1]
15 if(axis==0):
16 return zoom(img,[1,zoom_factor,zoom_factor],order=order)
17 elif(axis==2):
18 return zoom(img,[zoom_factor,zoom_factor,1],order=order)
19
20class Visualizer():
21 def __init__(self, opt):

Callers 2

save_images_simpleMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected