Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ovyerus/deeppyer
Image deepfryer written in Python.
https://github.com/ovyerus/deeppyer
asyncio image-deepfryer image-processing python
Last synced: 3 months ago
JSON representation
Image deepfryer written in Python.
- Host: GitHub
- URL: https://github.com/ovyerus/deeppyer
- Owner: Ovyerus
- License: mit
- Created: 2017-08-28T07:53:34.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-05-06T01:45:54.000Z (9 months ago)
- Last Synced: 2024-10-25T10:40:54.117Z (3 months ago)
- Topics: asyncio, image-deepfryer, image-processing, python
- Language: Python
- Size: 323 KB
- Stars: 43
- Watchers: 5
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# deeppyer
[![PyPI](https://img.shields.io/pypi/v/deeppyer.svg)](https://pypi.org/project/deeppyer/)
![banner image](https://raw.githubusercontent.com/Ovyerus/deeppyer/master/banner.jpg)deeppyer is an image deepfryer written in Python using [Pillow](https://python-pillow.org/)
and [OpenCV](https://pypi.org/project/opencv-python/).NOTE: This *requires* at least Python v3.6 in order to run.
## How to use
You can either use deeppyer as a module, or straight from the command line.### Command line usage
```
$ python deeppyer.py -husage: deeppyer.py [-h] [-v] [-o OUTPUT] [-f] FILE
Deepfry an image.
positional arguments:
FILE File to deepfry.optional arguments:
-h, --help show this help message and exit
-v, --version Display program version.
-o OUTPUT, --output OUTPUT
Filename to output to.
-f, --flares Try and detected faces for adding lens flares.
```By default, flares will try to be added to the image, unless you're using the CLI script,
in which case it is off by default.### Program usage
```py
from PIL import Image
import deeppyer, asynciodef main():
img = Image.open('./foo.jpg')
img = deeppyer.deepfry(img)
img.save('./bar.jpg')if __name__ == "__main__":
main()
```## API Documentation
#### `async deepfry(img: Image, type=DeepfryTypes.RED, *, flares: bool = True)`
Deepfry a given image.**Arguments**
- *img* (PIL.Image) - Image to apply the deepfry effect on.
- *[type]* (DeepfryTypes) - Colours to apply on the image.
- *[flares] (bool) - Whether or not to try and detect faces for applying lens flares.Returns:
`PIL.Image` - Deepfried image.## Why?
¯\\\_(ツ)_/¯ Why not## Contributing
If you wish to contribute something to this, go ahead! Just please make sure to format it with flake8 + isort, and that the test(s) pass fine.## Testing
Simply run `tests/test.py` and make sure that all the images output properly.