cats_vs_dogs / README.md
nice22090's picture
Add cats vs dogs Gradio demo
1524a42
|
Raw
History Blame Contribute Delete
1.16 kB

A newer version of the Gradio SDK is available: 6.20.0

Upgrade
metadata
title: Cats vs Dogs Classifier
sdk: gradio
sdk_version: 4.44.1
app_file: app.py
pinned: false

Cats vs Dogs Classifier

Gradio demo Space for an image classifier trained to distinguish cats vs dogs.

Configure

  • Put your Keras .h5 model in this repo (recommended: model.h5), or set MODEL_PATH.
  • model_info.json is optional, but if present it can provide defaults like class names / preprocessing.
  • If your model outputs a single sigmoid probability, set POSITIVE_CLASS to whichever label corresponds to 1.0.
  • If your model needs different input scaling, set INPUT_SCALE to 0_1, minus1_1, or 0_255.

Upload to Hugging Face Spaces

  1. Create a new Space → Gradio (Public).
  2. Add this repo contents to the Space repo.
  3. Add your model.h5.
    • If it's larger than ~10MB, use Git LFS:
      • git lfs install
      • git lfs track "*.h5"
      • commit the generated .gitattributes, then commit model.h5.
  4. (Optional) In Space Settings → Variables, set:
    • CLASS_NAMES (default: cat,dog)
    • INPUT_SCALE (0_1 | minus1_1 | 0_255)
    • POSITIVE_CLASS (only for 1-output sigmoid models)