skin_acne / app.py
francoisMav's picture
Updated app.py
643ce24 verified
raw
history blame contribute delete
867 Bytes
# app.py
import streamlit as st
from transformers import pipeline
from PIL import Image
import requests
# Load the Hugging Face pipeline for image classification
classifier = pipeline("image-classification", model="imfarzanansari/skintelligent-acne")
# Title of the Streamlit app
st.title("Skin Condition Classification - Acne Detection")
# Upload an image file
uploaded_file = st.file_uploader("Choose an image...", type="jpg")
if uploaded_file is not None:
# Display the uploaded image
image = Image.open(uploaded_file)
st.image(image, caption="Uploaded Image", use_column_width=True)
# Perform image classification using the Hugging Face pipeline
st.write("Classifying...")
predictions = classifier(image)
# Display the results
for pred in predictions:
st.write(f"Label: {pred['label']}, Score: {pred['score']:.4f}")