philschmid's picture
Update README.md
0e15755
|
raw
history blame
1.08 kB
metadata
tags:
  - vision
  - zero-shot-image-classification
library_name: generic

Fork of openai/clip-vit-base-patch32 for a zero-sho-image-classification Inference endpoint.

This repository implements a custom task for zero-shot-image-classification for 🤗 Inference Endpoints. The code for the customized pipeline is in the pipeline.py.

To use deploy this model a an Inference Endpoint you have to select Custom as task to use the pipeline.py file. -> double check if it is selected

expected Request payload

{
  "image": "/9j/4AAQSkZJRgABAQEBLAEsAAD/2wBDAAMCAgICAgMC....", // base64 image as bytes
  "candiates":["sea","palace","car","ship"]
}

below is an example on how to run a request using Python and requests.

Run Request

  1. prepare an image.
!wget https://huggingface.co/datasets/mishig/sample_images/resolve/main/palace.jpg
  1. run request