policratus/pupyl
Fork: 6 Star: 101 (更新于 1970-01-01 00:00:00)
license: LGPL-3.0
Language: Python .
🧿 Pupyl is a really fast image search library which you can index your own (millions of) images and find similar images in milliseconds.
最后发布版本: v0.14.4 ( 2023-10-04 02:25:03)
pupyl - A Python Image Search Library
Table of contents
🧿 pupyl what?
The pupyl
project (pronounced pyoo·piel) is a pythonic library to perform image search tasks (even over animated GIFs). It's intended to make 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):
pupyl
also supports using animated gifs as query images and can store and retrieve it too.
from pupyl.search import PupylImageSearch
from pupyl.web import interface
SEARCH = PupylImageSearch()
SEARCH.index(
'https://github.com/policratus/pupyl'
'/raw/main/samples/images.tar.xz'
)
# Using, for instance, a remote image. Local images have pretty faster results.
QUERY_IMAGE = 'https://images.unsplash.com/photo-1520763185298-1b434c919102?w=224&q=70'
[*SEARCH.search(QUERY_IMAGE)]
Disclaimer: the example above creates pupyl
assets on your temporary directory. To define a non-volatile database, you should define data_dir
parameter.
This will return:
# Here's the simplest possible result
> [486, 12, 203, 176]
With more information and returning image metadata from the results:
# The results with image metadata
[*SEARCH.search(QUERY_IMAGE, return_metadata=True)]
Now an excerpt of the (possible) return is:
[
{
"id": 486,
"internal_path": "/tmp/pupyl/0/486.gif",
"original_access_time": "2021-12-03T13:23:47",
"original_file_name": "icegif-5690.gif",
"original_file_size": "261K",
"original_path": "/tmp/tmp3gdxlwr6"
},
{
"id": 12,
"internal_path": "/tmp/pupyl/0/12.gif",
"original_access_time": "2021-12-03T13:23:46",
"original_file_name": "roses.gif",
"original_file_size": "1597K",
"original_path": "/tmp/tmp3gdxlwr6"
},
...
]
To interact visually, use the web interface:
# Opening the web interface
interface.serve()
A glimpse of the web interface, visualizing the results shown above:
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
# Searching using command line interface
pupyl --data_dir /path/to/your/data/dir search /path/to/query/image.ext
💡 Type
pupyl --help
to discover all the CLI's capabilities.
📌 Dependencies
See all dependencies here: dependencies.
📝 Documentation
See a getting started guide and the API reference on https://pupyl.readthedocs.io/.
🖊️ Citation
If you use pupyl
in your publications or projects, please cite:
@misc{pupyl,
author = {Nelson Forte de Souza Junior},
title = {pupyl - A Python Image Search Library},
howpublished = {\url{https://github.com/policratus/pupyl}},
year = {2021}
}
最近版本更新:(数据更新于 1970-01-01 00:00:00)
2023-10-04 02:25:03 v0.14.4
2023-07-18 23:02:15 v0.14.3
2023-05-17 01:31:50 v0.14.2
2022-10-18 15:22:49 v0.14.1
2022-08-10 05:15:40 v0.14.0
2022-06-07 05:51:33 v0.13.5
2022-05-20 22:28:17 v0.13.4
2022-04-04 23:18:25 v0.13.3
2022-02-26 14:44:12 v0.13.2
2021-12-27 04:07:27 v0.13.1
主题(topics):
approximate-nearest-neighbors, convolutional-neural-networks, gif-search, image-search, pythonic-library
policratus/pupyl同语言 Python最近更新仓库
2024-11-24 20:32:32 xtekky/gpt4free
2024-11-24 01:08:40 jasoneri/ComicGUISpider
2024-11-23 07:15:18 comfyanonymous/ComfyUI
2024-11-23 02:05:08 hect0x7/JMComic-Crawler-Python
2024-11-22 19:26:55 ultralytics/ultralytics
2024-11-22 18:58:34 home-assistant/core