Giter Club home page Giter Club logo

deepnude_nowatermark_withmodel's Introduction

DeepNude

DeepNude Source Code

The README.md in English

DeepNude源代码

去水印

带三个模型.lib文件下载地址

供广大程序员技术交流使用

demo地址: demo很原始脆弱不鲁棒,所以感兴趣的话尽量还是自己去跑代码吧。不要对demo做坏事哦,不然就关掉= =

Preinstallation

Before launch the script install these packages in your Python3 environment:

  • numpy
  • Pillow
  • setuptools
  • six
  • pytorch
  • torchvision
  • wheel
pip3 install numpy pillow setuptools six pytorch torchvision wheel

建议使用Conda安装 :)

 conda create -n deepnude python=3.6 numpy Pillow setuptools six pytorch torchvision wheel
 conda activate deepnude

注:如果懒得折腾Python环境,也可以使用docker一键运行,见下

感谢网友飞哥提供docker一键运行部分技术支持

使用docker一键运行

cd ~

git clone https://github.com/zhengyima/DeepNude_NoWatermark_withModel.git --depth 1 deepnude

cd deepnude

docker run --rm -it -v $PWD:/app:rw ababy/python-deepnude /bin/bash

python main.py

注意: docker运行只能使用cpu,所以,需要修改gpu运行为cpu, 修改方法请参考 #GPU. 实际运行速度也慢不了多少.

对应的三个 .lib 文件需要自己手动下载后, 添加到项目根目录 checkpoints 目录下, 才能正常运行, 由于文件太大, 就没有放入docker镜像

Models

在运行之前需下载三个.lib文件,之后在项目根目录下新建checkpoints目录,将下载的三个文件放至checkpoints目录下。

友情提供以下两种下载渠道:

Launch the script

环境配好,模型下好之后便可以运行代码了!

 python main.py

The script will transform input.png to output.png.

GPU

本项目默认使用id为0的GPU运行。

若运行环境不带GPU,则报错。如果没有GPU或想使用CPU运行程序,请将gan.py中

self.gpu_ids = [0] #FIX CPU

