pytorch-smartcrop


Namepytorch-smartcrop JSON
Version 1.0.0 PyPI version JSON
download
home_pageNone
SummarySmartcrop transform for PyTorch
upload_time2024-05-29 08:14:43
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2024 Michał Dyczko Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords pytorch smartcrop image transform
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pytorch-smartcrop

This is a PyTorch implementation of the smartcrop algorithm. The smartcrop algorithm is a content aware image cropping algorithm that is used to crop images to the most interesting part of the image. The algorithm is based on the pyvips smartcrop implementation.

# Prerequisites

- requires libvips shared library to be installed on the system. For further information on how to install libvips, please refer to the [libvips installation guide](https://libvips.github.io/libvips/install.html)

# Usage

```python
from pytorch_smartcrop import SmartCrop
from PIL import Image

# load image
image = Image.open('image.jpg')

# crop image to 256x256
sc = SmartCrop(patch_size=(256, 256))
cropped_image = sc(image)
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pytorch-smartcrop",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "pytorch, smartcrop, image, transform",
    "author": null,
    "author_email": "Micha\u0142 Dyczko <michal@dyczko.dev>",
    "download_url": "https://files.pythonhosted.org/packages/4b/59/133eba0abf90b362569e9d9b8612be0138e07eaec085909a093166e4c94b/pytorch_smartcrop-1.0.0.tar.gz",
    "platform": null,
    "description": "# pytorch-smartcrop\n\nThis is a PyTorch implementation of the smartcrop algorithm. The smartcrop algorithm is a content aware image cropping algorithm that is used to crop images to the most interesting part of the image. The algorithm is based on the pyvips smartcrop implementation.\n\n# Prerequisites\n\n- requires libvips shared library to be installed on the system. For further information on how to install libvips, please refer to the [libvips installation guide](https://libvips.github.io/libvips/install.html)\n\n# Usage\n\n```python\nfrom pytorch_smartcrop import SmartCrop\nfrom PIL import Image\n\n# load image\nimage = Image.open('image.jpg')\n\n# crop image to 256x256\nsc = SmartCrop(patch_size=(256, 256))\ncropped_image = sc(image)\n```\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Micha\u0142 Dyczko  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Smartcrop transform for PyTorch",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/michaldyczko/pytorch-smartcrop"
    },
    "split_keywords": [
        "pytorch",
        " smartcrop",
        " image",
        " transform"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b79928e4c6324f101c21aa8d235daf6b0355b771487c29a3923af483c3620b0a",
                "md5": "7609fdf02d0c71cf1aaeb0b5fe6b98a3",
                "sha256": "04e1b7a3ddbcd284e9bfdd69c845104396e0957322d6821b314853ea1bd10067"
            },
            "downloads": -1,
            "filename": "pytorch_smartcrop-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7609fdf02d0c71cf1aaeb0b5fe6b98a3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 4174,
            "upload_time": "2024-05-29T08:14:41",
            "upload_time_iso_8601": "2024-05-29T08:14:41.730654Z",
            "url": "https://files.pythonhosted.org/packages/b7/99/28e4c6324f101c21aa8d235daf6b0355b771487c29a3923af483c3620b0a/pytorch_smartcrop-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4b59133eba0abf90b362569e9d9b8612be0138e07eaec085909a093166e4c94b",
                "md5": "36c58a2effbfe3f72ed0120be6dcb52e",
                "sha256": "9f9344efd4269ef0d8b091ec083f37dcf80ba8c232e83fad7963539e82006520"
            },
            "downloads": -1,
            "filename": "pytorch_smartcrop-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "36c58a2effbfe3f72ed0120be6dcb52e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 3122,
            "upload_time": "2024-05-29T08:14:43",
            "upload_time_iso_8601": "2024-05-29T08:14:43.309041Z",
            "url": "https://files.pythonhosted.org/packages/4b/59/133eba0abf90b362569e9d9b8612be0138e07eaec085909a093166e4c94b/pytorch_smartcrop-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-29 08:14:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "michaldyczko",
    "github_project": "pytorch-smartcrop",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pytorch-smartcrop"
}
        
Elapsed time: 0.25967s