{ "info": { "author": "Pavel Yakubovskiy", "author_email": "qubvel@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "\n# TTA wrapper\nTest time augmnentation wrapper for keras image segmentation and classification models.\n\n## Description\n\n### How it works?\n\nWrapper add augmentation layers to your Keras model like this:\n\n```\n Input\n | # input image; shape 1, H, W, C\n / / / \\ \\ \\ # duplicate image for augmentation; shape N, H, W, C\n | | | | | | # apply augmentations (flips, rotation, shifts)\n your Keras model\n | | | | | | # reverse transformations\n \\ \\ \\ / / / # merge predictions (mean, max, gmean)\n | # output mask; shape 1, H, W, C\n Output\n```\n\n### Arguments\n\n - `h_flip` - bool, horizontal flip augmentation\n - `v_flip` - bool, vertical flip augmentation\n - `rotataion` - list, allowable angles - 90, 180, 270\n - `h_shift` - list of int, horizontal shift augmentation in pixels\n - `v_shift` - list of int, vertical shift augmentation in pixels\n - `add` - list of int/float, additive factor (aug_image = image + factor)\n - `mul` - list of int/float, additive factor (aug_image = image * factor)\n - `contrast` - list of int/float, contrast adjustment factor (aug_image = (image - mean) * factor + mean)\n - `merge` - one of 'mean', 'gmean' and 'max' - mode of merging augmented predictions together\n\n### Constraints\n 1) model has to have 1 `input` and 1 `output`\n 2) inference `batch_size == 1`\n 3) image `height == width` if `rotation_angles` augmentation is used\n\n\n## Example\n```python\nfrom keras.models import load_model\nfrom tta_wrapper import tta_segmentation\n\nmodel = load_model('path/to/model.h5')\ntta_model = tta_segmentation(model, h_flip=True, rotation_angles=(90, 270), \n h_shifts=(-5, 5), merge='mean')\ny = tta_model.predict(x)\n```\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "tta-wrapper", "package_url": "https://pypi.org/project/tta-wrapper/", "platform": "", "project_url": "https://pypi.org/project/tta-wrapper/", "project_urls": null, "release_url": "https://pypi.org/project/tta-wrapper/0.0.1/", "requires_dist": null, "requires_python": ">=3.5.0", "summary": "Test time image augmentation for Keras models.", "version": "0.0.1" }, "last_serial": 4441258, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "2d4071a34af5f85cef5c4284827b7a4c", "sha256": "57d68d000fbcd15983cda83b6cc1673515d494cb4970d2e9c7c0e325e5d364fc" }, "downloads": -1, "filename": "tta_wrapper-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2d4071a34af5f85cef5c4284827b7a4c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.5.0", "size": 7033, "upload_time": "2018-11-01T16:23:28", "url": "https://files.pythonhosted.org/packages/e4/6a/11cced7cc269dda46749763cb10c90e06d455ba4cc8a56d4a62f8abb0c08/tta_wrapper-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "778345f72a12c95df8119b426a584217", "sha256": "80595505d9c4cb8f0e555d9c23a3b0641685b75504a36d9fd9811d1e1b56f2f9" }, "downloads": -1, "filename": "tta_wrapper-0.0.1.tar.gz", "has_sig": false, "md5_digest": "778345f72a12c95df8119b426a584217", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.0", "size": 5293, "upload_time": "2018-11-01T16:23:30", "url": "https://files.pythonhosted.org/packages/8e/5b/5fe0b3611e16c6a46b09ea3bcda9194215429dba47b19a8fc0c74c46a2fb/tta_wrapper-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2d4071a34af5f85cef5c4284827b7a4c", "sha256": "57d68d000fbcd15983cda83b6cc1673515d494cb4970d2e9c7c0e325e5d364fc" }, "downloads": -1, "filename": "tta_wrapper-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2d4071a34af5f85cef5c4284827b7a4c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.5.0", "size": 7033, "upload_time": "2018-11-01T16:23:28", "url": "https://files.pythonhosted.org/packages/e4/6a/11cced7cc269dda46749763cb10c90e06d455ba4cc8a56d4a62f8abb0c08/tta_wrapper-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "778345f72a12c95df8119b426a584217", "sha256": "80595505d9c4cb8f0e555d9c23a3b0641685b75504a36d9fd9811d1e1b56f2f9" }, "downloads": -1, "filename": "tta_wrapper-0.0.1.tar.gz", "has_sig": false, "md5_digest": "778345f72a12c95df8119b426a584217", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.0", "size": 5293, "upload_time": "2018-11-01T16:23:30", "url": "https://files.pythonhosted.org/packages/8e/5b/5fe0b3611e16c6a46b09ea3bcda9194215429dba47b19a8fc0c74c46a2fb/tta_wrapper-0.0.1.tar.gz" } ] }