hugging-gallery / app.py
osanseviero's picture
Update app.py
e7a56ee
raw
history blame
679 Bytes
#!/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="Hugging Gallery")
block.load(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)