DMM-PyTorch


NameDMM-PyTorch JSON
Version 0.1 PyPI version JSON
download
home_pagehttps://github.com/Baoliang93/DMM
SummaryDebiased Mapping for Full-Reference Image Quality Assessment
upload_time2024-09-16 13:01:03
maintainerNone
docs_urlNone
authorBaoliang CHEN
requires_pythonNone
licenseMIT
keywords pytorch quality debiased full-reference metric
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Debiased Mapping for Full-Reference Image Quality Assessment

This is the repository of paper [Debiased Mapping for Full-Reference Image Quality Assessment](https://arxiv.org/abs/2302.11464). 

### Highlights:
* The perception bias of existing deep-feature based FR-IQA measures is explored, which may cause inferior performance on misaligned features and restored content.
* We propose an SVD-based debiased mapping to mitigate the perception bias. Specifically, the SVs distance and base angle consistency are designed to capture and measure the feature distortion reliably.


### ====== PyTorch Implementation ======
**Installation:** 
- ```pip install DMM-PyTorch```

**Requirements:**  
- Python >= 3.6
- PyTorch >= 1.0

**Usage:** 
```python

from DMM_PyTorch import DMM
from torchvision import transforms
from PIL import Image

def prepare_PIL_Image(PIL_Image):
    msize = min(PIL_Image.size)
    if  msize>128:
        tar_size = max(int(msize/(1.0*48))*32,128)
        image =transforms.functional.resize(PIL_Image,tar_size)
    image = transforms.ToTensor()(image)
    return image.unsqueeze(0)

model = DMM().cuda()

ref_pth =  './Images/I04.BMP'  
dist_pth =  './Images/i04_24_2.bmp' 
  
ref =  prepare_PIL_Image(Image.open(ref_pth).convert("RGB")).cuda()
dist = prepare_PIL_Image(Image.open(dist_pth).convert("RGB")).cuda()

dmm_score = model(ref, dist)
print(dmm_score)
```
or

```bash
git clone https://github.com/Baoliang93/DMM
cd DMM_PyTorch
python DMM.py --ref <ref_path> --dist <dist_path>
```




            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Baoliang93/DMM",
    "name": "DMM-PyTorch",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "pytorch, Quality, Debiased, Full-reference, metric",
    "author": "Baoliang CHEN",
    "author_email": "blchen@scnu.edu.cn",
    "download_url": "https://files.pythonhosted.org/packages/b2/89/0c22052f021c89602adc78d75aebee4dbed171f5f6d93d968f29e7521d6c/DMM_PyTorch-0.1.tar.gz",
    "platform": "python",
    "description": "# Debiased Mapping for Full-Reference Image Quality Assessment\r\n\r\nThis is the repository of paper [Debiased Mapping for Full-Reference Image Quality Assessment](https://arxiv.org/abs/2302.11464). \r\n\r\n### Highlights:\r\n* The perception bias of existing deep-feature based FR-IQA measures is explored, which may cause inferior performance on misaligned features and restored content.\r\n* We propose an SVD-based debiased mapping to mitigate the perception bias. Specifically, the SVs distance and base angle consistency are designed to capture and measure the feature distortion reliably.\r\n\r\n\r\n### ====== PyTorch Implementation ======\r\n**Installation:** \r\n- ```pip install DMM-PyTorch```\r\n\r\n**Requirements:**  \r\n- Python >= 3.6\r\n- PyTorch >= 1.0\r\n\r\n**Usage:** \r\n```python\r\n\r\nfrom DMM_PyTorch import DMM\r\nfrom torchvision import transforms\r\nfrom PIL import Image\r\n\r\ndef prepare_PIL_Image(PIL_Image):\r\n    msize = min(PIL_Image.size)\r\n    if  msize>128:\r\n        tar_size = max(int(msize/(1.0*48))*32,128)\r\n        image =transforms.functional.resize(PIL_Image,tar_size)\r\n    image = transforms.ToTensor()(image)\r\n    return image.unsqueeze(0)\r\n\r\nmodel = DMM().cuda()\r\n\r\nref_pth =  './Images/I04.BMP'  \r\ndist_pth =  './Images/i04_24_2.bmp' \r\n  \r\nref =  prepare_PIL_Image(Image.open(ref_pth).convert(\"RGB\")).cuda()\r\ndist = prepare_PIL_Image(Image.open(dist_pth).convert(\"RGB\")).cuda()\r\n\r\ndmm_score = model(ref, dist)\r\nprint(dmm_score)\r\n```\r\nor\r\n\r\n```bash\r\ngit clone https://github.com/Baoliang93/DMM\r\ncd DMM_PyTorch\r\npython DMM.py --ref <ref_path> --dist <dist_path>\r\n```\r\n\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Debiased Mapping for Full-Reference Image Quality Assessment",
    "version": "0.1",
    "project_urls": {
        "Homepage": "https://github.com/Baoliang93/DMM"
    },
    "split_keywords": [
        "pytorch",
        " quality",
        " debiased",
        " full-reference",
        " metric"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cb306f7749fee152bae2303803a6738e5a69afaec65ca633964dfff573aa3cfe",
                "md5": "b924bfb7ede2e3431fada8ecd390a4d7",
                "sha256": "f66ff90a95d2b548738c6288720300db327f2c0a18f7c90bb6c0c5c7d7a493e3"
            },
            "downloads": -1,
            "filename": "DMM_PyTorch-0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b924bfb7ede2e3431fada8ecd390a4d7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5480,
            "upload_time": "2024-09-16T13:01:01",
            "upload_time_iso_8601": "2024-09-16T13:01:01.584743Z",
            "url": "https://files.pythonhosted.org/packages/cb/30/6f7749fee152bae2303803a6738e5a69afaec65ca633964dfff573aa3cfe/DMM_PyTorch-0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b2890c22052f021c89602adc78d75aebee4dbed171f5f6d93d968f29e7521d6c",
                "md5": "d337ff076e1a47718eb022789a84db7c",
                "sha256": "80b1ba071a0cead87eb65e55906c11206ecdc217d6a5653dfc2df117f20fef5f"
            },
            "downloads": -1,
            "filename": "DMM_PyTorch-0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "d337ff076e1a47718eb022789a84db7c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5174,
            "upload_time": "2024-09-16T13:01:03",
            "upload_time_iso_8601": "2024-09-16T13:01:03.160399Z",
            "url": "https://files.pythonhosted.org/packages/b2/89/0c22052f021c89602adc78d75aebee4dbed171f5f6d93d968f29e7521d6c/DMM_PyTorch-0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-16 13:01:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Baoliang93",
    "github_project": "DMM",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "dmm-pytorch"
}
        
Elapsed time: 0.42296s