File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -532,12 +532,16 @@ class PatchExtractor(TransformerMixin, BaseEstimator):
532532 >>> from sklearn.feature_extraction import image
533533 >>> # Use the array data from the second image in this dataset:
534534 >>> X = load_sample_images().images[1]
535+ >>> X = X[None, ...]
535536 >>> print(f"Image shape: {X.shape}")
536- Image shape: (427, 640, 3)
537- >>> pe = image.PatchExtractor(patch_size=(2, 2 ))
537+ Image shape: (1, 427, 640, 3)
538+ >>> pe = image.PatchExtractor(patch_size=(10, 10 ))
538539 >>> pe_trans = pe.transform(X)
539540 >>> print(f"Patches shape: {pe_trans.shape}")
540- Patches shape: (545706, 2, 2)
541+ Patches shape: (263758, 10, 10, 3)
542+ >>> X_reconstructed = image.reconstruct_from_patches_2d(pe_trans, X.shape[1:])
543+ >>> print(f"Reconstructed shape: {X_reconstructed.shape}")
544+ Reconstructed shape: (427, 640, 3)
541545 """
542546
543547 _parameter_constraints : dict = {
You can’t perform that action at this time.
0 commit comments