公号:原文地址如下
🚀我的好朋友大概就是这样哦
❤️ 爱了 爱了💙
🔔基础信息
U2-Net: Going Deeper with Nested U-Structure for Salient Object Detection
https://arxiv.org/abs/2005.09007
https://github.com/NathanUA/U-2-Net
🎄环境搭建
官方的库版本需求要求如下:
Python 3.6
numpy 1.15.2
scikit-image 0.14.0
python-opencv PIL 5.2.0
PyTorch 0.4.0
torchvision 0.2.1
glob
我自己的 Conda 环境搭建过程如下(安装torch==1.1.0 可用):
服务器:ubuntu1~18.04
Quadro RTX 5000 16G
CUDA版本 V10.0.130
conda create -n nice python=3.6.9
conda activate nice
pip install torch==1.1.0
pip install torchvision==0.3.0
或者(建议使用 conda 来安装)
conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=10.0 -c pytorch
pip install pillow==5.2.0
pip install opencv-python
pip install scipy
pip install thop
🎄项目结构如下
🎄项目测试步骤(官方教程)
🎄项目测试(个人记录)
一: 人像素描
python u2net_portrait_test.py
该命令是对整个图像进行,素描重建,生成效果如下
二: 人脸素描
python u2net_portrait_demo.py
会检测 图像中人脸位置,只对人脸进行素描
三: 测试命令
python u2net_portrait_composite.py -s 20 -a 0.5
-s indicates the sigma of gaussian function for blurring the orignal image and -a denotes the alpha weights of the orignal image when fusing them【理解起来就是变的更好看】
❤️ 那么多好看的朋友,藏着掖着,不存在的, 好吧 ❤️
❤️ 雨露均沾,大叔跑不了 ❤️ ❤️ 原图越高清, 转换效果越惊艳 ❤️
GPU内存占用:
- 测试运行:GPU单卡最高占用 5073MiB
💬总结
该论文本身是一篇关于 salient object detection(突出物检测) 的文章;
不曾想有大佬 把它 用于 human portrait drawing(人物肖像素描)
取得不错响应,成为一个如此有趣的项目,不明觉厉...
🎉可运行代码 + 数据获取方式如下
考虑到一些小伙伴 官方代码 和 模型下载有困难,博主这里把此次博文对应代码上传到网盘,里面包含本次测试使用的代码和下载的预训练模型;
有需要的小伙伴,搜索关注博主同名公号:墨理学AI ,公号后台,回复 20200101 即可获取 云盘下载链接:
20200101
公号:原文地址如下