Giter Club home page Giter Club logo

dists's People

Contributors

dingkeyan93 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

dists's Issues

Getting below runtime error when i try to validate the Model

Traceback (most recent call last):
File "E:\Softwares\AI_Tools\Image_Quality_Assesment\DISTS\DISTS_pytorch\DISTS_pt.py", line 139, in
score = model(ref, dist)
File "D:\ProgramData\Anaconda3\envs\DISTS\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "E:\Softwares\AI_Tools\Image_Quality_Assesment\DISTS\DISTS_pytorch\DISTS_pt.py", line 106, in forward
xy_cov = (feats0[k]feats1[k]).mean([2,3],keepdim=True) - x_meany_mean
RuntimeError: The size of tensor a (455) must match the size of tensor b (451) at non-singleton dimension 3

How do I run DISTS on Jetson nano?

hi, How do I run DISTS on Jetson nano? It gives me an error message "Illegal instruction (core dumped)" . Is it the Jetson nano architecture that doesn't support it?

Texture classification

Thanks for sharing the code. May I ask do you have the code for application of texture classification in your paper?

Unstable TensorFlow Training and a Fix

I found the TensorFlow implementation causes NaN when I'm using it to train my deep CNN. This turns out to be due to the tf.sqrt(conv). Replacing it with return tf.sqrt(tf.maximum(conv, 1e-5)) fixes the problem! I saw the pytorch version does (out + 1e-12).sqrt(), so maybe that would be the proper way?

pytorch pretrained vgg

Not an issue per se, more like a suggestion.

I see you use pytorch pretrained vgg without correctly normalizing the image (all pytorch pretrained models assume the image was normalized with transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]) )

Retraining with the correct normalization might give you even better results.

training code

I think it is amazing! Can you provide the training code? Thank you!

Training code

Hi Keyan, super great work! I was wondering could you also provide the training code of DISTS?

Requirements for inference mode and path to weights.pt

It seems that torchvision needs to be included in the requirements list. I tried to create a conda environment with just pytorch and python3.7, but that didn't work.

Conda environment created with:

    conda create --name dists python=3.7
    pip install -r requirements.txt

Error:

Traceback (most recent call last):
  File "DISTS_pt.py", line 8, in <module>
    from torchvision import models, transforms
ModuleNotFoundError: No module named 'torchvision'

Adding the torchvision to the requirements list fix this.
Additionally, when using the conda env, the path to the weights file DISTS_pytorch/weights.pt seems to point to an incorrect path. The sys.prefix points to the env directory (example: /home/karinabogdan/anaconda3/envs/dists/) and not the weights file in DISTS_pytorch/

python DISTS_pt.py --ref ../example_input/12_enh.jpg --dist ../example_input/12_raw.jpg
Traceback (most recent call last):
  File "DISTS_pt.py", line 134, in <module>
    model = DISTS().to(device)
  File "DISTS_pt.py", line 63, in __init__
    weights = torch.load(os.path.join(sys.prefix, 'weights.pt'))
  File "/home/karinabogdan/anaconda3/envs/dists/lib/python3.7/site-packages/torch/serialization.py", line 581, in load
    with _open_file_like(f, 'rb') as opened_file:
  File "/home/karinabogdan/anaconda3/envs/dists/lib/python3.7/site-packages/torch/serialization.py", line 230, in _open_file_like
    return _open_file(name_or_buffer, mode)
  File "/home/karinabogdan/anaconda3/envs/dists/lib/python3.7/site-packages/torch/serialization.py", line 211, in __init__
    super(_open_file, self).__init__(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: '/home/karinabogdan/anaconda3/envs/dists/weights.pt'

I fixed that by changing the line:

weights = torch.load(os.path.join(sys.prefix, 'weights.pt'))

to

from pathlib import Path, PurePosixPath
weights = torch.load(str(PurePosixPath(Path.cwd()).joinpath('weights.pt')))

but I am not sure if this is the best way to handle this.

Wildly different results when using DISTS from different github repos

I used both:
https://github.com/dingkeyan93/DISTS/commits/master/DISTS_pytorch/DISTS_pt.py
(and)
https://github.com/dingkeyan93/IQA-optimization/commits/master/IQA_pytorch/DISTS.py

And the results are very different so which one is the official one?
image

(Folder name is irrelevant it is what I named my project without knowing there are similar projects out there with same name, its a custom project has nothing to do with other libraries out there named like it)

DISTS does not work with mixed precision, no warning given

I have spent hours and hours trying to figure out why DISTS does not work. It's because I was using mixed precision and it needs full 32 bit for whatever reason. The real issue is that it doesn't fail to run and there are no warnings anywhere or signs of it being a data type issue, leaving you completely clueless on what is going on. I found the problem through brute force.
With DISTS I had to cut my batch size down to 1 even on a 4090 and it trains at half the speed of LPIPS using mixed precision. Practically unusable without mixed precision.

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.