Skip to main content

ripple_net (wip)

A library for text/image based search/retrieval for image datasets and files. Uses multimodal AI techniques/models like vector embeddings and CLIP.

Install

$ pip install ripple_net

Usage

  • For text description-based search
from ripple import ImageEmbedder, TextSearch # import classes

# load from a huggingface image dataset or load from a local image directory
embedder = ImageEmbedder('huggan/wikiart', retrieval_type='text-image', dataset_type='huggingface') 

# could also use 'cpu' if CUDA-enabled GPU isn't available
embedded_images = embedder.create_embeddings(device="cuda", batch_size=32)

# initialize text - image search class
text_search = TextSearch(embedded_images, embedder.embed_model)

# specify text/search query for image, and number of results to return
scores, images = text_search.get_similar_images(query='painting of a river', k_images=10) 

images['image'][0].show()
  • For image-based retrieval(image-image search)
from ripple import ImageEmbedder, ImageSearch, image_loader

 # load dataset and initialize embedding class
embedder = ImageEmbedder('lambdalabs/naruto-blip-captions', retrieval_type='image-image', dataset_type='huggingface',  device='cuda',
)

# generate embeddings
embedded_images = embedder.create_embeddings(device="cuda", batch_size=32)

# init image search class
image_search = ImageSearch(embedded_images, embedder.embed_model)

# retrieve similar images with image input
input_image = image_loader('katara.png') # use library function to load image in PIL format

scores, images = image_search.image_search(input_img=input_image, k_images=5) # specify input image, and number of results to return

# dislay one of retrieved images
images['image'][0].show()
# or using notebooks => images['image'][0]
  • For auto image tagging/renaming
from ripple import ImageTagger

# initialize the class with folder of choice
folder = '/kaggle/working/images/drawings'

tagger = ImageTagger(folder)

# captions to label with
captions = ['humans', 'animals', 'plants','land']

tagger.auto_tagger(captions) # rename all images and move to folders

Todo

  • direct CLI usage

Acknowledgement

Metadata

Release files for ripple-net 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ripple-net 0.1.5
File Size Uploaded
ripple_net-0.1.5.tar.gz 149.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ripple-net 0.1.5
File Interpreter ABI Platform
ripple_net-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 164.3 kB

Release files / ripple_net-0.1.5.tar.gz

Download URL ripple_net-0.1.5.tar.gz
Size 149.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c68a32929a6cba69c00817119e2f22463a66851ae39c092e64ba6b627b303519
BLAKE2b-256 checksum
How to use checksums
d56aa53b120adea3cab25d28b8dce9474068fe8d7959cf35199f48739482207a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / ripple_net-0.1.5-py3-none-any.whl

Download URL ripple_net-0.1.5-py3-none-any.whl
Size 15.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6a99b845d1c7fcd7b96064aa6da43f79e9ba6d0ab02a520d0e7d4760af492d5f
BLAKE2b-256 checksum
How to use checksums
a721abd41a6dfbaa3b1bc00f4b399579e008fdc5855d3db24ab1c2de19f159d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.4

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page