MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / blind_split

Method blind_split

PATH/core/augmentation.py:737–745  ·  view source on GitHub ↗
(self, raw_img)

Source from the content-addressed store, hash-verified

735 print('Done')
736
737 def blind_split(self, raw_img):
738 w, h = raw_img.size
739 if np.random.rand() <= self.split_prob:
740 if h > w * 0.7:
741 mid = max(w*0.7, int(round(h*0.35)))
742 cut = np.random.randint(low=mid, high=h)
743 # raw_img = raw_img[:cut]
744 raw_img = raw_img.crop((0, 0, w, cut))
745 return raw_img
746
747 def __call__(self, raw_img,fname):
748 if self.extra_info is None:

Callers 1

__call__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected