MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / crop

Method crop

tools/preprocess/pose2d_utils.py:77–85  ·  view source on GitHub ↗
(self, x0, y0, x1, y1)

Source from the content-addressed store, hash-verified

75 return x0, y0, x1, y1
76
77 def crop(self, x0, y0, x1, y1):
78 all_kps = [self.kps_body, self.kps_lhand, self.kps_rhand, self.kps_face]
79 for kps in all_kps:
80 if kps is not None:
81 kps[:, 0] -= x0
82 kps[:, 1] -= y0
83 self.width = x1 - x0
84 self.height = y1 - y0
85 return self
86
87 def resize(self, width, height):
88 scale_x = width / self.width

Callers 8

_resizecropMethod · 0.80
run_vae_encoderMethod · 0.80
resize_pilimageFunction · 0.80
compute_sky_maskFunction · 0.80
__call__Method · 0.80
crop_and_resizeFunction · 0.80
resize_to_target_areaFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected