{ "info": { "author": "Ziyang Hu", "author_email": "hu.ziyang@cantab.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3" ], "description": "# DCT (Discrete Cosine Transform) for pytorch\n\n[![Build Status](https://travis-ci.com/zh217/torch-dct.svg?branch=master)](https://travis-ci.com/zh217/torch-dct)\n[![codecov](https://codecov.io/gh/zh217/torch-dct/branch/master/graph/badge.svg)](https://codecov.io/gh/zh217/torch-dct)\n[![PyPI version](https://img.shields.io/pypi/v/torch-dct.svg)](https://pypi.python.org/pypi/torch-dct/)\n[![PyPI version](https://img.shields.io/pypi/pyversions/torch-dct.svg)](https://pypi.python.org/pypi/torch-dct/)\n[![PyPI status](https://img.shields.io/pypi/status/torch-dct.svg)](https://pypi.python.org/pypi/torch-dct/)\n[![GitHub license](https://img.shields.io/github/license/zh217/torch-dct.svg)](https://github.com/zh217/torch-dct/blob/master/LICENSE)\n\n\nThis library implements DCT in terms of the built-in FFT operations in pytorch so that\nback propagation works through it, on both CPU and GPU. For more information on\nDCT and the algorithms used here, see \n[Wikipedia](https://en.wikipedia.org/wiki/Discrete_cosine_transform) and the paper by\n[J. Makhoul](https://ieeexplore.ieee.org/document/1163351/). This\n[StackExchange article](https://dsp.stackexchange.com/questions/2807/fast-cosine-transform-via-fft)\nmight also be helpful.\n\nThe following are currently implemented:\n\n* 1-D DCT-I and its inverse (which is a scaled DCT-I)\n* 1-D DCT-II and its inverse (which is a scaled DCT-III)\n* 2-D DCT-II and its inverse (which is a scaled DCT-III)\n* 3-D DCT-II and its inverse (which is a scaled DCT-III)\n\n## Install\n\n```\npip install torch-dct\n```\n\nRequires `torch>=0.4.1` (lower versions are probably OK but I haven't tested them).\n\nYou can run test by getting the source and run `pytest`. To run the test you also\nneed `scipy` installed.\n\n## Usage\n\n```python\nimport numpy as np\nimport torch\nimport torch_dct as dct\n\nx = torch.tensor(np.random.normal(size=(1, 200)))\nX = dct.dct(x) # DCT-II done through the last dimension\ny = dct.idct(X) # scaled DCT-III done through the last dimension\nassert (torch.abs(x - y)).sum() < 1e-10 # x == y within numerical tolerance\n```\n\n`dct.dct1` and `dct.idct1` are for DCT-I and its inverse. The usage is the same.\n\nJust replace `dct` and `idct` by `dct_2d`, `dct_3d`, `idct_2d`, `idct_3d`, etc\nto get the multidimensional versions.\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/zh217/torch-dct", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "torch-dct", "package_url": "https://pypi.org/project/torch-dct/", "platform": "any", "project_url": "https://pypi.org/project/torch-dct/", "project_urls": { "Homepage": "https://github.com/zh217/torch-dct" }, "release_url": "https://pypi.org/project/torch-dct/0.1.5/", "requires_dist": [ "torch (>=0.4.1)" ], "requires_python": "", "summary": "Discrete Cosine Transform (DCT) for pytorch", "version": "0.1.5" }, "last_serial": 4299206, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "7831b038c27ce0bc56a5421ece605151", "sha256": "7e993bdd518c2f366b2fc13597498bf272462a8fdab15d7de7a7730a69263662" }, "downloads": -1, "filename": "torch_dct-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "7831b038c27ce0bc56a5421ece605151", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2166, "upload_time": "2018-09-21T14:34:14", "url": "https://files.pythonhosted.org/packages/b6/fc/74e48c9fcb3137a618ace406eef6881db644fa8e7064f54e867373a2a2b9/torch_dct-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cba29d7cf1e7b5cfa38d7fb852c331b5", "sha256": "ffef9b5a7d2fdd4fef5986c6194a520a8b46a2dcad54a66a1b2a77744e400373" }, "downloads": -1, "filename": "torch-dct-0.1.0.tar.gz", "has_sig": false, "md5_digest": "cba29d7cf1e7b5cfa38d7fb852c331b5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2269, "upload_time": "2018-09-21T14:34:15", "url": "https://files.pythonhosted.org/packages/62/9f/1aeead7e14fde0967963c1095eeb0eb1028d6dd47ebfa87e699398b60a0b/torch-dct-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "4fea51be90c8797a93b8913a5dc40ea9", "sha256": "0324ffed68fcc4abb903fc3bda82312dc1f04f7279ccb0d6009df99f58c42b6f" }, "downloads": -1, "filename": "torch_dct-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "4fea51be90c8797a93b8913a5dc40ea9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2313, "upload_time": "2018-09-21T15:49:40", "url": "https://files.pythonhosted.org/packages/48/40/a1dc269d45e75e0731c8bde167b60ac1ffb5f9fe3b1febffbe2a4afe1f14/torch_dct-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "12d73d789c1caa2ca37f7a4fd35fc810", "sha256": "711f08eb2d866bd17b90aacaaa8d62e2f000c702cf95e16744dba5297dad11c0" }, "downloads": -1, "filename": "torch-dct-0.1.1.tar.gz", "has_sig": false, "md5_digest": "12d73d789c1caa2ca37f7a4fd35fc810", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2457, "upload_time": "2018-09-21T15:49:41", "url": "https://files.pythonhosted.org/packages/0a/21/4b4af00fba8315959ce5582038848e576edc40f6610f64f359638953bd06/torch-dct-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "54d38368ac4a7b37a03a37e189dc14fe", "sha256": "91be55e8e31d2f9df5b57c6a0bbba5d954eb375b7de98e501543ada3e8118b94" }, "downloads": -1, "filename": "torch_dct-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "54d38368ac4a7b37a03a37e189dc14fe", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2539, "upload_time": "2018-09-22T04:49:16", "url": "https://files.pythonhosted.org/packages/c1/a6/e6dfcef656558a1a3702e398d1b1e4dbbed1c2f958aa496d0533c87ce2ec/torch_dct-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "db2c5e44ad0de1225f42ac56dee39bff", "sha256": "165734bdfbb2ccb1735cc04f0c210656ac35b1f01c7cd757550e07a02d42cd35" }, "downloads": -1, "filename": "torch-dct-0.1.2.tar.gz", "has_sig": false, "md5_digest": "db2c5e44ad0de1225f42ac56dee39bff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2663, "upload_time": "2018-09-22T04:49:18", "url": "https://files.pythonhosted.org/packages/77/33/69140f485889fe5bd1ea67deb310ac49b47f21a1cf42e103cfd23d62cdb0/torch-dct-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "915978d43832ed47bd5607edfdbece86", "sha256": "2652310cac65e88c5d1c35a480cfefbcfc6139a5a0b7d9d44f6c58662197a369" }, "downloads": -1, "filename": "torch_dct-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "915978d43832ed47bd5607edfdbece86", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4719, "upload_time": "2018-09-22T05:28:03", "url": "https://files.pythonhosted.org/packages/a5/f5/07e4e01f348a08cf659410a6830d6cb89d76d08daabfbe9789d338fea0ba/torch_dct-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dafc380c9dbc64797fa6060fbe3b89f2", "sha256": "b694f58832f08b86e9da8ae4870595b3cec7640a9a2ad3b949528200738f8a86" }, "downloads": -1, "filename": "torch-dct-0.1.3.tar.gz", "has_sig": false, "md5_digest": "dafc380c9dbc64797fa6060fbe3b89f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3242, "upload_time": "2018-09-22T05:28:05", "url": "https://files.pythonhosted.org/packages/7b/3b/d21958f6bf76eedf08c8938abe2d83b920032ecebb7e3eef0c9213fc5f31/torch-dct-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "6606b3e6102c164a4e357d3f33cdf2c1", "sha256": "b80f1e18a21716228c73eb52583da007a7f0eead4f10f2654d8a2673d17f6b7c" }, "downloads": -1, "filename": "torch_dct-0.1.4-py3-none-any.whl", "has_sig": false, "md5_digest": "6606b3e6102c164a4e357d3f33cdf2c1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4719, "upload_time": "2018-09-22T05:38:47", "url": "https://files.pythonhosted.org/packages/a2/9f/d6d213562a3a6420824e41189d367a9e4e20138788674559b06519be2ac3/torch_dct-0.1.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9977a67f829f1c17929ac1191df3e2ca", "sha256": "3dde3064260cbf9f9064e4b7b4a8bd4c2a8811fcda3c4c99bbfae957e18c6471" }, "downloads": -1, "filename": "torch-dct-0.1.4.tar.gz", "has_sig": false, "md5_digest": "9977a67f829f1c17929ac1191df3e2ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3239, "upload_time": "2018-09-22T05:38:49", "url": "https://files.pythonhosted.org/packages/8f/45/6e75c6d0bbe5b93c35b7223d5b84f84c074106e8c72b95b9d2a3c9af42ae/torch-dct-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "24fa949ffbaafd5ca2732e59a5e3648c", "sha256": "c72bba210e3b5e6f526ce4eee1d2cd7407eb2095dafc056e38c07629918fc22a" }, "downloads": -1, "filename": "torch_dct-0.1.5-py3-none-any.whl", "has_sig": false, "md5_digest": "24fa949ffbaafd5ca2732e59a5e3648c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4768, "upload_time": "2018-09-22T09:41:19", "url": "https://files.pythonhosted.org/packages/8f/20/6f6280ed77a0382ae6226c5250c02f64924b8fc73d9aa7d73b9c6b3ee6a5/torch_dct-0.1.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cf60902318d940dd90d9f0377b3b3bed", "sha256": "4cc07e715e88ff19c84124185a2e711791f6e9aa63b70fae09a141ef5bbbd474" }, "downloads": -1, "filename": "torch-dct-0.1.5.tar.gz", "has_sig": false, "md5_digest": "cf60902318d940dd90d9f0377b3b3bed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3254, "upload_time": "2018-09-22T09:41:20", "url": "https://files.pythonhosted.org/packages/76/71/0759c38b318b7653d58d93eb8d374a5bb08b5bb07151a56fcf69b00ec296/torch-dct-0.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "24fa949ffbaafd5ca2732e59a5e3648c", "sha256": "c72bba210e3b5e6f526ce4eee1d2cd7407eb2095dafc056e38c07629918fc22a" }, "downloads": -1, "filename": "torch_dct-0.1.5-py3-none-any.whl", "has_sig": false, "md5_digest": "24fa949ffbaafd5ca2732e59a5e3648c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4768, "upload_time": "2018-09-22T09:41:19", "url": "https://files.pythonhosted.org/packages/8f/20/6f6280ed77a0382ae6226c5250c02f64924b8fc73d9aa7d73b9c6b3ee6a5/torch_dct-0.1.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cf60902318d940dd90d9f0377b3b3bed", "sha256": "4cc07e715e88ff19c84124185a2e711791f6e9aa63b70fae09a141ef5bbbd474" }, "downloads": -1, "filename": "torch-dct-0.1.5.tar.gz", "has_sig": false, "md5_digest": "cf60902318d940dd90d9f0377b3b3bed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3254, "upload_time": "2018-09-22T09:41:20", "url": "https://files.pythonhosted.org/packages/76/71/0759c38b318b7653d58d93eb8d374a5bb08b5bb07151a56fcf69b00ec296/torch-dct-0.1.5.tar.gz" } ] }