GithubHelp home page GithubHelp logo

output resolution? about sttn HOT 9 CLOSED

antithing avatar antithing commented on May 26, 2024
output resolution?

from sttn.

Comments (9)

alex-flwls avatar alex-flwls commented on May 26, 2024

I managed to figure this out. You can set image width and height in test.py to your image size, but you also need to change the patch size in model/sttn.py. This resolves issue #7

test.py, line 40:
w, h = [your_image_width, your_image_height]

model/sttn.py, line 70:
patchsize = [(image_height / 4, image_width / 4), (image_height / 8, image_width / 8), (image_height / 16, image_width / 16), (image_height / 32, image_width / 32)]

This worked for me at 256x256 resolution. I was worried that the weights wouldn't load because of the patch size change but it doesn't seem to be a problem.

ref_length is how many frames the model takes as a reference for one inpainted frame, neighbour_stride is how many it jumps, or strides, along the frames in the loop. It's got nothing to do with the image sizes.

from sttn.

antithing avatar antithing commented on May 26, 2024

Hi, and thanks! I have tried this at 1920x1080 resolution and I get a CUDA out of memory error.(Single RTX 3090).

Would changing ref_length or neighbour_stride help with this?

from sttn.

alex-flwls avatar alex-flwls commented on May 26, 2024

I'm not sure, perhaps changing the ref_length would help as it's attending to fewer frames but I don't know as I haven't looked into this. Don't want to make this discussion off-topic, I suggest closing the issue if my fix above solved your problem.

from sttn.

antithing avatar antithing commented on May 26, 2024

Hard to say if it fixes the issue as I cant run it, but as it is running out of memory, i assume that it is trying. Thanks for your help!

from sttn.

roachsinai avatar roachsinai commented on May 26, 2024

I managed to figure this out. You can set image width and height in test.py to your image size, but you also need to change the patch size in model/sttn.py. This resolves issue #7

test.py, line 40: w, h = [your_image_width, your_image_height]

model/sttn.py, line 70: patchsize = [(image_height / 4, image_width / 4), (image_height / 8, image_width / 8), (image_height / 16, image_width / 16), (image_height / 32, image_width / 32)]

This worked for me at 256x256 resolution. I was worried that the weights wouldn't load because of the patch size change but it doesn't seem to be a problem.

ref_length is how many frames the model takes as a reference for one inpainted frame, neighbour_stride is how many it jumps, or strides, along the frames in the loop. It's got nothing to do with the image sizes.

Hi, seems patchsize in model/sttn.py has different calculalte method with your method.

Code in test.py and model/sttn.py list blow:

w, h = 432, 240
patchsize = [(108, 60), (36, 20), (18, 10), (9, 5)]

If using your post the patchsize should be [(108.0, 60.0), (54.0, 30.0), (27.0, 15.0), (13.5, 7.5)]. And how should we deal with float than integer.

from sttn.

alex-flwls avatar alex-flwls commented on May 26, 2024

Hi, yes i did some further work on this after my comment. The patch size calculations I outlined in my original comment work for 256x256 resolution, but for other resolutions you need to make sure that the resolution can be divided by the patch size evenly (i.e. into integers, not floats). You don't have to go down in patch size by factors of 4, 8, 16, and 32 (e.g. in the original code the factors are 4, 12, 24, and 48).

from sttn.

roachsinai avatar roachsinai commented on May 26, 2024

@alex-flwls thanks for your further explanation. So the target of set patchsize is to get the factors?

from sttn.

alex-flwls avatar alex-flwls commented on May 26, 2024

It's just a workaround, the code doesn't seem like it was written to support multiple resolutions. You can get around it by adjusting the patch sizes.

from sttn.

roachsinai avatar roachsinai commented on May 26, 2024

@alex-flwls I'll try it, thanks.

from sttn.

Related Issues (15)

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.