[MRG] Removed ref. to deprecated imread/imresize in docs#10502
[MRG] Removed ref. to deprecated imread/imresize in docs#10502lesteve merged 2 commits intoscikit-learn:masterfrom
Conversation
|
LGTM, merging, thanks a lot! |
|
@lesteve, you really think we should be importing from private modules in
examples? I think that's a bad idea. We can remove the underscore if we
wish...
|
|
I saw that and I agree that it's not ideal.
Maybe a more proper way to do it would be to use |
|
I thought about using To allow for comparison, I appended all three versions of the rescaled image below ( |
|
If you made `antialiased_resize` a separate helper function, it would be
alright. I agree having a skimage dependency on example generation might be
unfortunate, @lesteve, but it would also be an illustration of best
practice, so I would not be against it.
|
|
I am not sure I follow your suggestion. Are you saying that the antialiasing is easy to implement once we use If you ask me, it seems like scipy deprecated |
|
I could be convinced with adding scikit-image as a dependency to the examples as I hinted above. I am not sure where you think If you ask me, it seems like scipy deprecated scipy.misc.imresize without a good existing replacement ... Side comment, it seems like scipy.ndimage.zoom does something similar to skimage.transform.rescale in the current scikit-image stable version (0.13.1). Maybe another option worth considering ... |
|
FWIW, implementation of the antialiasing is very simple. One can simply use the same gaussian filter that That will result in a properly rescaled image: |
|
Concerning |
|
I am fine using scikit-image in the examples with the two lines you wrote above to do the rescaling with antialiasing. There are a few things you will need to do:
Open a WIP PR and don't hesitate to ask if you get stuck. |


Reference Issues/PRs
Fixes: #10499
See also: #10427
What does this implement/fix? Explain your changes.
This removes all occurrences of
scipy.misc.imreadandscipy.misc.imresizefrom the docs and examples as these functions are deprecated and will be removed. In the examples they were replaced bysklearn.externals._pilutil.imresize. The mention in the docs was simply removed as they already point to the correct alternatives (skimageandimageio).Any other comments?
If thats preferred, instead of using
sklearn.externals._pilutil.imresizein the two examplesexamples/cluster/plot_face_segmentation.pyandexamples/cluster/plot_face_ward_segmentation.pyone could also useskimage.transform.rescale.