{ "info": { "author": "gregunz", "author_email": "mail@gregunx.io", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Programming Language :: Python :: 3.6" ], "description": "[Documentation]: https:///gregunz.github.io/invertransforms/\n[mail@gregunz.io]: mailto:mail@gregunz.io\n\n[![](https://i.imgur.com/dFDH5Ro.jpg)](https://github.com/gregunz/invertransforms)\n\ninvertransforms\n====\n\n[![Build Status](https://img.shields.io/travis/com/gregunz/invertransforms.svg?style=for-the-badge)](https://travis-ci.com/gregunz/invertransforms)\n[![Code Coverage](https://img.shields.io/codecov/c/gh/gregunz/invertransforms?style=for-the-badge)](https://codecov.io/gh/gregunz/invertransforms)\n[![PyPI](https://img.shields.io/pypi/v/invertransforms.svg?color=blue&style=for-the-badge)](https://pypi.org/project/invertransforms)\n\nA library which turns torchvision transformations __invertible__ and __replayable__.\n\n\nInstallation\n------------\n```bash\npip install invertransforms\n```\n\nUsage\n-----\nSimply replace previous torchvision import statements and enjoy the new features.\n\n```python\n# from torchvision import transforms as T\nimport invertransforms as T\n\ntransform = T.Compose([\n T.RandomCrop(size=256),\n T.ToTensor(),\n])\n\nimg_tensor = transform(img)\n\n# invert\nimg_again = transform.invert(img_tensor)\n\n# replay\nimg_tensor2 = transform.replay(img2)\n\n# track\nfor i in range(n):\n img_tensor_i = transform.track(img_i)\n # ...\ninverse_tf = transform.get_inverse(j) # or transform[j]\nimg_j = inverse_tf(img_tensor_j)\n```\n\nAll transformations have an `inverse` transformation attached to it.\n\n```python\ninv_transform = transform.inverse()\nimg_inv = inv_transform(img)\n```\n__Notes:__\n\nIf a transformation is random, it is necessary to apply it once before calling `invert` or `inverse()`. Otherwise it will raise `InvertibleError`. \nOn the otherhand, `replay` can be called before, it will simply set the randomness on its first call.\n\n\nOne can create its own invertible transforms either by using the\npractical `Lambda` class function or by extending the `Invertible` class available\nin the `invertransforms.lib` module.\n\n\n[Documentation]\n---------------\n\nThe library's [documentation] contains the full list of [transformations](https://gregunz.github.io/invertransforms/#header-classes)\n which includes all the ones from torchvision and more.\n\nUse Cases\n---------\nThis library can be particularly useful in following situations:\n\n- Reverting a NN-model output in order to stack predictions\n\n- Applying the same (random) transformations the same way on different inputs\n\nFeatures\n--------\n- Invert any transformations, even random ones\n\n- Replay any transformations, even random ones\n\n- Track all transformations to invert them long after\n\n- All classes extend its torchvision transformation equivalent class.\n This means, you can just replace your previous torchvision import statements and it will not break your code.\n \n- Extensive unit testing (100% coverage, be safe, hopefully)\n\nRequirements\n------------\n```\npython>=3.6\n\ntorch>=1.2.0\ntorchvision>=0.4.0\n```\n\n\nFuture Improvements\n-------------------\n- [WIP] Extend the number of tranformations (e.g. random rotation and cropping (within the rotated area))\n\n- Make the transformations on tensors directly (data augmentation/transformation on GPU)\n\n\nContribute\n----------\nYou found a bug, think a feature is missing or just want to help ?\n\nPlease feel free to open an issue, pull request or contact me [mail@gregunz.io]", "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/gregunz/{name}", "keywords": "invertible,transforms,transformations,torchvision,data,augmentation,replay,replayable,invertransforms", "license": "BSD 3-Clause", "maintainer": "", "maintainer_email": "", "name": "invertransforms", "package_url": "https://pypi.org/project/invertransforms/", "platform": "any", "project_url": "https://pypi.org/project/invertransforms/", "project_urls": { "Homepage": "https://github.com/gregunz/{name}" }, "release_url": "https://pypi.org/project/invertransforms/0.2.1/", "requires_dist": null, "requires_python": "", "summary": "A library which turns torchvision transformations invertible and replayable.", "version": "0.2.1" }, "last_serial": 5974296, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "2ef0ca5a9ee01cdfd49305da5b1536ff", "sha256": "0085a4749ac6cd5ac14f6baf6be61f81541ff43642604e9514b8fb2ba0991ba8" }, "downloads": -1, "filename": "invertransforms-0.1.0.tar.gz", "has_sig": false, "md5_digest": "2ef0ca5a9ee01cdfd49305da5b1536ff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11626, "upload_time": "2019-10-13T17:19:36", "url": "https://files.pythonhosted.org/packages/fa/43/1de96cc37531995202ee7af536e555cc03532ca039512ec46e8c6f6b4d65/invertransforms-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "c17e1fe3ca1e82337829b8cbc8aadfc4", "sha256": "258561552d69f56b7a1096aa73d50dbedd59b2a531a7d06dd9b0a7593dbc7eed" }, "downloads": -1, "filename": "invertransforms-0.1.1.tar.gz", "has_sig": false, "md5_digest": "c17e1fe3ca1e82337829b8cbc8aadfc4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13766, "upload_time": "2019-10-13T17:34:27", "url": "https://files.pythonhosted.org/packages/04/ae/041f934bd0a02da96e87ce2dc150c05de9a44cb2cf345acc2efd6e0e7fdf/invertransforms-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "cf98948eaf4f05457522581d114d4c1a", "sha256": "4fb67a5fac073d1faa4b17b95c725a4f0fbe34d13a717b5acbbfe71ef8250f24" }, "downloads": -1, "filename": "invertransforms-0.1.2.tar.gz", "has_sig": false, "md5_digest": "cf98948eaf4f05457522581d114d4c1a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14659, "upload_time": "2019-10-14T08:30:56", "url": "https://files.pythonhosted.org/packages/e3/69/3f4bf195166fca0e5dc0140011b403d0a792962b969ecf66ae3b036389c5/invertransforms-0.1.2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "220d1718a512c80f471efd89c6bb0027", "sha256": "dc80b16a0e9e2d08acbc6b85e17c94895af2edc72f5b79489f79c7b872258377" }, "downloads": -1, "filename": "invertransforms-0.2.0.tar.gz", "has_sig": false, "md5_digest": "220d1718a512c80f471efd89c6bb0027", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16401, "upload_time": "2019-10-14T18:39:17", "url": "https://files.pythonhosted.org/packages/23/9a/b2116518e5f4fa11489e8a5edc516a5baaca66f523d74bcfbd0ed3a24d7e/invertransforms-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "a44265508ef11f7bf2f79db67ba0f3e9", "sha256": "f2d5f761a435ff1d2185fb550ae61ade76d4519820c53fbd24ff332eca71181e" }, "downloads": -1, "filename": "invertransforms-0.2.1.tar.gz", "has_sig": false, "md5_digest": "a44265508ef11f7bf2f79db67ba0f3e9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14893, "upload_time": "2019-10-15T01:27:43", "url": "https://files.pythonhosted.org/packages/25/d4/a84dde03176e0d3ce2911c20d49f6a2bf7630953c83fcec81ea27fba3c25/invertransforms-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a44265508ef11f7bf2f79db67ba0f3e9", "sha256": "f2d5f761a435ff1d2185fb550ae61ade76d4519820c53fbd24ff332eca71181e" }, "downloads": -1, "filename": "invertransforms-0.2.1.tar.gz", "has_sig": false, "md5_digest": "a44265508ef11f7bf2f79db67ba0f3e9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14893, "upload_time": "2019-10-15T01:27:43", "url": "https://files.pythonhosted.org/packages/25/d4/a84dde03176e0d3ce2911c20d49f6a2bf7630953c83fcec81ea27fba3c25/invertransforms-0.2.1.tar.gz" } ] }