Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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('
|
| 10 |
def process_image(img):
|
| 11 |
-
img=img.resize((
|
| 12 |
img=np.array(img)
|
| 13 |
img=img/255.0
|
| 14 |
img=np.expand_dims(img,axis=0)
|
| 15 |
return img
|
| 16 |
-
st.title('
|
| 17 |
-
st.write('
|
| 18 |
file=st.file_uploader('Bir resim seç', type= ['jpg','jpeg','png'])
|
| 19 |
-
class_names=['
|
| 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:
|
|
|
|
| 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])
|