shangar21 / anime_upscaler

My usage of Real-ESRGAN to upscale anime, some test and results in the test_img folder
83 stars 7 forks source link

[WinError 183] Cannot create a file when that file already exists: 'tmp/' #8

Closed sampanes closed 5 months ago

sampanes commented 5 months ago

Was able to make a still image upscaled, tried a video, got the following:

[WinError 183] Cannot create a file when that file already exists: 'tmp/'

I do not see a tmp file anywhere relevant, and looking over the code there's quite a few parts where 'tmp' is used, but most of those have os.path.exists(...) checks. Just wondering if there's a quick fix for me or some lines of code to paste in various spots to help check the issue. The output unfortunately does not mention a line number or anything helpful

the exact line I ran: python anime_upscaler.py -m ..\Real-ESRGAN\weights\RealESRGAN_x4plus_anime_6B.pth -i ..\img\ptt_early_small.mp4 -o ..\img\ptt_output.mp4 -s and my python version is

python --version
Python 3.10.8
sampanes commented 5 months ago

Sorry folks turns out it is a '\' vs '/' issue lol I think it should be fine to just replace, like so, just ran this and it's working so far (taking forever, not sure if it's all being done by my CPU instead of GPU) but we'll see if there's any issue upon completion

old

if __name__ == '__main__':
    if args.model_path and args.input and args.output:
        try:
            upscale(args.input, slice=args.slice)
            ...

new

if __name__ == '__main__':
    if args.model_path and args.input and args.output:
        try:
            argin = args.input.replace('\\','/')
            upscale(margin, slice=args.slice)
            ...
sampanes commented 5 months ago

and also replace all future uses of args.input with that throughout the main function