MCPcopy Create free account
hub / github.com/apache/singa / enhance

Method enhance

python/singa/image_tool.py:614–629  ·  view source on GitHub ↗

Apply random enhancement for Color,Contrast,Brightness,Sharpness. Args: scale(float): enhancement degree is from [1-scale, 1+scale] inplace: inplace imgs or not ( return new_imgs)

(self, scale=0.2, inplace=True)

Source from the content-addressed store, hash-verified

612 return new_imgs
613
614 def enhance(self, scale=0.2, inplace=True):
615 '''Apply random enhancement for Color,Contrast,Brightness,Sharpness.
616
617 Args:
618 scale(float): enhancement degree is from [1-scale, 1+scale]
619 inplace: inplace imgs or not ( return new_imgs)
620 '''
621 new_imgs = []
622 for img in self.imgs:
623 new_img = enhance(img, scale)
624 new_imgs.append(new_img)
625 if inplace:
626 self.imgs = new_imgs
627 return self
628 else:
629 return new_imgs
630
631
632if __name__ == '__main__':

Callers 2

enhanceFunction · 0.80
image_tool.pyFile · 0.80

Calls 2

enhanceFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected