clipspace / README.md
borso271's picture
Deploy MobileCLIP classifier with Gradio interface
1f6a2dc
|
raw
history blame
1.79 kB
---
title: MobileCLIP Image Classifier
emoji: ๐Ÿ“ธ
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 4.44.0
app_file: app.py
pinned: false
license: mit
---
# ๐Ÿ“ธ MobileCLIP-B Image Classifier
Interactive web interface for Apple's MobileCLIP-B zero-shot image classification model.
## Features
- ๐Ÿ–ผ๏ธ **Image Classification**: Upload any image for instant classification
- ๐Ÿท๏ธ **Dynamic Labels**: Add and manage classification labels on-the-fly
- ๐Ÿ“Š **Visual Results**: See confidence scores with interactive charts
- โšก **Fast Inference**: Optimized for < 30ms latency on GPU
- ๐Ÿ”’ **Admin Panel**: Secure label management interface
## Environment Variables
Configure these in your Space Settings (Settings โ†’ Variables and secrets):
| Variable | Description | Required |
|----------|-------------|----------|
| `ADMIN_TOKEN` | Secret token for admin operations | Yes (for admin features) |
| `HF_LABEL_REPO` | Hub dataset repo for label storage (e.g., `username/mobileclip-labels`) | No |
| `HF_WRITE_TOKEN` | Hugging Face token with write permissions | No |
| `HF_READ_TOKEN` | Hugging Face token with read permissions | No |
## How It Works
1. **Model**: Uses MobileCLIP-B with re-parameterized MobileOne blocks for efficient inference
2. **Labels**: Loads from `items.json` or dynamically from Hub repository
3. **Processing**: Pre-computes text embeddings for fast classification
4. **Interface**: Gradio provides the web UI with image upload and admin controls
## Admin Features
With proper authentication, admins can:
- Add new classification labels without redeploying
- Reload specific label versions from the Hub
- View current statistics and label information
## License
- Model weights: Apple Sample Code License (ASCL)
- Interface code: MIT