Beasto commited on
Commit
0574cff
·
1 Parent(s): 68ce6cd

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import tensorflow as tf
2
+ from PIL import Image
3
+ import numpy as np
4
+ import streamlit as st
5
+
6
+ img = st.file_uploader("Choose a file")
7
+ model = tf.keras.models.load_model('RockPaperScissor.h5')
8
+ if img is not None:
9
+ img = Image.open(img)
10
+ img = img.resize((256,256))
11
+ img = np.reshape(img,(1,256,256,3))
12
+ pred = model.predict(img)
13
+ pred = np.argmax(pred)
14
+ if pred == 0:
15
+ st.write('PAPER')
16
+ elif pred == 1:
17
+ st.write('ROCK')
18
+ elif:
19
+ st.write('SCISSOR')