pupyl - A Python Image Search Library
🧿 pupyl what?
The pupyl project (pronounced pyoo·piel) is a pythonic library to perform image search tasks. It's intended to made easy reading, indexing, retrieving and maintaining a complete reverse image search engine. You can use it in your own data pipelines, web projects and wherever you find fit!
🎉 Getting started
📦 Installation
Installing pupyl on your environment is pretty easy:
# pypi
pip install pupyl
or
# anaconda
conda install -c policratus pupyl
For installation troubleshooting, visit troubleshooting.
🚸 Usage
You can call pupyl's objects directly from your application code. For this example, a sample database will be indexed and after that, the following image will be used as a query image (credits: @dlanor_s):
from pupyl.search import PupylImageSearch
from pupyl.web import interface
SEARCH = PupylImageSearch()
SEARCH.index(
'https://github.com/policratus/pupyl'
'/raw/master/samples/images.tar.xz'
)
QUERY_IMAGE = 'https://images.unsplash.com/photo-1520763185298-1b434c919102'
[*SEARCH.search(QUERY_IMAGE)]
# Here's the simplest result
> [427, 473, 129, 346]
# The results with image metadata
[*SEARCH.search(QUERY_IMAGE, return_metadata=True)]
> [
{
'original_file_name': '941444733_6de664bbbf.jpg',
'original_path': '/tmp/tmp_i42jozv',
'original_file_size': '80K',
'original_access_time': '2021-07-06T20:31:07',
'id': 427
},
{
'original_file_name': '2673396259_f151fbe7c1.jpg',
'original_path': '/tmp/tmp_i42jozv',
'original_file_size': '66K',
'original_access_time': '2021-07-06T20:31:07',
'id': 473
},
...
]
# Opening the web interface
interface.serve()
A glimpse of the web interface, visualizing the results shown above:
Disclaimer: the example above creates pupyl assets on your temporary directory. To define a non-volatile database, you should define data_dir parameter.
Alternatively, you can interact with pupyl via command line. The same example above in CLI
terms:
🐚 Command line interface
# Indexing images
pupyl --data_dir /path/to/your/data/dir index /path/to/images/
# Opening web interface
pupyl --data_dir /path/to/your/data/dir serve
💡 Type
pupyl --helpto discover all the CLI's capabilities.
📌 Dependencies
See all dependencies here: dependencies.
📝 Documentation
See a getting start guide and the API reference on https://pupyl.readthedocs.io/.
🖊️ Citation
If you use pupyl on your publications or projects, please cite:
@misc{pupyl,
author = {Nelson Forte de Souza Junior},
title = {pupyl},
howpublished = {\url{https://github.com/policratus/pupyl}},
year = {2021}
}
Release files for pupyl 0.11.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pupyl-0.11.3.tar.gz | 29.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pupyl-0.11.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:62.4 kB
Release files / pupyl-0.11.3.tar.gz
| Download URL | pupyl-0.11.3.tar.gz |
|---|---|
| Size | 29.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f00a8dd8a27d7d1a0aef8632522b3463709da6fecf90d29b48b914dbbd5a6a4
|
|
BLAKE2b-256 checksum How to use checksums |
bbd6e68219b5398aa712d325f6cd7b1f83026b88830d5d244f7602d400895ca5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5
|
Release files / pupyl-0.11.3-py3-none-any.whl
| Download URL | pupyl-0.11.3-py3-none-any.whl |
|---|---|
| Size | 33.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6f2dfaca92451701e7b702cb84f8b9f2e8e5398c27060eba34d9281d90c2dc13
|
|
BLAKE2b-256 checksum How to use checksums |
7fc772549f6c923b5cf530e9649342d22eda35c658f7a017e32f56e2f1bf1058
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5
|