Image search: image/text => images.
Project description
Get similar images
This tool is a wrapper over an API that returns URLs and similarity scores for similar images for a given image.
You can find a demo of the tool here.
The description of the API can be found here.
Installation
pip install -U getsimilar
Get an API token
- Log in at: https://ternaus.com/login
- Go to the account page: https://ternaus.com/account
- Generate new token and save json file with it to
~/.ternaus/ternaus.json
Usage
You pass:
- Image in the form of the
numpy
array orPIL
image. - URL to the image:
- Text query, for example: "Girls in weird hats"
Optional parameters:
num_similar
that specifies the number of similar images to return. This number is capped at 50. If you would like to get more similar images per request, please contact us at https://www.ternaus.com/#contact. default value is 1.get_labels
that specifies whether to return labels for the image. default value is None. Right now onlycoco_yolov7
is supported.`
From image
from getsimilar.get import from_image
urls = from_image( < numpy or PIL
image >, num_similar = < the
number
of
similar
images >)
From URL
from getsimilar.get import from_url
urls = from_url(url, num_similar= < the
number
of
similar
images >)
From text
from getsimilar.get import from_text
urls = from_text(text, num_similar= < the
number
of
similar
images >)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
getsimilar-0.0.5.tar.gz
(8.5 kB
view details)
File details
Details for the file getsimilar-0.0.5.tar.gz
.
File metadata
- Download URL: getsimilar-0.0.5.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c50b1848fbcff7e9ca898c0f0701e8b11f6fdda22f5be9358fda5a6bc8846f31 |
|
MD5 | cc1e0ad14ac74ffc5c615022181ef3e9 |
|
BLAKE2b-256 | 6c5e187c5d3c35520cf5dfdc18d3bbabafb2d1ba5cf25f61f71cd47dbd8fcbae |