Git Product home page Git Product logo

Comments (15)

Yijunmaverick avatar Yijunmaverick commented on August 15, 2024 3

@NVFX This is really awesome! Thanks for your interests and efforts. I try your demo4k.sh with another style example. The transfer result (3.5K*1.5K, takes 4.5 minutes) is shown below:

My principle of selecting the content and style is that before running the algorithm, I could somehow imagine what the result will be like in mind (e.g., spring to winter, day to night).

Just want to double check with you. It looks that such an interleave strategy is still at the cost of sacrificing the resolution a little bit, right? When I zoom in the result, I found that details on the mountain and grass are not as clear as those in the content.

The result:
example1

The content:
content1

The style:
style1

from fastphotostyle.

NVFX avatar NVFX commented on August 15, 2024 2

@wesleyw72 NvBlit interleaves the content image in the horizontal and vertical direction for inference and performs the inverse when all tiles are processed. If you run the script you should see this in the content and results folder. The smoothing step is performed at the end.

NvBlit works with just about any image processing algorithm including video, texture synthesis, etc.

Please test the app & send me your feedback. I can certainly create a python library to manage GPU resources. I will then add this work to my schedule (if approved).

from fastphotostyle.

NVFX avatar NVFX commented on August 15, 2024 2

A quick test this morning...

final

content1
+
style1

from fastphotostyle.

moeedkundi avatar moeedkundi commented on August 15, 2024 1

@NVFX do tell..

from fastphotostyle.

NVFX avatar NVFX commented on August 15, 2024 1

It is possible to scale the image across multiple passes (or GPUs in parallel) to generate an HD style transfer without changing your code or script in any significant way. I don't have an official role on this project, but I am very interested in this problem.

from fastphotostyle.

AliFlux avatar AliFlux commented on August 15, 2024

I'm facing the same issue. The memory isn't cleared when the function ends, somehow it accumulates and crashes the program.

from fastphotostyle.

midael avatar midael commented on August 15, 2024

Same issue here. Amazing demo/sw, but I would really love to try out this code on at least 4k UHD resolution images (3840x2160). But like others have noted, GeForce 1080 runs out of memory somewhere around 800x600 resolution.

from fastphotostyle.

NVFX avatar NVFX commented on August 15, 2024

I can fix this issue.

from fastphotostyle.

NVFX avatar NVFX commented on August 15, 2024

@moeedkundi If you extract this code locally and run demo4k.sh in your FastPhotoStyle directory. It will execute the following command:

./NvBlit -w 3840 -l 2160 -i 700 -s ./images/style1.png -c $content_image -o $output_image -x "python demo4k.py --style_image_path @style_image --content_image_path @content_image --output_image_path @output_image"

...Which will generate a 4k version of the demo.sh content.

example1

fps4k.zip

from fastphotostyle.

wesleyw72 avatar wesleyw72 commented on August 15, 2024

@NVFX What is NvBlit?

from fastphotostyle.

NVFX avatar NVFX commented on August 15, 2024

@wesleyw72 It is an Ubuntu 16.04 c++ application that converts your content image into a set of interleaved tiles. The tiles are of -i 700 size in this case, but it is the largest square content image you can send your GPU. The output is automatically fed to your neural network and merged together as the final pass. The code can be easily modified to send each GPU (locally or remote) a copy of the image for processing in parallel.

There is no python version at this time and the square tile size is a simplification.

demo4k.sh downloads the content EXCEPT the following lines are commented out to work with high resolution images:

do not resize for NvBlit

#convert -resize 25% content1.png content1.png;
#convert -resize 50% style1.png style1.png;

from fastphotostyle.

wesleyw72 avatar wesleyw72 commented on August 15, 2024

@NVFX Awesome! Is the source code available for this tool? Mainly interested in the technique used for merging the images. Is it a simple merge or does it do something clever?

from fastphotostyle.

wesleyw72 avatar wesleyw72 commented on August 15, 2024

@NVFX This is great work. Do you know of any resources where I could learn more about the interleaving technique?

from fastphotostyle.

NVFX avatar NVFX commented on August 15, 2024

@wesleyw72 @Yijunmaverick There is a final change the requires modification of the style transfer algorithm. I will discuss this information with my manager and perhaps I can get involved to fix it.

To increase resolution using NvBlit interleaving algorithm:

  1. Adding noise to the ease the resolution.
  2. Dithering interleaved cells based on image complexity.

Disclosing the algorithm and source is the next step in a c++ & python library.

from fastphotostyle.

Yijunmaverick avatar Yijunmaverick commented on August 15, 2024

@NVFX Thanks. Look forward! I could get the big picture of how such an interleave strategy works. Interested in details.

from fastphotostyle.

Related Issues (20)

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.