slinteg / app.py
abcdef12356's picture
Update app.py
0e256ab
raw
history blame contribute delete
516 Bytes
import cv2
import streamlit as st
from fastai.vision.all import *
st.markdown('<h1 style="color:black;">BDI Image classification model</h1>', unsafe_allow_html=True)
learn = load_learner('export (5).pkl')
upload = st.file_uploader('Insert image for classification', type=['png','jpg'])
c1, c2= st.columns(2)
if upload is not None:
im= Image.open(upload)
c1.header('Input Image')
c1.image(im)
pred, idx, probs = learn.predict(im)
c2.header('Output')
c2.subheader('Predicted class :')
c2.write(pred)