Skip to main content

Python Wrapper around the Google Vision Product Search API

Project description

Vision Product Search Wrapper

This library is a Python wrapper around the Cloud Vision Product Search Libary. It makes this tool easier to use by allowing you to initalize a ProductSearch object once with all of your credentials. It's object-oriented, so that you don't have to be constantly ferrying around names and paths and project ids.

Getting Started

from visionproductsearch.ProductSearch import ProductSearch, ProductCategories

# Initialize ProductSearch with your credentials

ps = ProductSearch(`my_gcp_project_id`, 'us-west1', 'path/to/creds.json', 'my_gcp_bucket_name' )

# Create a new product set
productSet = ps.createProductSet('my_test_set')

# Create a new product
product = ps.createProduct('my_fancy_shirt', ProductCategories.APPAREL)

# Add a reference image to a product
product.addReferenceImage('./skirt_pic.jpg')

# List all reference images for a product
for img in product.listReferenceImages():
    print(img)

# Add a product to a product set
product.addProduct(product)

# List all products in a product set
for p in productSet.listProducts():
    print(p)

# Search for similar products by image
productSet.search(ProductCategories.APPAREL, file_path='img/to/search.jpg')

Note that this is not a wrapper around all the functions in the Product Search library, but feel free to add them as a contributor!

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

pyvisionproductsearch-0.3.tar.gz (8.1 kB view details)

Uploaded Source

File details

Details for the file pyvisionproductsearch-0.3.tar.gz.

File metadata

  • Download URL: pyvisionproductsearch-0.3.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.3

File hashes

Hashes for pyvisionproductsearch-0.3.tar.gz
Algorithm Hash digest
SHA256 5b9c090f4411d8293042c0fd4d5a3b66923c677a4e583cbccda1fd5334f963af
MD5 ea4ac0b83c4bef4b0f4bc980f92d5460
BLAKE2b-256 6fe606b563b5395e29cc9323430414005199747cf548de8fcf22b571be1154f4

See more details on using hashes here.

Supported by

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