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):
9F19
532
532
>>> from sklearn.feature_extraction import image
533
533
>>> # Use the array data from the second image in this dataset:
534
534
>>> X = load_sample_images().images[1]
535
+ >>> X = X[None, ...]
535
536
>>> 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 ))
538
539
>>> pe_trans = pe.transform(X)
539
540
>>> 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)
541
545
"""
542
546
543
547
_parameter_constraints : dict = {
You can’t perform that action at this time.
0 commit comments