3d2smiles / app.py
wg25r
-
4917c61
raw
history blame
558 Bytes
import streamlit as st
from PIL import Image
import numpy as np
st.title("Image Average Pixel Calculator")
uploaded_file = st.file_uploader("Upload an image", type=["png", "jpg", "jpeg"])
if uploaded_file:
image = Image.open(uploaded_file)
st.image(image, caption="Your Image", use_container_width=True)
image_np = np.array(image)
if image_np.ndim == 3:
avg_pixel = image_np.mean(axis=(0, 1))
else:
avg_pixel = image_np.mean()
st.markdown("check out this [link](https://pubchem.ncbi.nlm.nih.gov/#query=%s)" % "CC=CC")