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