lvyb commited on
Commit
8c016fe
β€’
1 Parent(s): de259a1
Files changed (3) hide show
  1. app.py +15 -3
  2. cat.jpeg +0 -0
  3. lion.jpg +0 -0
app.py CHANGED
@@ -1,8 +1,20 @@
 
 
1
  import gradio as gr
 
 
 
 
 
 
 
 
 
 
 
 
2
 
 
3
 
4
- description = "ζ–‡ε­—η”Ÿζˆε›Ύη‰‡"
5
- examples = [["小猫"], ["cat"], ["dog"]]
6
 
7
- demo = gr.Interface.load("models/runwayml/stable-diffusion-v1-5", description=description, examples=examples)
8
  demo.launch()
 
1
+ import os
2
+
3
  import gradio as gr
4
+ from transformers import pipeline
5
+
6
+
7
+ sd_description = "ζ–‡ε­—η”Ÿζˆε›Ύη‰‡"
8
+ sd_examples = [["小猫"], ["cat"], ["dog"]]
9
+ sd_demo = gr.Interface.load("models/runwayml/stable-diffusion-v1-5", title='ζ–‡ε­—η”Ÿζˆε›Ύη‰‡', examples=sd_examples)
10
+
11
+
12
+ pipe = pipeline("image-classification")
13
+ examples = [[os.path.join(os.path.dirname(__file__), "lion.jpg")], [os.path.join(os.path.dirname(__file__), "cat.jpeg")]]
14
+ app = gr.Interface.from_pipeline(pipe, examples=examples, title='ε›Ύη‰‡θ―†εˆ«')
15
+
16
 
17
+ demo = gr.TabbedInterface([sd_demo, app], ["ζ–‡ε­—η”Ÿζˆε›Ύη‰‡", "ε›Ύη‰‡θ―†εˆ«"])
18
 
 
 
19
 
 
20
  demo.launch()
cat.jpeg ADDED
lion.jpg ADDED