multimodalart HF Staff commited on
Commit
ab8d6bb
·
verified ·
1 Parent(s): e0b8ff4

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import numpy as np
2
+ import gradio as gr
3
+
4
+ # Pre-loaded image: a simple RGB gradient so the component shows content on load.
5
+ h, w = 256, 256
6
+ gradient = np.zeros((h, w, 3), dtype=np.uint8)
7
+ gradient[:, :, 0] = np.linspace(0, 255, w, dtype=np.uint8)[None, :]
8
+ gradient[:, :, 1] = np.linspace(0, 255, h, dtype=np.uint8)[:, None]
9
+ gradient[:, :, 2] = 128
10
+
11
+ with gr.Blocks() as demo:
12
+ gr.Markdown("# Image demo")
13
+ gr.Image(value=gradient, label="Pre-loaded image")
14
+
15
+ if __name__ == "__main__":
16
+ demo.launch()