改为 (

self.gpu_ids = [] #FIX CPU

Links

deepnude_nowatermark_withmodel's People

Contributors

carlitos31xx1 avatar fizzday avatar kindect avatar natiiix avatar olekstomek avatar zhengyima avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deepnude_nowatermark_withmodel's Issues

FileNotFoundError: [Errno 2] No such file or directory: 'checkpoints/cm.lib'

Hey, found an error, not entirely sure what I'm doing wrong - all the packages are installed correctly. First time run.

Processing input.png
libpng warning: iCCP: known incorrect sRGB profile
Executing phase: dress_to_correct
Executing phase: correct_to_mask
Traceback (most recent call last):
  File "C:\Users\-----\Desktop\Scripts\deepnude\main.py", line 56, in <module>
    main(inputpath, outputpath, show)
  File "C:\Users\-----\Desktop\Scripts\deepnude\main.py", line 35, in main
    watermark = deep_nude_process(inputpath)
  File "C:\Users\-----\Desktop\Scripts\deepnude\main.py", line 46, in deep_nude_process
    watermark = process(dress)
  File "C:\Users\-----\Desktop\Scripts\deepnude\run.py", line 115, in process
    model.initialize(opt)
  File "C:\Users\-----\Desktop\Scripts\deepnude\gan.py", line 71, in initialize
    self.__load_network(self.netG)
  File "C:\Users\-----\Desktop\Scripts\deepnude\gan.py", line 93, in __load_network
    network.load_state_dict(torch.load(save_path))
  File "C:\Users\-----\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\serialization.py", line 699, in load
    with _open_file_like(f, 'rb') as opened_file:
  File "C:\Users\-----\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\serialization.py", line 230, in _open_file_like
    return _open_file(name_or_buffer, mode)
  File "C:\Users\-----\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\serialization.py", line 211, in __init__
    super(_open_file, self).__init__(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: 'checkpoints/cm.lib'

Colab problem

bro,when I tried on google colab,run main.py:

Processing input.png
libpng warning: iCCP: known incorrect sRGB profile
Executing phase: dress_to_correct
Executing phase: correct_to_mask
Executing phase: mask_to_maskref
Executing phase: maskref_to_maskdet
Executing phase: maskdet_to_maskfin
Executing phase: maskfin_to_nude
Executing phase: nude_to_watermark
Error: no "view" mailcap rules found for type "image/png"
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: www-browser: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: links2: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: elinks: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: links: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: lynx: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: w3m: not found
xdg-open: no method available for opening 'output.png'

AssertionError: Torch not compiled with CUDA enabled

Processing input.png
libpng warning: iCCP: known incorrect sRGB profile
Executing phase: dress_to_correct
Executing phase: correct_to_mask
Traceback (most recent call last):
File "C:\Users\Aldy\deepnude\main.py", line 56, in
main(inputpath, outputpath, show)
File "C:\Users\Aldy\deepnude\main.py", line 35, in main
watermark = deep_nude_process(inputpath)
File "C:\Users\Aldy\deepnude\main.py", line 46, in deep_nude_process
watermark = process(dress)
File "C:\Users\Aldy\deepnude\run.py", line 115, in process
model.initialize(opt)
File "C:\Users\Aldy\deepnude\gan.py", line 66, in initialize
self.netG = self.__define_G(opt.input_nc, opt.output_nc, opt.ngf, opt.netG,
File "C:\Users\Aldy\deepnude\gan.py", line 117, in __define_G
netG.cuda(gpu_ids[0])
File "C:\Users\Aldy\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 688, in cuda
return self._apply(lambda t: t.cuda(device))
File "C:\Users\Aldy\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 578, in _apply
module._apply(fn)
File "C:\Users\Aldy\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 578, in _apply
module._apply(fn)
File "C:\Users\Aldy\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 601, in _apply
param_applied = fn(param)
File "C:\Users\Aldy\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 688, in
return self.apply(lambda t: t.cuda(device))
File "C:\Users\Aldy\anaconda3\lib\site-packages\torch\cuda_init
.py", line 210, in _lazy_init
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled

When i executing python main.py this error appear what should i do?

ValueError: too many values to unpack (expected 2)

$python main.py

libpng warning: iCCP: known incorrect sRGB profile
Executing phase: dress_to_correct
Executing phase: correct_to_mask
Executing phase: mask_to_maskref
Executing phase: maskref_to_maskdet
Executing phase: maskdet_to_maskfin
Traceback (most recent call last):
  File "main.py", line 40, in <module>
    main(inputpath, outputpath)
  File "main.py", line 26, in main
    watermark = process(dress)
  File "/Users/Aiker/Desktop/deepnude/deepnude/run.py", line 144, in process
    maskfin = create_maskfin(maskref, maskdet)
  File "/Users/Aiker/Desktop/deepnude/deepnude/opencv_transform/maskdet_to_maskfin.py", line 34, in create_maskfin
    bodypart_list = extractAnnotations(maskdet);
  File "/Users/Aiker/Desktop/deepnude/deepnude/opencv_transform/maskdet_to_maskfin.py", line 101, in extractAnnotations
    tits_list = findBodyPart(maskdet, "tit")
  File "/Users/Aiker/Desktop/deepnude/deepnude/opencv_transform/maskdet_to_maskfin.py", line 168, in findBodyPart
    contours, hierarchy = cv2.findContours(color_mask,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE)
ValueError: too many values to unpack (expected 2)

need to edit opencv_transform/maskdet_to_maskfin.py line 168

vim /Users/Aiker/Desktop/deepnude/deepnude/opencv_transform/maskdet_to_maskfin.py +168

_, contours, hierarchy = cv2.findContours(color_mask,cv2.RETR_TREE      ,cv2.CHAIN_APPROX_SIMPLE)

then it's OK.

image

docker running cause cv error

Traceback (most recent call last):
File "main.py", line 45, in
main2()
File "main.py", line 17, in main2
watermark = process(dress)
File "/app/run.py", line 140, in process
maskref = create_maskref(mask, correct)
File "/app/opencv_transform/mask_to_maskref.py", line 37, in create_maskref
res1 = cv2.bitwise_and(cv_correct, cv_correct, mask = green_mask_inv)
cv2.error: OpenCV(4.1.0) /io/opencv/modules/core/src/arithm.cpp:245: error: (-215:Assertion failed) (mtype == CV_8U || mtype == CV_8S) && _mask.sameSize(*psrc1) in function 'binary_op'

I meet a error

At first, after configuring the environment according to the document, but prompted that there was no cv'module running main, I installed opencv' with `conda', but there was still a mistake. Is the pytorch version wrong?

(deepnnde) F:\Deepnnde\DeepNude_NoWatermark_withModel>python main.py
Processing input.png
libpng warning: iCCP: known incorrect sRGB profile
Executing phase: dress_to_correct
Executing phase: correct_to_mask
Traceback (most recent call last):
File "main.py", line 56, in
main(inputpath, outputpath, show)
File "main.py", line 35, in main
watermark = deep_nude_process(inputpath)
File "main.py", line 46, in deep_nude_process
watermark = process(dress)
File "F:\Deepnnde\DeepNude_NoWatermark_withModel\run.py", line 115, in process
model.initialize(opt)
File "F:\Deepnnde\DeepNude_NoWatermark_withModel\gan.py", line 68, in initialize
opt.n_blocks_local, opt.norm, self.gpu_ids)
File "F:\Deepnnde\DeepNude_NoWatermark_withModel\gan.py", line 117, in __define_G
netG.cuda(gpu_ids[0])
File "F:\Anaconda\envs\deepnnde\lib\site-packages\torch\nn\modules\module.py", line 260, in cuda
return self._apply(lambda t: t.cuda(device))
File "F:\Anaconda\envs\deepnnde\lib\site-packages\torch\nn\modules\module.py", line 187, in _apply
module._apply(fn)
File "F:\Anaconda\envs\deepnnde\lib\site-packages\torch\nn\modules\module.py", line 187, in _apply
module._apply(fn)
File "F:\Anaconda\envs\deepnnde\lib\site-packages\torch\nn\modules\module.py", line 193, in _apply
param.data = fn(param.data)
File "F:\Anaconda\envs\deepnnde\lib\site-packages\torch\nn\modules\module.py", line 260, in
return self.apply(lambda t: t.cuda(device))
File "F:\Anaconda\envs\deepnnde\lib\site-packages\torch\cuda_init
.py", line 161, in _lazy_init
check_driver()
File "F:\Anaconda\envs\deepnnde\lib\site-packages\torch\cuda_init
.py", line 75, in _check_driver
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled

Can I run this on my Mac with Intel Iris Graphics 6100 GPU?

I get the following exception. Can I just install an Nvidia driver on my Mac or can I run it with CPU or do I have to start a cloud instance which has the right GPU?

⇒ docker run --rm -it -v $PWD:/app:rw ababy/python-deepnude /bin/bash
Unable to find image 'ababy/python-deepnude:latest' locally
latest: Pulling from ababy/python-deepnude
6f2f362378c5: Pull complete
494c27a8a6b8: Pull complete
7596bb83081b: Pull complete
372744b62d49: Pull complete
615db220d76c: Pull complete
39aa0c89bda1: Pull complete
da1dae8da560: Pull complete
3b8162139e71: Pull complete
f94aa49947d3: Pull complete
8f1f89c2ca6c: Pull complete
0558c2c7813d: Pull complete
Digest: sha256:3d7571ee8c4e10de2dca840b57cb4ffaaf35503182c0b8884aec4760ce7c76fc
Status: Downloaded newer image for ababy/python-deepnude:latest
root@c5469230c05e:/app# python main.py
libpng warning: iCCP: known incorrect sRGB profile
Executing phase: dress_to_correct
Executing phase: correct_to_mask
Traceback (most recent call last):
File "main.py", line 40, in
main(inputpath, outputpath)
File "main.py", line 26, in main
watermark = process(dress)
File "/app/run.py", line 115, in process
model.initialize(opt)
File "/app/gan.py", line 68, in initialize
opt.n_blocks_local, opt.norm, self.gpu_ids)
File "/app/gan.py", line 117, in __define_G
netG.cuda(gpu_ids[0])
File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 265, in cuda
return self._apply(lambda t: t.cuda(device))
File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 193, in _apply
module._apply(fn)
File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 193, in _apply
module._apply(fn)
File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 199, in _apply
param.data = fn(param.data)
File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 265, in
return self._apply(lambda t: t.cuda(device))
File "/usr/local/lib/python3.7/site-packages/torch/cuda/init.py", line 162, in _lazy_init
_check_driver()
File "/usr/local/lib/python3.7/site-packages/torch/cuda/init.py", line 82, in _check_driver
http://www.nvidia.com/Download/index.aspx""")
AssertionError:
Found no NVIDIA driver on your system. Please check that you
have an NVIDIA GPU and installed a driver from

.

.

Script works and creates output, but very bad picture quality

Got it running on my Mac (using CPU option).

The original image works. The output is worse quality than the input, but still okay.

If I use a custom image, it does not create good output (very bad quality and colors, you almost cannot realize it is a woman).

What are the requirements to run this model better?

  • I downloaded the three models, but did not do any config changes or select a specific model. Which one is best?
  • Does the picture require a specific resolution?
  • Is it possible to create good outputs at all with this model?

Thanks.

Running in docker FileNotFoundError: [Errno 2] No such file or directory: 'checkpoints/cm.lib'

When I run the app in Docker as described, I got:
docker run --rm -it -v $PWD:/app:rw ababy/python-deepnude /bin/bash root@11dcb1effe70:/app# ls README.md gan.py input.png main.py opencv_transform readmeimgs run.py root@11dcb1effe70:/app# python main.py libpng warning: iCCP: known incorrect sRGB profile Executing phase: dress_to_correct Executing phase: correct_to_mask Traceback (most recent call last): File "main.py", line 30, in <module> main() File "main.py", line 21, in main watermark = process(dress) File "/app/run.py", line 115, in process model.initialize(opt) File "/app/gan.py", line 69, in initialize self.__load_network(self.netG) File "/app/gan.py", line 89, in __load_network network.load_state_dict(torch.load(save_path)) File "/usr/local/lib/python3.7/site-packages/torch/serialization.py", line 382, in load f = open(f, 'rb') FileNotFoundError: [Errno 2] No such file or directory: 'checkpoints/cm.lib' root@11dcb1effe70:/app#

How can I fix this?

Thanks

报错?

Processing input.png
libpng warning: iCCP: known incorrect sRGB profile
Executing phase: dress_to_correct
Executing phase: correct_to_mask
Traceback (most recent call last):
File "main.py", line 56, in
main(inputpath, outputpath, show)
File "main.py", line 35, in main
watermark = deep_nude_process(inputpath)
File "main.py", line 46, in deep_nude_process
watermark = process(dress)
File "/app/run.py", line 115, in process
model.initialize(opt)
File "/app/gan.py", line 68, in initialize
opt.n_blocks_local, opt.norm, self.gpu_ids)
File "/app/gan.py", line 117, in __define_G
netG.cuda(gpu_ids[0])
File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 265, in cuda
return self._apply(lambda t: t.cuda(device))
File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 193, in _apply
module._apply(fn)
File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 193, in _apply
module._apply(fn)
File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 199, in _apply
param.data = fn(param.data)
File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 265, in
return self._apply(lambda t: t.cuda(device))
File "/usr/local/lib/python3.7/site-packages/torch/cuda/init.py", line 162, in _lazy_init
_check_driver()
File "/usr/local/lib/python3.7/site-packages/torch/cuda/init.py", line 82, in _check_driver
http://www.nvidia.com/Download/index.aspx""")
AssertionError:
Found no NVIDIA driver on your system. Please check that you
have an NVIDIA GPU and installed a driver from
http://www.nvidia.com/Download/index.aspx

磁力链接失效?

你好,我尝试使用磁力链接下载模型,但是一直没有下载速度。请问是不是磁力链接失效?

No module name 'run'

I hope this place isn't dead. I've been banging my head against a wall for hours, I can't seem to figure out this issue. Installed everything here, and what was said in other issues posts in Anaconda.

(deepnude) C:\Users\me>python main.py
Traceback (most recent call last):
File "C:\Users\me\main.py", line 9, in
from run import process
ModuleNotFoundError: No module named 'run'

AttributeError: 'NoneType' object has no attribute 'shape'

Processing input.png
Traceback (most recent call last):
File "I:\DNs\Deepnude\main.py", line 56, in
main(inputpath, outputpath, show)
File "I:\DNs\Deepnude\main.py", line 35, in main
watermark = deep_nude_process(inputpath)
File "I:\DNs\Deepnude\main.py", line 43, in deep_nude_process
h = dress.shape[0]
AttributeError: 'NoneType' object has no attribute 'shape'

Am I doing something wrong or is there an error in the script?

How can I update the Library files.

I mean I want to update the existing dataset with new datasets which I have tested over the existing model but I am having issue in opening the library files. The CM.lib, MM.lib,MN.lib. how can I open these .lib files. I am using Windows 10 laptop. Can you help me to update the existing dataset. Please.

Update ?

Hello great forks ! how update please ?

麻烦请教一下这个'NoneType' object has no attribute 'pydev_notify_kill'问题

Traceback (most recent call last):
  File "/Users/luke_hai/.vscode/extensions/ms-python.python-2019.6.24221/pythonFiles/lib/python/ptvsd/_vendored/pydevd/_pydevd_bundle/pydevd_trace_dispatch_regular.py", line 378, in __call__
    py_db.notify_thread_not_alive(get_current_thread_id(t))
  File "/Users/luke_hai/.vscode/extensions/ms-python.python-2019.6.24221/pythonFiles/lib/python/ptvsd/_vendored/pydevd/pydevd.py", line 1108, in notify_thread_not_alive
    was_notified = thread.additional_info.pydev_notify_kill
AttributeError: 'NoneType' object has no attribute 'pydev_notify_kill'
Terminated: 15

这是什么情况啊?
是我的环境有问题吗?

No such file or directory: 'checkpoints/cm.lib'

Traceback (most recent call last):
File "main.py", line 56, in
main(inputpath, outputpath, show)
File "main.py", line 35, in main
watermark = deep_nude_process(inputpath)
File "main.py", line 46, in deep_nude_process
watermark = process(dress)
File "C:\Users\Ghaz\AppData\Roaming\Adobe\Flash Player\DeepNude_NoWatermark_withModel-master\run.py", line 115, in process
model.initialize(opt)
File "C:\Users\Ghaz\AppData\Roaming\Adobe\Flash Player\DeepNude_NoWatermark_withModel-master\gan.py", line 71, in initialize
self.__load_network(self.netG)
File "C:\Users\Ghaz\AppData\Roaming\Adobe\Flash Player\DeepNude_NoWatermark_withModel-master\gan.py", line 93, in __load_network
network.load_state_dict(torch.load(save_path))
File "C:\Users\Ghaz\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\serialization.py", line 581, in load
with _open_file_like(f, 'rb') as opened_file:
File "C:\Users\Ghaz\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\serialization.py", line 230, in _open_file_like
return _open_file(name_or_buffer, mode)
File "C:\Users\Ghaz\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\serialization.py", line 211, in init
super(_open_file, self).init(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: 'checkpoints/cm.lib'

Which version of opencv will be correct?

File "main.py", line 45, in
main2()
File "main.py", line 17, in main2
watermark = process(dress)
File "/home/mingming/Desktop/DeepNude_NoWatermark_withModel-master/run.py", line 144, in process
maskfin = create_maskfin(maskref, maskdet)
File "/home/mingming/Desktop/DeepNude_NoWatermark_withModel-master/opencv_transform/maskdet_to_maskfin.py", line 34, in create_maskfin
bodypart_list = extractAnnotations(maskdet);
File "/home/mingming/Desktop/DeepNude_NoWatermark_withModel-master/opencv_transform/maskdet_to_maskfin.py", line 101, in extractAnnotations
tits_list = findBodyPart(maskdet, "tit")
File "/home/mingming/Desktop/DeepNude_NoWatermark_withModel-master/opencv_transform/maskdet_to_maskfin.py", line 168, in findBodyPart
contours, hierarchy = cv2.findContours(color_mask,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE)
ValueError: too many values to unpack (expected 2)

[Errno 2] No such file or directory: 'xdg-open': 'xdg-open'

你好,我按照readme在MacBook Pro上进行docker一键安装之后,运行程序出现如下error:

Executing phase: nude_to_watermark
Traceback (most recent call last):
File "main.py", line 56, in
main(inputpath, outputpath, show)
File "main.py", line 38, in main
open_file(outputpath)
File "main.py", line 24, in open_file
subprocess.call([opener, filepath])
File "/usr/local/lib/python3.7/subprocess.py", line 323, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/local/lib/python3.7/subprocess.py", line 775, in init
restore_signals, start_new_session)
File "/usr/local/lib/python3.7/subprocess.py", line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'xdg-open': 'xdg-open'

我在网上查到有说是因为没有安装xdg-utils,于是通过macports安装了xdg-utils,不过再次运行还是会出现上述结果。
因为本人接触这块不久,还是新手,特此向大神们请教

a bug that appears when the program starts.

user@O:~/apps/DeepNude_NoWatermark_withModel$ python3 main.py
Executing phase: dress_to_correct
Executing phase: correct_to_mask
Traceback (most recent call last):
File "main.py", line 30, in
main()
File "main.py", line 21, in main
watermark = process(dress)
File "/home/user/apps/DeepNude_NoWatermark_withModel/run.py", line 115, in process
model.initialize(opt)
File "/home/user/apps/DeepNude_NoWatermark_withModel/gan.py", line 69, in initialize
self.__load_network(self.netG)
File "/home/user/apps/DeepNude_NoWatermark_withModel/gan.py", line 89, in __load_network
network.load_state_dict(torch.load(save_path))
File "/home/user/.local/lib/python3.6/site-packages/torch/serialization.py", line 579, in load
with _open_file_like(f, 'rb') as opened_file:
File "/home/user/.local/lib/python3.6/site-packages/torch/serialization.py", line 230, in _open_file_like
return _open_file(name_or_buffer, mode)
File "/home/user/.local/lib/python3.6/site-packages/torch/serialization.py", line 211, in init
super(_open_file, self).init(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: 'checkpoints/cm.lib'

环境按照readme配置以后运行出现这个错误

(deepnude) ➜ DeepNude_NoWatermark_withModel git:(master) ✗ python main.py
Traceback (most recent call last):
File "main.py", line 4, in
from run import process
File "/me/python/DeepNude_NoWatermark_withModel/run.py", line 4, in
from gan import DataLoader, DeepModel, tensor2im
File "/me/python/DeepNude_NoWatermark_withModel/gan.py", line 4, in
import torchvision.transforms as transforms
File "/anaconda3/envs/deepnude/lib/python3.6/site-packages/torchvision/init.py", line 1, in
from torchvision import models
File "/anaconda3/envs/deepnude/lib/python3.6/site-packages/torchvision/models/init.py", line 1, in
from .alexnet import *
File "/anaconda3/envs/deepnude/lib/python3.6/site-packages/torchvision/models/alexnet.py", line 1, in
import torch.nn as nn
File "/me/python/DeepNude_NoWatermark_withModel/torch/init.py", line 79, in
from torch._C import *
ModuleNotFoundError: No module named 'torch._C'

运行示例的png图片没问题, 运行自己下载的jpg图片, 就报这个错误

root@687e7442775c:/app# python main.py
Executing phase: dress_to_correct
Executing phase: correct_to_mask
Executing phase: mask_to_maskref
Traceback (most recent call last):
File "main.py", line 31, in
main()
File "main.py", line 22, in main
watermark = process(dress)
File "/app/run.py", line 140, in process
maskref = create_maskref(mask, correct)
File "/app/opencv_transform/mask_to_maskref.py", line 38, in create_maskref
res2 = cv2.bitwise_and(green, green, mask = green_mask)
cv2.error: OpenCV(4.1.0) /io/opencv/modules/core/src/arithm.cpp:245: error: (-215:Assertion failed) (mtype == CV_8U || mtype == CV_8S) && _mask.sameSize(*psrc1) in function 'binary_op'

提示nvdia驱动不存在, 我用github的另外一个仓库的项目, 则正常

root@265fe3fa7b79:/app/DeepNude_NoWatermark_withModel# python main.py
libpng warning: iCCP: known incorrect sRGB profile
Executing phase: dress_to_correct
Executing phase: correct_to_mask
Traceback (most recent call last):
File "main.py", line 45, in
main2()
File "main.py", line 17, in main2
watermark = process(dress)
File "/app/DeepNude_NoWatermark_withModel/run.py", line 115, in process
model.initialize(opt)
File "/app/DeepNude_NoWatermark_withModel/gan.py", line 66, in initialize
opt.n_blocks_local, opt.norm, self.gpu_ids)
File "/app/DeepNude_NoWatermark_withModel/gan.py", line 113, in __define_G
netG.cuda(gpu_ids[0])
File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 265, in cuda
return self._apply(lambda t: t.cuda(device))
File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 193, in _apply
module._apply(fn)
File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 193, in _apply
module._apply(fn)
File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 199, in _apply
param.data = fn(param.data)
File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 265, in
return self._apply(lambda t: t.cuda(device))
File "/usr/local/lib/python3.7/site-packages/torch/cuda/init.py", line 162, in _lazy_init
_check_driver()
File "/usr/local/lib/python3.7/site-packages/torch/cuda/init.py", line 82, in _check_driver
http://www.nvidia.com/Download/index.aspx""")
AssertionError:
Found no NVIDIA driver on your system. Please check that you
have an NVIDIA GPU and installed a driver from
http://www.nvidia.com/Download/index.aspx

Dress

I suggest the opposite functionality that puts on clothes (eg a sheepskin coat). :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.