{ "info": { "author": "Gongfan Fang", "author_email": "fgfvain97@zju.edu.cn", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Pytorch MS-SSIM\n\nFast and differentiable MS-SSIM and SSIM for pytorch 1.0+\n\nAll calculations will be on the same device as inputs.\n\n# update\n_2019.6.17_ \nNow it is faster than compare_ssim thanks to [One-sixth's contribution](https://github.com/VainF/pytorch-msssim/issues/3)\n\n# Install\n```bash\npython setup.py install\n```\nor\n```bash\npip install pytorch-msssim\n```\n\n# Example\n\n```python\nfrom pytorch_msssim import ssim, ms_ssim, SSIM, MS_SSIM\n# X: (N,3,H,W) a batch of RGB images with values ranging from 0 to 255.\n# Y: (N,3,H,W) \nssim_val = ssim( X, Y, data_range=255, size_average=False) # return (N,)\nms_ssim_val = ms_ssim( X, Y, data_range=255, size_average=False ) #(N,)\n\n# or set 'size_average=True' to get a scalar value as loss.\nssim_loss = ssim( X, Y, data_range=255, size_average=True) # return a scalar value\nms_ssim_loss = ms_ssim( X, Y, data_range=255, size_average=True )\n\n# or reuse windows with SSIM & MS_SSIM. \nssim_module = SSIM(win_size=11, win_sigma=1.5, data_range=255, size_average=True, channel=3)\nms_ssim_module = MS_SSIM(win_size=11, win_sigma=1.5, data_range=255, size_average=True, channel=3)\n\nssim_loss = ssim_module(X, Y)\nms_ssim_loss = ms_ssim_module(X, Y)\n```\n\n# Tests\n\nCompared with [skimage.measure.compare_ssim](https://scikit-image.org/docs/dev/api/skimage.measure.html#skimage.measure.compare_ssim) on CPU.\n\nThe outputs:\n```\nDownloading test image...\n====> Single Image\nsigma=0.000000 compare_ssim=1.000000 (417.248964 ms) ssim_torch=1.000000 (257.593870 ms)\nsigma=1.000000 compare_ssim=0.991320 (326.905012 ms) ssim_torch=0.991320 (135.488033 ms)\nsigma=2.000000 compare_ssim=0.966521 (485.862017 ms) ssim_torch=0.966520 (237.199068 ms)\nsigma=3.000000 compare_ssim=0.928799 (323.492050 ms) ssim_torch=0.928797 (148.905993 ms)\nsigma=4.000000 compare_ssim=0.882271 (290.801048 ms) ssim_torch=0.882267 (146.914005 ms)\nsigma=5.000000 compare_ssim=0.831310 (282.787085 ms) ssim_torch=0.831306 (148.653984 ms)\nsigma=6.000000 compare_ssim=0.778222 (308.619022 ms) ssim_torch=0.778217 (147.915840 ms)\nsigma=7.000000 compare_ssim=0.726444 (290.637970 ms) ssim_torch=0.726438 (133.754253 ms)\nsigma=8.000000 compare_ssim=0.676345 (294.582129 ms) ssim_torch=0.676339 (144.154072 ms)\nsigma=9.000000 compare_ssim=0.629922 (300.610065 ms) ssim_torch=0.629916 (141.150951 ms)\nPass\n====> Batch\nPass\n```\n\n# An autoencoder trained with MS_SSIM\n\n![results](https://github.com/VainF/Images/blob/master/pytorch_msssim/ae_ms_ssim.jpg)\n*left: original image, right: reconstructed image*\n\n# References\n\n[https://github.com/jorge-pessoa/pytorch-msssim](https://github.com/jorge-pessoa/pytorch-msssim) \n[https://ece.uwaterloo.ca/~z70wang/research/ssim/](https://ece.uwaterloo.ca/~z70wang/research/ssim/) \n[https://ece.uwaterloo.ca/~z70wang/publications/msssim.pdf](https://ece.uwaterloo.ca/~z70wang/publications/msssim.pdf) \n[Matlab Code](https://ece.uwaterloo.ca/~z70wang/research/iwssim/) \n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/VainF/pytorch-msssim", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pytorch-msssim", "package_url": "https://pypi.org/project/pytorch-msssim/", "platform": "", "project_url": "https://pypi.org/project/pytorch-msssim/", "project_urls": { "Homepage": "https://github.com/VainF/pytorch-msssim" }, "release_url": "https://pypi.org/project/pytorch-msssim/0.1.3/", "requires_dist": [ "torch" ], "requires_python": "", "summary": "Fast and differentiable MS-SSIM and SSIM for pytorch.", "version": "0.1.3" }, "last_serial": 5496143, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "f6903e5c19122e3042f2479348a14395", "sha256": "88034a4c697baf54d52242054999d74f04ab8982890acd9688af640298f2d9d2" }, "downloads": -1, "filename": "pytorch_msssim-0.1.1-py3.7.egg", "has_sig": false, "md5_digest": "f6903e5c19122e3042f2479348a14395", "packagetype": "bdist_egg", "python_version": "3.7", "requires_python": null, "size": 8351, "upload_time": "2019-06-17T11:44:05", "url": "https://files.pythonhosted.org/packages/75/32/4bc715592a725e8ad1efc8b391d77543ebfe0f31ec38aaf9a11042af0cfd/pytorch_msssim-0.1.1-py3.7.egg" }, { "comment_text": "", "digests": { "md5": "c83f156f4f1ce6f7a7e22dc88d726a7f", "sha256": "998ff42fceb8906ecff2bbbecc2435e645ace8aa54259efe4311d0ae87256c5d" }, "downloads": -1, "filename": "pytorch_msssim-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "c83f156f4f1ce6f7a7e22dc88d726a7f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5738, "upload_time": "2019-05-11T08:12:00", "url": "https://files.pythonhosted.org/packages/ea/8e/7f80fe4c40befa292e80bf0c7e72edbdce0626e6d161d228df0ec16d40c0/pytorch_msssim-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dc6ba571164ecbf7c3ceb2a9a919f084", "sha256": "62685d12357c329659a32fdfe98bfcd5227708ac082612bd3c26699cb02eb001" }, "downloads": -1, "filename": "pytorch_msssim-0.1.1.tar.gz", "has_sig": false, "md5_digest": "dc6ba571164ecbf7c3ceb2a9a919f084", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4541, "upload_time": "2019-05-11T08:12:03", "url": "https://files.pythonhosted.org/packages/f2/45/6cd57ead7a92e729427b639ddafc4226cec0cdcdc4a7da6fd315c645e067/pytorch_msssim-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "30ade0ad0617863941824fc2342a32e1", "sha256": "1464c6fb84016c821ef798b0efa5baf7723de8a50acba0a25914f8275daa3f2e" }, "downloads": -1, "filename": "pytorch_msssim-0.1.2-py3.7.egg", "has_sig": false, "md5_digest": "30ade0ad0617863941824fc2342a32e1", "packagetype": "bdist_egg", "python_version": "3.7", "requires_python": null, "size": 7985, "upload_time": "2019-07-07T03:39:59", "url": "https://files.pythonhosted.org/packages/e2/77/899de7299255aace9c35d547a561ddaed48989235cc2b6c673569cb832f6/pytorch_msssim-0.1.2-py3.7.egg" }, { "comment_text": "", "digests": { "md5": "f8adf8aef43452c1c2003c32990a2269", "sha256": "ffb2697244a2bdd0341df4391d3f8de02ef2cb6591910aa05d1c1f4e764e4264" }, "downloads": -1, "filename": "pytorch_msssim-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "f8adf8aef43452c1c2003c32990a2269", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5727, "upload_time": "2019-06-17T11:44:03", "url": "https://files.pythonhosted.org/packages/14/31/fcd8ca660dbb10ab592b828da96ac31963d3261b4382393ccff995baa33a/pytorch_msssim-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fc05886c9e6a4273a6f5a4227c62f4e5", "sha256": "5c39cd606410760ae8836e12d5f8105cc05284b7966ca3453aaa91045bccccc8" }, "downloads": -1, "filename": "pytorch_msssim-0.1.2.tar.gz", "has_sig": false, "md5_digest": "fc05886c9e6a4273a6f5a4227c62f4e5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4540, "upload_time": "2019-06-17T11:44:07", "url": "https://files.pythonhosted.org/packages/e0/d7/ad68c24d912e2f8dd52dd433cf20eefe300749c4cf0b8079262d69bf9300/pytorch_msssim-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "351af49bc45a984e0314dbba372feec6", "sha256": "8c94303baaeec2b451d7ee86eaba9cb8378640fb4f94fc66813fb5127773a28f" }, "downloads": -1, "filename": "pytorch_msssim-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "351af49bc45a984e0314dbba372feec6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5408, "upload_time": "2019-07-07T03:39:57", "url": "https://files.pythonhosted.org/packages/a2/13/c77fcd9789619c904afcbd4717389afa9939e6f5b7aa75f803d3129cb598/pytorch_msssim-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ac3bc6d134b1f42c90ac1477e7c0541f", "sha256": "aaf36438f5f1eacbd02a128cff757e805568b2435336e0527d03b728fe883274" }, "downloads": -1, "filename": "pytorch_msssim-0.1.3.tar.gz", "has_sig": false, "md5_digest": "ac3bc6d134b1f42c90ac1477e7c0541f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4233, "upload_time": "2019-07-07T03:40:01", "url": "https://files.pythonhosted.org/packages/df/73/805f1622cce8c07e567acfc493a471d0e5d4d9aeb8cc5b0398df1653db90/pytorch_msssim-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "351af49bc45a984e0314dbba372feec6", "sha256": "8c94303baaeec2b451d7ee86eaba9cb8378640fb4f94fc66813fb5127773a28f" }, "downloads": -1, "filename": "pytorch_msssim-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "351af49bc45a984e0314dbba372feec6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5408, "upload_time": "2019-07-07T03:39:57", "url": "https://files.pythonhosted.org/packages/a2/13/c77fcd9789619c904afcbd4717389afa9939e6f5b7aa75f803d3129cb598/pytorch_msssim-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ac3bc6d134b1f42c90ac1477e7c0541f", "sha256": "aaf36438f5f1eacbd02a128cff757e805568b2435336e0527d03b728fe883274" }, "downloads": -1, "filename": "pytorch_msssim-0.1.3.tar.gz", "has_sig": false, "md5_digest": "ac3bc6d134b1f42c90ac1477e7c0541f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4233, "upload_time": "2019-07-07T03:40:01", "url": "https://files.pythonhosted.org/packages/df/73/805f1622cce8c07e567acfc493a471d0e5d4d9aeb8cc5b0398df1653db90/pytorch_msssim-0.1.3.tar.gz" } ] }