Watermark-Removal 是一个基于机器学习的图像修复工具,通过图像修复方法自动去除水印,使结果与原图几无差异。该项目采用 TensorFlow 1.15.0 实现,支持命令行一键式操作,可在本地或 Colab 环境运行。灵感来源于 CVPR 2018 的 Contextual Attention 与 ICCV 2019 的 Gated Convolution,开源于 GitHub,拥有 3.5k Star 和 417 Fork,由社区维护。
源码:https://github.com/zuruoke/watermark-removal
-
首先,克隆这个 repo
!git clone https://github.com/zuruoke/watermark-removal
-
将目录更改为 repo
!cd watermark-removal
-
由于 Google Colab 使用最新的 Tensorflow 2x 版本,而本项目使用 1.15.0,因此请降级到 Tensorflow 1.15.0 版本并重新启动运行时,(
although the new version of Google Colab does not need you to restart the runtime
)。!pip install tensorflow==1.15.0
-
安装 tensorflow 工具包neurogym。
!pip install git+https://github.com/JiahuiYu/neuralgym
-
使用此链接下载模型目录并将其放在下面
model/
(重命名checkpoint.txt
为,checkpoint
因为有时谷歌驱动器会在下载后自动添加.txt)
一切就绪!
-
main.py
现在通过运行文件来删除图像上的水印!python main.py --image path-to-input-image --output path-to-output-image --checkpoint_dir model/ --watermark_type istock
@article{yu2018generative, title={Generative Image Inpainting with Contextual Attention}, author={Yu, Jiahui and Lin, Zhe and Yang, Jimei and Shen, Xiaohui and Lu, Xin and Huang, Thomas S}, journal={arXiv preprint arXiv:1801.07892}, year={2018} } @article{yu2018free, title={Free-Form Image Inpainting with Gated Convolution}, author={Yu, Jiahui and Lin, Zhe and Yang, Jimei and Shen, Xiaohui and Lu, Xin and Huang, Thomas S}, journal={arXiv preprint arXiv:1806.03589}, year={2018} }
Libre Depot(自由仓库)原创文章、发布者:Libre Depot = 转载请注明出处:https://www.libredepot.top/zh/5600.html