drmurataltun commited on
Commit
58c49bb
·
verified ·
1 Parent(s): f519dc3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -6,17 +6,17 @@ from tensorflow.keras.models import load_model
6
  from PIL import Image
7
  import numpy as np
8
  import cv2
9
- model=load_model('rice_class_cnn.h5')
10
  def process_image(img):
11
- img=img.resize((224,224))
12
  img=np.array(img)
13
  img=img/255.0
14
  img=np.expand_dims(img,axis=0)
15
  return img
16
- st.title('prinç sınıflandırma @drmurataltun')
17
- st.write('Resim sec ve model tahmin etsin')
18
  file=st.file_uploader('Bir resim seç', type= ['jpg','jpeg','png'])
19
- class_names=['Arborio','Basmati','Ipsala','Jasmine','Karacadag']
20
  if file is not None:
21
  img=Image.open(file)
22
  st.image(img,caption='yuklenen resim')
@@ -24,4 +24,4 @@ if file is not None:
24
  prediction=model.predict(image)
25
  predicted_class=np.argmax(prediction)
26
  st.write(prediction)
27
- st.write('Tahmin: ',class_names[predicted_class])
 
6
  from PIL import Image
7
  import numpy as np
8
  import cv2
9
+ model=load_model('tr_banknot_model.h5')
10
  def process_image(img):
11
+ img=img.resize((30,30))
12
  img=np.array(img)
13
  img=img/255.0
14
  img=np.expand_dims(img,axis=0)
15
  return img
16
+ st.title('Tr Banknot @drmurataltun')
17
+ st.write('Banknot resmini yükleyin')
18
  file=st.file_uploader('Bir resim seç', type= ['jpg','jpeg','png'])
19
+ class_names=['5','10','20','50','100', '200']
20
  if file is not None:
21
  img=Image.open(file)
22
  st.image(img,caption='yuklenen resim')
 
24
  prediction=model.predict(image)
25
  predicted_class=np.argmax(prediction)
26
  st.write(prediction)
27
+ st.write('Tahmin:₺',class_names[predicted_class])