Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,14 +8,8 @@ import io
|
|
| 8 |
from collections import Counter
|
| 9 |
import numpy as np
|
| 10 |
|
| 11 |
-
def load_image():
|
| 12 |
-
uploaded_file = st.file_uploader(label='Pick an image to test')
|
| 13 |
-
if uploaded_file is not None:
|
| 14 |
-
image_data = uploaded_file.getvalue()
|
| 15 |
-
st.image(image_data)
|
| 16 |
-
|
| 17 |
def load_models():
|
| 18 |
-
model_name = 'Model/
|
| 19 |
model = tf.keras.models.load_model(model_name)
|
| 20 |
return model
|
| 21 |
|
|
@@ -43,7 +37,7 @@ def predict(model, img):
|
|
| 43 |
if prediction[0]>0.5:
|
| 44 |
return 'ripe'
|
| 45 |
else:
|
| 46 |
-
return '
|
| 47 |
|
| 48 |
def main():
|
| 49 |
st.title('Mango Ripeness Classifier 🥭')
|
|
|
|
| 8 |
from collections import Counter
|
| 9 |
import numpy as np
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
def load_models():
|
| 12 |
+
model_name = 'Model/mango_new_model.h5'
|
| 13 |
model = tf.keras.models.load_model(model_name)
|
| 14 |
return model
|
| 15 |
|
|
|
|
| 37 |
if prediction[0]>0.5:
|
| 38 |
return 'ripe'
|
| 39 |
else:
|
| 40 |
+
return 'unripe'
|
| 41 |
|
| 42 |
def main():
|
| 43 |
st.title('Mango Ripeness Classifier 🥭')
|