emirkaanozdemr
commited on
Commit
•
1004fe4
1
Parent(s):
07c65b7
Upload 3 files
Browse files- app.py +14 -2
- model.h5 +2 -2
- requirements.txt +1 -1
app.py
CHANGED
@@ -4,7 +4,7 @@ from tensorflow.keras.models import load_model
|
|
4 |
import numpy as np
|
5 |
|
6 |
model=load_model("model.h5")
|
7 |
-
st.title("
|
8 |
img=st.camera_input("Camera")
|
9 |
def process_image(input_img):
|
10 |
if input_img.mode == 'RGBA':
|
@@ -19,4 +19,16 @@ if img is not None:
|
|
19 |
image=process_image(img)
|
20 |
prediction=model.predict(image)
|
21 |
predicted_class=np.argmax(prediction)
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
import numpy as np
|
5 |
|
6 |
model=load_model("model.h5")
|
7 |
+
st.title("Plant Seedlings Detection")
|
8 |
img=st.camera_input("Camera")
|
9 |
def process_image(input_img):
|
10 |
if input_img.mode == 'RGBA':
|
|
|
19 |
image=process_image(img)
|
20 |
prediction=model.predict(image)
|
21 |
predicted_class=np.argmax(prediction)
|
22 |
+
class_names=["Black-grass",
|
23 |
+
"Charlock",
|
24 |
+
"Cleavers",
|
25 |
+
"Common Chickweed",
|
26 |
+
"Common wheat",
|
27 |
+
"Fat Hen",
|
28 |
+
"Loose Silky-bent",
|
29 |
+
"Maize",
|
30 |
+
"Scentless Mayweed",
|
31 |
+
"Shepherds Purse",
|
32 |
+
"Small-flowered Cranesbill",
|
33 |
+
"Sugar beet"]
|
34 |
+
st.write(class_names[predicted_class])
|
model.h5
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:718dfae95e4654cb18eaec536f14172da51ef690c007ad5fd71bdc57c6a4909b
|
3 |
+
size 11556304
|
requirements.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
streamlit
|
2 |
-
tensorflow
|
3 |
pillow
|
|
|
4 |
numpy
|
|
|
1 |
streamlit
|
|
|
2 |
pillow
|
3 |
+
tensorflow
|
4 |
numpy
|