# Deep Image Structure and Texture Similarity (DISTS) Metric
This is the repository of paper [Image Quality Assessment: Unifying Structure and Texture Similarity](https://arxiv.org/abs/2004.07728).
### Highlights:
1. A full-reference IQA model correlated well with human perception of image quality.
2. It is robust to texture variance (e.g., evaluating the images generated by GANs) and mild geometric transformations (e.g., evaluating the image pair that are not strictly point-by-point aligned).
3. It can be employed as the objective function in various optimization problems. <!-- (The best practice: pretrain with L1/L2 loss, then finetune with DISTS + GAN loss) -->
**Three implementation versions:**
1. Pytorch [```DISTS_pt.py```](/DISTS_pytorch/DISTS_pt.py) (recommend)
2. Tensorflow [```DISTS_tf.py```](/DISTS_tensorflow/DISTS_tf.py)
3. Matlab [```DISTS.m```](/DISTS_matlab/DISTS.m).
### ====== Pytorch ======
**Installation:**
- ```pip install dists-pytorch```
**Requirements:**
- Python>=3.6
- Pytorch>=1.0
**Usage:**
```python
from DISTS_pytorch import DISTS
D = DISTS()
# calculate DISTS between X, Y (a batch of RGB images, data range: 0~1)
# X: (N,3,H,W)
# Y: (N,3,H,W)
dists_value = D(X, Y)
# set 'require_grad=True, batch_average=True' to get a scalar value as loss.
dists_loss = D(X, Y, require_grad=True, batch_average=True)
dists_loss.backward()
```
or
```bash
git clone https://github.com/dingkeyan93/DISTS
cd DISTS_pytorch
python DISTS_pt.py --ref <ref_path> --dist <dist_path>
```
### ====== Tensorflow ======
**Requirements:**
- Python>=3.6
- Tensorflow>=1.15
**Usage:**
```bash
git clone https://github.com/dingkeyan93/DISTS
cd DISTS_tensorflow
python DISTS_tf.py --ref <ref_path> --dist <dist_path>
```
### ====== Matlab ======
**Requirements:**
- Matlab>=2019b
**Usage:**
```bash
git clone https://github.com/dingkeyan93/DISTS
run demo.m
help DISTS
```
### Citation
```
@article{ding2020iqa,
title={Image Quality Assessment: Unifying Structure and Texture Similarity},
author={Ding, Keyan and Ma, Kede and Wang, Shiqi and Simoncelli, Eero P.},
journal = {CoRR},
volume = {abs/2004.07728},
year={2020},
url = {https://arxiv.org/abs/2004.07728}
}
```
Raw data
{
"_id": null,
"home_page": "https://github.com/dingkeyan93/DISTS",
"name": "DISTS-pytorch",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "pytorch,similarity,VGG,texture,structure,metric",
"author": "Keyan Ding",
"author_email": "dingkeyan93@outlook.com",
"download_url": "",
"platform": "python",
"description": "# Deep Image Structure and Texture Similarity (DISTS) Metric\n\nThis is the repository of paper [Image Quality Assessment: Unifying Structure and Texture Similarity](https://arxiv.org/abs/2004.07728).\n\n\n### Highlights:\n1. A full-reference IQA model correlated well with human perception of image quality.\n2. It is robust to texture variance (e.g., evaluating the images generated by GANs) and mild geometric transformations (e.g., evaluating the image pair that are not strictly point-by-point aligned).\n3. It can be employed as the objective function in various optimization problems. <!-- (The best practice: pretrain with L1/L2 loss, then finetune with DISTS + GAN loss) -->\n\n\n**Three implementation versions:** \n1. Pytorch [```DISTS_pt.py```](/DISTS_pytorch/DISTS_pt.py) (recommend)\n2. Tensorflow [```DISTS_tf.py```](/DISTS_tensorflow/DISTS_tf.py) \n3. Matlab [```DISTS.m```](/DISTS_matlab/DISTS.m). \n\n### ====== Pytorch ======\n**Installation:** \n- ```pip install dists-pytorch```\n\n**Requirements:** \n- Python>=3.6\n- Pytorch>=1.0\n\n**Usage:** \n```python\nfrom DISTS_pytorch import DISTS\nD = DISTS()\n# calculate DISTS between X, Y (a batch of RGB images, data range: 0~1)\n# X: (N,3,H,W) \n# Y: (N,3,H,W) \ndists_value = D(X, Y)\n# set 'require_grad=True, batch_average=True' to get a scalar value as loss.\ndists_loss = D(X, Y, require_grad=True, batch_average=True) \ndists_loss.backward()\n```\nor\n\n```bash\ngit clone https://github.com/dingkeyan93/DISTS\ncd DISTS_pytorch\npython DISTS_pt.py --ref <ref_path> --dist <dist_path>\n```\n\n\n### ====== Tensorflow ======\n\n**Requirements:** \n- Python>=3.6\n- Tensorflow>=1.15\n\n**Usage:** \n```bash\ngit clone https://github.com/dingkeyan93/DISTS\ncd DISTS_tensorflow\npython DISTS_tf.py --ref <ref_path> --dist <dist_path>\n```\n\n### ====== Matlab ======\n\n**Requirements:** \n- Matlab>=2019b\n\n**Usage:** \n```bash\ngit clone https://github.com/dingkeyan93/DISTS\nrun demo.m\nhelp DISTS\n```\n\n### Citation\n```\n@article{ding2020iqa,\n title={Image Quality Assessment: Unifying Structure and Texture Similarity},\n author={Ding, Keyan and Ma, Kede and Wang, Shiqi and Simoncelli, Eero P.},\n journal = {CoRR},\n volume = {abs/2004.07728},\n year={2020},\n url = {https://arxiv.org/abs/2004.07728}\n}\n```\n\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Deep Image Structure and Texture Similarity (DISTS) Metric",
"version": "0.1",
"project_urls": {
"Homepage": "https://github.com/dingkeyan93/DISTS"
},
"split_keywords": [
"pytorch",
"similarity",
"vgg",
"texture",
"structure",
"metric"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "fa78f76cbe06c88076f6d6d5ef16a7591a7e3b7eb225e39b035e16d95f0fb89c",
"md5": "21b2d6790a062dbc445ab419b2b17c49",
"sha256": "73e54ce13e7cf3ca962ee8e433d129884ec3dc75e00a27af90525e1da760ac61"
},
"downloads": -1,
"filename": "DISTS_pytorch-0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "21b2d6790a062dbc445ab419b2b17c49",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 20501,
"upload_time": "2020-04-17T00:40:40",
"upload_time_iso_8601": "2020-04-17T00:40:40.359378Z",
"url": "https://files.pythonhosted.org/packages/fa/78/f76cbe06c88076f6d6d5ef16a7591a7e3b7eb225e39b035e16d95f0fb89c/DISTS_pytorch-0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2020-04-17 00:40:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dingkeyan93",
"github_project": "DISTS",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "torch",
"specs": [
[
">=",
"1.0"
]
]
}
],
"lcname": "dists-pytorch"
}