rasyidf commited on
Commit
3f7d8d0
·
1 Parent(s): 84c3bec

Update Model

Browse files
Files changed (4) hide show
  1. README.md +2 -2
  2. app.py +15 -0
  3. mymodel.h5 +3 -0
  4. requirements.txt +2 -0
README.md CHANGED
@@ -1,6 +1,6 @@
1
  ---
2
- title: Coffee Grader
3
- emoji: 🐢
4
  colorFrom: blue
5
  colorTo: blue
6
  sdk: gradio
 
1
  ---
2
+ title: Coffee Bean Grader
3
+ emoji:
4
  colorFrom: blue
5
  colorTo: blue
6
  sdk: gradio
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import tensorflow
2
+ from tensorflow import keras
3
+ import gradio as gr
4
+
5
+ model = keras.models.load_model('mymodel.h5')
6
+ potato_classes = ['Grade_3','Grade_2','Grade_1']
7
+
8
+ def predict_input_image(img):
9
+ img_3d=img.reshape(-1,256,256,3)
10
+ prediction=model.predict(img_3d)[0]
11
+ return {potato_classes[i]: float(prediction[i]) for i in range(3)}
12
+
13
+ image = gr.inputs.Image(shape=(256,256))
14
+ label = gr.outputs.Label(num_top_classes=3)
15
+ gr.Interface(fn=predict_input_image, inputs=image, outputs=label,interpretation='default').launch()
mymodel.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:99c620a6eead6ed33d6cf6b6ab1d0494d2735c59cd2bbefa809527234f3798f6
3
+ size 34118040
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ numpy==1.21.6
2
+ tensorflow==2.9.2