Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,13 +2,16 @@ import streamlit as st
|
|
| 2 |
from transformers import pipeline
|
| 3 |
import numpy
|
| 4 |
import torch
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
|
| 7 |
st.write("welcome to age detection app")
|
| 8 |
|
| 9 |
uploaded_files = st.file_uploader("Choose a image file")
|
| 10 |
|
| 11 |
-
|
| 12 |
pipe = pipeline("image-classification", model="dima806/facial_age_image_detection")
|
| 13 |
|
| 14 |
-
st.write(pipe(st.image(uploaded_files))[0]["label"])
|
|
|
|
| 2 |
from transformers import pipeline
|
| 3 |
import numpy
|
| 4 |
import torch
|
| 5 |
+
import matplotlib.pyplot
|
| 6 |
+
import PIL
|
| 7 |
+
from PIL import Image
|
| 8 |
+
|
| 9 |
|
| 10 |
|
| 11 |
st.write("welcome to age detection app")
|
| 12 |
|
| 13 |
uploaded_files = st.file_uploader("Choose a image file")
|
| 14 |
|
|
|
|
| 15 |
pipe = pipeline("image-classification", model="dima806/facial_age_image_detection")
|
| 16 |
|
| 17 |
+
st.write(pipe(st.image(Image.open(uploaded_files )))[0]["label"])
|