ImageManipulationKeras.ipynb (837B)
1 { 2 "cells": [ 3 { 4 "cell_type": "code", 5 "execution_count": 3, 6 "metadata": {}, 7 "outputs": [], 8 "source": [ 9 "from sklearn.datasets import load_sample_images\n", 10 "import keras\n", 11 "import tensorflow as tf \n", 12 "\n", 13 "images = load_sample_images()['images']\n", 14 "crop_layer = keras.layers.CenterCrop(height=100, width=100)\n", 15 "cropped_images = crop_layer(images)" 16 ] 17 } 18 ], 19 "metadata": { 20 "kernelspec": { 21 "display_name": ".venv", 22 "language": "python", 23 "name": "python3" 24 }, 25 "language_info": { 26 "codemirror_mode": { 27 "name": "ipython", 28 "version": 3 29 }, 30 "file_extension": ".py", 31 "mimetype": "text/x-python", 32 "name": "python", 33 "nbconvert_exporter": "python", 34 "pygments_lexer": "ipython3", 35 "version": "3.11.2" 36 } 37 }, 38 "nbformat": 4, 39 "nbformat_minor": 2 40 }