From aaeb9dbbb0cb67c7a8926a9078b340de08d03b55 Mon Sep 17 00:00:00 2001 From: WalterSumbon <45062253+WalterSumbon@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:15:11 +0800 Subject: [PATCH] Remove deprecated 'shape' parameter from tutorial (#8103) * Remove deprecated 'shape' parameter * Remove deprecated 'shape' parameter --- readme_files/zh-cn/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme_files/zh-cn/README.md b/readme_files/zh-cn/README.md index 1020ef3e2d..8cb87fa783 100644 --- a/readme_files/zh-cn/README.md +++ b/readme_files/zh-cn/README.md @@ -150,7 +150,7 @@ def sepia(input_img): sepia_img /= sepia_img.max() return sepia_img -demo = gr.Interface(sepia, gr.Image(shape=(200, 200)), "image") +demo = gr.Interface(sepia, gr.Image(), "image") demo.launch() ``` @@ -161,7 +161,7 @@ demo.launch() 你也可以用 `type=` 关键字参数设置组件使用的数据类型。例如,如果你想让你的函数获取一个图像的文件路径,而不是一个NumPy数组时,输入 `Image` 组件可以写成: ```python -gr.Image(type="filepath", shape=...) +gr.Image(type="filepath") ``` 还要注意,我们的输入 `Image` 组件带有一个编辑按钮 🖉,它允许裁剪和放大图像。以这种方式操作图像可以帮助揭示机器学习模型中的偏见或隐藏的缺陷!