Spaces:
Sleeping
Sleeping
MuhammmadRizwanRizwan
commited on
Commit
•
ea250f3
1
Parent(s):
b6a98cf
Update app.py
Browse files
app.py
CHANGED
@@ -72,7 +72,7 @@ def load_detectron_model(fruit_name):
|
|
72 |
# Labels
|
73 |
label_map_name = {
|
74 |
0: "Banana", 1: "Cucumber", 2: "Grape", 3: "Kaki", 4: "Papaya",
|
75 |
-
5: "Peach", 6: "Pear", 7: "
|
76 |
10: "tomato"
|
77 |
}
|
78 |
label_map_quality = {0: "Good", 1: "Mild", 2: "Rotten"}
|
@@ -110,7 +110,7 @@ def main():
|
|
110 |
st.write(f"Fruits Type Detection: {predicted_name}")
|
111 |
st.write(f"Fruits Quality Classification: {predicted_quality}")
|
112 |
|
113 |
-
if predicted_name.lower() in ["kaki", "tomato", "strawberry", "
|
114 |
st.write("Segmentation of Defective Region:")
|
115 |
try:
|
116 |
predictor, cfg = load_detectron_model(predicted_name)
|
|
|
72 |
# Labels
|
73 |
label_map_name = {
|
74 |
0: "Banana", 1: "Cucumber", 2: "Grape", 3: "Kaki", 4: "Papaya",
|
75 |
+
5: "Peach", 6: "Pear", 7: "Peeper", 8: "Strawberry", 9: "Watermelon",
|
76 |
10: "tomato"
|
77 |
}
|
78 |
label_map_quality = {0: "Good", 1: "Mild", 2: "Rotten"}
|
|
|
110 |
st.write(f"Fruits Type Detection: {predicted_name}")
|
111 |
st.write(f"Fruits Quality Classification: {predicted_quality}")
|
112 |
|
113 |
+
if predicted_name.lower() in ["kaki", "tomato", "strawberry", "peeper", "pear", "peach", "papaya", "watermelon", "grape", "banana", "cucumber"] and predicted_quality in ["Mild", "Rotten"]:
|
114 |
st.write("Segmentation of Defective Region:")
|
115 |
try:
|
116 |
predictor, cfg = load_detectron_model(predicted_name)
|