@@ -340,16 +340,13 @@ def extract_patches_2d(image, patch_size, max_patches=None, random_state=None):
340
340
--------
341
341
>>> from sklearn.datasets import load_sample_images
342
342
>>> from sklearn.feature_extraction import image
343
- >>>
344
343
>>> # Use the array data from the first image in this dataset:
345
344
>>> one_image = load_sample_images().images[0]
346
345
>>> print('Image shape: {}'.format(one_image.shape))
347
346
Image shape: (427, 640, 3)
348
- >>>
349
347
>>> patches = image.extract_patches_2d(one_image, (2, 2))
350
348
>>> print('Patches shape: {}'.format(patches.shape))
351
349
Patches shape: (272214, 2, 2, 3)
352
- >>>
353
350
>>> # Here are just two of these patches:
354
351
>>> print(patches[1]) # doctest: +NORMALIZE_WHITESPACE
355
352
[[[174 201 231]
@@ -467,12 +464,10 @@ class PatchExtractor(BaseEstimator):
467
464
--------
468
465
>>> from sklearn.datasets import load_sample_images
469
466
>>> from sklearn.feature_extraction import image
470
- >>>
471
467
>>> # Use the array data from the second image in this dataset:
472
468
>>> X = load_sample_images().images[1]
473
469
>>> print('Image shape: {}'.format(X.shape))
474
470
Image shape: (427, 640, 3)
475
- >>>
476
471
>>> pe = image.PatchExtractor(patch_size=(2, 2))
477
472
>>> pe_fit = pe.fit(X)
478
473
>>> pe_trans = pe.transform(X)
0 commit comments