age_detection / app.py
corvo7's picture
Update app.py
b1148ee verified
raw
history blame contribute delete
448 Bytes
import streamlit as st
from transformers import pipeline
import numpy
import torch
import matplotlib.pyplot
import PIL
from PIL import Image
st.write("welcome to age detection app")
uploaded_files = st.file_uploader("Choose a image file",type="jpg")
if uploaded_files is not None:
Image=Image.open(uploaded_files)
pipe = pipeline("image-classification", model="dima806/facial_age_image_detection")
st.write(pipe(Image)[0]["label"])