Skip to main content

Simple image search engine package.

Project description

⚡️ A Simple ready-to-use Image search engine library

Python

PyPi license PyPI version fury.io

📌 Install Picachain

Create a local datastore with ChromaDB for image search.

With pip :

pip install picachain

🚀 Getting Started

With less than 10 lines of code, create an image search engine with the help of picachain and chromadb.

from PIL import Image
import matplotlib.pyplot as plt

# import from picachain
from picachain.datastore import ChromaStore
from picachain.embedding import ClipEmbedding
from picachain.retriever import ImageRetriever
from picachain.search.image_search import ImageSearch
img = Image.open("image-path") # query image
images = [Image.open(os.path.join("images-path", image)) for image in os.listdir("images-path")] # image collection
# initiate embedding, datastore and retriever
embedding = ClipEmbedding()
datastore = ChromaStore("test-collection")
retriever = ImageRetriever(datastore, embedding, images)

image_search = ImageSearch(retriever=retriever, embedding=embedding, query_img=img)
result = image_search.search_relevant_images(top_k=3) # get top 3 relevant images

for img, score in result: # [(img, score), (img, score)]
    img.show()

It is under continuous development so currently supports only ChromaDB. We are working on integrating all popular vector databases such as Pinecone, Weaviate, etc.

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

picachain-0.1.2.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

picachain-0.1.2-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file picachain-0.1.2.tar.gz.

File metadata

  • Download URL: picachain-0.1.2.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.8.10 Linux/5.15.0-101-generic

File hashes

Hashes for picachain-0.1.2.tar.gz
Algorithm Hash digest
SHA256 4dd544c344c22637a0cbfeca67c771b916e5d06ee88b68b40ac09d49fe08ecee
MD5 9d717cec28408263c241371276864f50
BLAKE2b-256 47cebe44a0e15801fc5d00b3a3879d5b25b60ee9dcab91d6fa6ea9604dfe9210

See more details on using hashes here.

File details

Details for the file picachain-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: picachain-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.8.10 Linux/5.15.0-101-generic

File hashes

Hashes for picachain-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ab84e6c0f6e27083ac5fdae45d08b1fa6202ec518505e6d57dd1977fbbcde46a
MD5 155dcd039f1e50d5b5ef367702bb25fc
BLAKE2b-256 c65cdfa73a6490f9b446018f54da164f5e6ad42233e70eab7f8f2aef4ab2846c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page