parameters: (self, path_out='')
return_statement: return image_rgb, labels
docstring: Generates a random image with circles on it.
  
  		Input:
  			path_out: Path to the output folder (if not set the generator can only generate 
  				      batches)
  		Output:
  			3 channel BGR image,
  			dict with labels {bbs, path}
docstring_summary: Generates a random image with circles on it.
docstring_tokens: Generates a random image with circles on it .
function: def _generate_image(self, path_out=''):
  		"""
  		Generates a random image with circles on it.
  
  		Input:
  			path_out: Path to the output folder (if not set the generator can only generate 
  				      batches)
  		Output:
  			3 channel BGR image,
  			dict with labels {bbs, path}
  		"""
  		path = os.path.join(path_out, str(self.image_counter) + '.png')
  
  		# Random parameters of the image
  		bg_intensity = int(random.uniform(50, 200))
  		sigma = random.uniform(0, 60)
  		num_circles = int(random.uniform(3, 7))
  
  
  		# This is our random background
  		image = np.random.normal(0, sigma, (self.height, self.width)) + bg_intensity
  		# Crop the values to be within [0,255]
  		image[image > 255] = 255
  		image[image < 0] = 0
  
  		# Place the circles to the image
  		labels = {
  			'bbs': [],
  			'path' : path,
  		}
  		for i in range(num_circles):
  			x = int(random.uniform(0, self.width))
  			y = int(random.uniform(0, self.height))
  
  			cv2.circle(image, (x, y), self.circle_radius, (0,), -1)
  
  			labels['bbs'].append({
  				'x_min': x - self.circle_radius,
  				'y_min': y - self.circle_radius,
  				'x_max': x + self.circle_radius,
  				'y_max': y + self.circle_radius,
  			})
  
  		# Raise the image counter
  		self.image_counter += 1
  
  		image_rgb = cv2.cvtColor(image.astype(np.uint8), cv2.COLOR_GRAY2BGR)
  
  		return image_rgb, labels
function_tokens: def _generate_image ( self , path_out = '' ) : path = os . path . join ( path_out , str ( self . image_counter ) + '.png' ) # Random parameters of the image bg_intensity = int ( random . uniform ( 50 , 200 ) ) sigma = random . uniform ( 0 , 60 ) num_circles = int ( random . uniform ( 3 , 7 ) ) # This is our random background image = np . random . normal ( 0 , sigma , ( self . height , self . width ) ) + bg_intensity # Crop the values to be within [0,255] image [ image > 255 ] = 255 image [ image < 0 ] = 0 # Place the circles to the image labels = { 'bbs' : [ ] , 'path' : path , } for i in range ( num_circles ) : x = int ( random . uniform ( 0 , self . width ) ) y = int ( random . uniform ( 0 , self . height ) ) cv2 . circle ( image , ( x , y ) , self . circle_radius , ( 0 , ) , - 1 ) labels [ 'bbs' ] . append ( { 'x_min' : x - self . circle_radius , 'y_min' : y - self . circle_radius , 'x_max' : x + self . circle_radius , 'y_max' : y + self . circle_radius , } ) # Raise the image counter self . image_counter += 1 image_rgb = cv2 . cvtColor ( image . astype ( np . uint8 ) , cv2 . COLOR_GRAY2BGR ) return image_rgb , labels