Beasto's picture
Update app.py
8cb52ea
import tensorflow as tf
from PIL import Image
import numpy as np
import streamlit as st
img = st.file_uploader("Choose a file")
model = tf.keras.models.load_model('RockPaperScissor.h5')
if img is not None:
img = Image.open(img)
img = img.resize((256,256))
img = np.reshape(img,(1,256,256,3))
pred = model.predict(img)
st.write(pred)
pred = np.argmax(pred)
if pred == 0:
st.write('PAPER')
elif pred == 1:
st.write('ROCK')
else:
st.write('SCISSOR')