-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resdesign pages to match v3 + PR feedback
- Loading branch information
1 parent
f31498d
commit 126d63d
Showing
11 changed files
with
90 additions
and
2,207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
"""Image gallery page for the data explorer app.""" | ||
import io | ||
|
||
import streamlit as st | ||
from df_helpers.fields import get_image_fields | ||
from interfaces.dataset_interface import DatasetLoaderApp | ||
from PIL import Image | ||
|
||
|
||
class ImageGalleryApp(DatasetLoaderApp): | ||
@staticmethod | ||
def setup_app_page(dataframe, fields): | ||
image_fields = get_image_fields(fields) | ||
|
||
if len(image_fields) == 0: | ||
st.warning("There are no image fields in this subset") | ||
|
||
image_field = st.selectbox("Image field", image_fields) | ||
|
||
images = dataframe[image_field].compute() | ||
images = [Image.open(io.BytesIO(x)).resize((256, 256)) for x in images] | ||
|
||
image_slider = st.slider("image range", 0, len(images), (0, 10)) | ||
|
||
# show images in a gallery | ||
cols = st.columns(5) | ||
for i, image in enumerate(images[image_slider[0] : image_slider[1]]): | ||
cols[i % 5].image(image, use_column_width=True) | ||
|
||
|
||
app = ImageGalleryApp() | ||
app.create_common_interface() | ||
df, df_fields = app.create_loader_widget() | ||
app.setup_app_page(df, df_fields) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters