Basic usage
Constructor
Default image to display. Can be filepath, URL, PIL Image, or numpy array
File format for saving (e.g., “png”, “jpg”, “webp”)
Format passed to prediction function:
"numpy"- numpy array with shape (height, width, 3), values 0-255"pil"- PIL Image object"filepath"- string path to temporary file
Input sources:
"upload"- File upload box"webcam"- Webcam capture"clipboard"- Paste from clipboard
PIL image mode. “RGB” for color, “L” for grayscale
Component height in pixels or CSS units
Component width in pixels or CSS units
If True, automatically streams webcam feed in live interfaces
Buttons to display. By default, all built-in buttons are shown
Events
- change - Triggered when image changes
- upload - Triggered when image is uploaded
- clear - Triggered when image is cleared
- stream - Triggered during streaming
- select - Triggered when image is selected
- input - Triggered on input