Giter VIP home page Giter VIP logo

vs-gmfss_union's People

Contributors

holywu avatar

Stargazers

 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

vs-gmfss_union's Issues

Surplus/Redundant/Unnecessary Inference

reuse_things = self.reuse(img0, img1)

The Reuse part is designed to calculate optical flow and features which can be reused when fusing/inferencing frames at different/arbitrary timestep.
Thus, the GMFSS class should be split into two part for sake of TRT to avoid redundant inference (if necessary/convenient), whose pseudocode probably looks like:

class Reuse(nn.Module):
    ...
    def forward(img0, img1):
        ...
        return reuse_things

class GMFSS(nn.Module):
    ...
    def forward(img0, img1, reuse_things, timestep):
        ...
        return self.fusionnet(img0, img1, reuse_things, merged, timestep)

inst_reuse = Reuse(...)
inst_gmfss = GMFSS(...)
    
def inference(n: int, f: list[vs.VideoFrame]) -> vs.VideoFrame:
    ...
    reuse_things = inst_reuse(img0, img1)  # this takes up 30% of the time according to our inspection
    timesteps = [timestep...]
    for t in timesteps:  # I don't know how to implement the sequential logic in VS(probably using packet or async? no idea, so filled with a for loop here
    	output = inst_gmfss(img0, img1, reuse_things, timestep)  # the left 70% calculation ends up here
    ...

portable version CUDA_PATH

With other torch filters, I can usually place all cuda&co filter into a single folder and I can add that folder with:

# Adding torch dependencies to PATH
path = site.getsitepackages()[0]+'/torch_dependencies/'
ctypes.windll.kernel32.SetDllDirectoryW(path)
path = path.replace('\\', '/')
os.environ["PATH"] = path + os.pathsep + os.environ["PATH"]

First I thought, it would be enough, if I additionally set os.environ["CUDA_PATH"] = path.
But then I get:
[code]Python exception: [WinError 2] Das System kann die angegebene Datei nicht finden: 'I:/Hybrid/64bit/Vapoursynth/torch_dependencies/bin'[/code]
If I copy all my dlls into a bin-subfolder of torch_dependencies it works.

Would be nice if vs-gmfss_union would also directly use in the CUDA_PATH and not require a bin-subfolder, or if one could specify the folder where the filter should look manually.

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.