hcs
Add application file
63d65b3
raw
history blame
1.02 kB
import streamlit as st
from PIL import Image
import core
# 加载模型和其他必要的库
# Streamlit 应用程序
def main():
st.title("颜值评分")
st.write("仅用于娱乐目的,评分结果仅供参考,模型来自合法开源项目与公开数据集:SCUT-FBP5500")
st.write("请确保图片只包含单个人物面部(证件照形式最佳)")
st.write("您上传的内容不会被服务器保存")
st.write("---")
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()