Autogenerate image descriptions with the help of computer vision
Project description
Wagtail Alt Generator
Insert image description and tags with the help of computer vision (inspired by altify).
Requirements
Python 2.7 / Python 3.5+
Django 1.8+
Wagtail 1.7+
An Microsoft Cognitive Service account
NOTE: Images must be accessible by third part (to enable Computer Vision processing). That means any image that be reached through yourdomain.com/yourimage.jpg will work, while localhost won’t.
Installation
Install the library with pip:
$ pip install wagtailaltgenerator
Quick Setup
Register an account on Microsoft Cognitive Service
Retrive api key for the product Computer Vision - Preview
Add the key to your django settings:
COMPUTER_VISION_API_KEY = 'yourkey'
Make sure wagtailaltgenerator is added to your INSTALLED_APPS.
INSTALLED_APPS = ( # ... 'wagtailaltgenerator', )
Usage
Upload an image through Wagtail
Watch the title get generated…
…And done!
Settings
COMPUTER_VISION_API_KEY: Computer Vision api key
ALT_GENERATOR_USE_TAGS: Enable/disable image tags (True by default)
ALT_GENERATOR_MAX_TAGS: The total amount of tags to use (unlimited by default)
Tests
This library include tests, just run python runtests.py
Make sure to install dev requirements: pip install -r requirements/dev.txt
Before running any type of tests, make sure the env variable COMPUTER_VISION_API_KEY is exported.
You can also run separate test cases: runtests.py tests.GenerateLabelTest
Git hooks
Release start
These hooks will automatically bump the application version when using git flow release ...
chmod +x $PWD/git-hooks/release-start.sh ln -nfs $PWD/git-hooks/release-start.sh .git/hooks/post-flow-release-start ln -nfs $PWD/git-hooks/release-start.sh .git/hooks/post-flow-hotfix-start
Distribution
Register
python setup.py egg_info twine register dist/mypkg.wh
Publish
python setup.py sdist twine upload dist/*
Contributing
Want to contribute? Awesome. Just send a pull request.
License
Wagtail-alt-generator is released under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for wagtailaltgenerator-1.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f450842beb6fe2cdc46f472429ff5bed3bb095f0eab5151cae90d827959d7825 |
|
MD5 | 5c8c01e1a90ee4812c643acab78a86c9 |
|
BLAKE2b-256 | 9b942602e5b15b7a7b842012b814af1e8d8921bd6455789b7e8dc363ad15a4d0 |