Giter Club home page Giter Club logo

Comments (4)

Coldog2333 avatar Coldog2333 commented on September 20, 2024

Thank you for finding this bug.
Actually, I didn't check the codes under ./unstable, you have to debug if you want to use them.
As the question you proposed, you should revise this line to
input = net(torch.stack([tensorPreprocessedFirst, tensorPreprocessedSecond], dim=1))
Hope this works. And if it works, please tell me and I will update the code in this repository.

from pytoflow.

pgodwin avatar pgodwin commented on September 20, 2024

Thanks @Coldog2333. I've been using this to help denoise VHS captures and I think I've successfully trained a model.

Having some issues saving during evaluation though:
plt.imsave(os.path.join(out_img_dir, video, sep, 'out.png'),normalize(predicted_img.permute(1, 2, 0).cpu().detach().numpy()))

Traceback (most recent call last):
  File "evaluate2.py", line 172, in <module>
    vimeo_evaluate(dataset_dir, './test-result', pathlistfile, task=task, cuda_flag=cuda_flag)
  File "evaluate2.py", line 164, in vimeo_evaluate
    plt.imsave(os.path.join(out_img_dir, str_format % count),predicted_img.permute(1, 2, 0).cpu().detach().numpy())
  File "/home/pete/.local/lib/python3.6/site-packages/matplotlib/pyplot.py", line 2133, in imsave
    return matplotlib.image.imsave(fname, arr, **kwargs)
  File "/home/pete/.local/lib/python3.6/site-packages/matplotlib/image.py", line 1496, in imsave
    rgba = sm.to_rgba(arr, bytes=True)
  File "/home/pete/.local/lib/python3.6/site-packages/matplotlib/cm.py", line 271, in to_rgba
    raise ValueError("Floating point image RGB values "
ValueError: Floating point image RGB values must be in the 0..1 range.

I'm guessing there's a way to scale the result but unsure the best method yet.

I used:

def normalize(x):
    """
    Normalize a list of sample image data in the range of 0 to 1
    : x: List of image data.  The image shape is (32, 32, 3)
    : return: Numpy array of normalized data
    """
    return np.array((x - np.min(x)) / (np.max(x) - np.min(x)))

But this seemed to return variations of brightness levels between frames.

from pytoflow.

pgodwin avatar pgodwin commented on September 20, 2024

Normalize wasn't the right approach. I've just clipped the values outside of bounds.

plt.imsave(os.path.join(out_img_dir, video, sep, 'out.png'),np.clip(predicted_img.permute(1, 2, 0).cpu().detach().numpy(),0,1))

from pytoflow.

Coldog2333 avatar Coldog2333 commented on September 20, 2024

Please see Issue#6 for the image RGB value restriction problem if needed.

from pytoflow.

Related Issues (19)

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.