utils/augment.py
def generated_noise(self, img):
        """
        Choose which noise to produce.
        :param img(.jpg):
        """
        noise_count = random.randint(1, 2)
        for i in range(noise_count):
            index_noise = random.randint(0, 4)
            if index_noise == 0:
                img = self.gaussian_img(img)
            elif index_noise == 1:
                img = self.salt_img(img)
            elif index_noise == 2:
                img = self.rotate_whole_img(img)
            elif index_noise == 3:
                img = self.erode_img(img)
        return img

        Choose which noise to produce.
        :param img(.jpg):
        
Choose which noise to produce.
Choose which noise to produce .
def generated_noise(self, img):
        noise_count = random.randint(1, 2)
        for i in range(noise_count):
            index_noise = random.randint(0, 4)
            if index_noise == 0:
                img = self.gaussian_img(img)
            elif index_noise == 1:
                img = self.salt_img(img)
            elif index_noise == 2:
                img = self.rotate_whole_img(img)
            elif index_noise == 3:
                img = self.erode_img(img)
        return img
def generated_noise ( self , img ) : noise_count = random . randint ( 1 , 2 ) for i in range ( noise_count ) : index_noise = random . randint ( 0 , 4 ) if index_noise == 0 : img = self . gaussian_img ( img ) elif index_noise == 1 : img = self . salt_img ( img ) elif index_noise == 2 : img = self . rotate_whole_img ( img ) elif index_noise == 3 : img = self . erode_img ( img ) return img
Choose which noise to produce.
Choose which noise to produce .
"""
        Choose which noise to produce.
        :param img(.jpg):
        """
self
img
img(.jpg)
None