hcs
Add application file
475ac6e
raw
history blame
724 Bytes
import streamlit as st
from PIL import Image
import core
# 加载模型和其他必要的库
# Streamlit 应用程序
def main():
st.title("颜值打分应用")
uploaded_image = st.file_uploader("上传一张图片", type=["png", "jpg", "jpeg"])
if uploaded_image is not None:
# 读取上传的图片
image = Image.open(uploaded_image)
# 在界面上显示图片
st.image(image, caption="上传的图片", use_column_width=True)
# 使用模型进行颜值打分
# score = model.predict(image)
score = core.fun(uploaded_image)
# 在界面上显示颜值分数
st.write("颜值打分:", score)
if __name__ == "__main__":
main()