#NEWLINE# def selective_search( I , color_spaces = [ 'rgb' ] , ks = [ 100 ] , feature_masks = [ features . SimilarityMask ( 1 , 1 , 1 , 1 ) ] , n_jobs = ( - 1 ) ) : #NEWLINE# #INDENT# parameters = itertools . product ( color_spaces , ks , feature_masks ) #NEWLINE# region_set = joblib . Parallel ( n_jobs = n_jobs ) ( ( joblib . delayed ( _selective_search_one ) ( I , color , k , mask ) for ( color , k , mask ) in parameters ) ) #NEWLINE# regions = sum ( region_set , [ ] ) #NEWLINE# return sorted ( regions )