Spaces:
Runtime error
Runtime error
testing-pr-functionality
#1
by
ceyda
- opened
- app.py +35 -0
- blown.png +0 -0
- butterfly.png +0 -0
app.py
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/usr/bin/env python
|
2 |
+
# coding: utf-8
|
3 |
+
import os
|
4 |
+
from glob import glob
|
5 |
+
import gradio as gr
|
6 |
+
|
7 |
+
|
8 |
+
block = gr.Blocks(css=".container { max-width: 800px; margin: auto; }")
|
9 |
+
|
10 |
+
|
11 |
+
def infer():
|
12 |
+
images = glob('*.png') + glob('*.jpg') + glob('*.jpeg')+ glob('*.gif')
|
13 |
+
return images
|
14 |
+
|
15 |
+
with block:
|
16 |
+
with gr.Group():
|
17 |
+
with gr.Box():
|
18 |
+
gallery=gr.Gallery(label="Hug Gallery")
|
19 |
+
btn = gr.Button("Run").style(
|
20 |
+
margin=False,
|
21 |
+
rounded=(False, True, True, False),
|
22 |
+
)
|
23 |
+
btn.click(infer, inputs=None, outputs=gallery)
|
24 |
+
|
25 |
+
block.launch()
|
26 |
+
|
27 |
+
|
28 |
+
|
29 |
+
#import streamlit as st
|
30 |
+
#from glob import glob
|
31 |
+
#logos = glob('*.png') + glob('*.jpg') + glob('*.jpeg')+ glob('*.gif')
|
32 |
+
#
|
33 |
+
#cols=st.columns(4)
|
34 |
+
#for i,logo in enumerate(logos):
|
35 |
+
# cols[i%4].image(logo)
|
blown.png
CHANGED
butterfly.png
ADDED