natethegreate / hent-AI

Automation of censor bar detection
MIT License
1.58k stars 145 forks source link

dcp_dir is not defined (ESRGAN) #11

Open Eidenz opened 4 years ago

Eidenz commented 4 years ago

Hi, when running the code on a CUDA compatible GPU and choosing the ESRGAN option (both mosaic and video), I get this error:

File "main.py", line 313, in <lambda>
    go_button = Button(mos_win, text="Go!", command = lambda: hentAI_TGAN(in_path=o_entry.get(), is_video=False))
File "main.py", line 174, in hentAI_TGAN
    hconfig['USER']['dcpdir'] = dcp_dir
NameError: name 'dcp_dir' is not defined

It seems that the code is still trying to locate the DCP folder in ESRGAN mode, and crashes since you don't get a prompt to put the path to it..

13579resu commented 4 years ago

Here's a workaround: In main.py on line 167 change this def hentAI_TGAN(in_path=None, is_video=False, force_jpg=True): to this (insert the correct path to ESRGAN folder): def hentAI_TGAN(in_path="INSERT PATH HERE", is_video=False, force_jpg=True, dilation=0):

natethegreate commented 4 years ago

Hello,

Have you used one of the other options before? This should populate the dcp entry on the cfg, this can happen if you use esrgan with the cfg uninitiated. Another workaround should be just commenting out line 174.

13579resu commented 4 years ago

Hi,

I have used the Bar and Mosaic (DCP) methods before, but none of the ESRGAN methods worked without changing the code.

Also, that workaround just eliminates the file path requirement, while not dealing with the missing dilation value

natethegreate commented 4 years ago

Try out the latest version 1.6.9 hotfix

13579resu commented 4 years ago

Seems to work. I am even able to run two instances of the program without any issues: Screenshot (1322)