YAML Metadata
Warning:
empty or missing yaml metadata in repo card
(https://huggingface.co/docs/hub/model-cards#model-card-metadata)
Fork of SmilingWolf/wd-swinv2-tagger-v3 for a image-captioning
task on 🤗Inference endpoint.
This repository implements a custom
task for image-captioning
for 🤗 Inference Endpoints.
To use deploy this model a an Inference Endpoint you have to select Custom
as task to use the handler.py
file. -> double check if it is selected
Setup
- Enter virtual environment
source venv/bin/activate
(deactivate
to exit). - Install the requirements
pip install -r requirements.txt
. - Run the server
python3 server.py
. - Make request to
http://127.0.0.1:5000/
with the payload below.
Token
To secure it with token, add env SECRET_TOKEN
and set the value. It must be included in root of json with each request:
{
"secret_token": "your_secret_token"
}
Request examples
Request payload with url to media
{
"inputs": { "url": "https://example.com/image.jpg" }
}
Request payload with base64 to media
{
"inputs": { "base64": "base64_string" }
}
Response examples
Success response
{
"caption": "1girl, ass, solo, feet, nail polish, toenail polish, pussy, toes, toenails, barefoot, mole on ass, pantyhose, hair bun, soles, looking back, anus, see-through legwear, realistic, looking at viewer, all fours, brown hair, see-through, underwear, brown eyes, couch, from behind, uncensored, sleeveless, no panties, asian, mole, panties, female pubic hair, foreshortening, shirt, gusset, panties under pantyhose"
}
Error response
{
"caption": "",
"error": "Unexpected error happened."
}
Inference Providers
NEW
This model is not currently available via any of the supported third-party Inference Providers, and
HF Inference API was unable to determine this model's library.