You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何将Anvil传输至Google Colab的图片保存为test.png到内容文件夹?

保存图片到Colab的content文件夹

你已经通过PIL成功加载了图片,直接调用Image对象的save()方法即可将图片保存到目标路径:

# 将图片保存为test.png至Colab的content文件夹
image1.save('/content/test.png')

如果需要验证保存是否成功,可以执行以下代码检查文件是否存在:

import os
print(os.path.exists('/content/test.png'))

内容的提问来源于stack exchange,提问作者haru

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.20 21:24:28