Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/thygate/stable-diffusion-webui-depthmap-script
/ __crop
Function
__crop
pix2pix/data/base_dataset.py:135–141 ·
view source on GitHub ↗
(img, pos, size)
Source
from the content-addressed store, hash-verified
133
134
135
def
__crop(img, pos, size):
136
ow, oh = img.size
137
x1, y1 = pos
138
tw = th = size
139
if
(ow > tw or oh > th):
140
return
img.crop((x1, y1, x1 + tw, y1 + th))
141
return
img
142
143
144
def
__flip(img, flip):
Callers
1
get_transform
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected