Spaces:
Runtime error
Runtime error
lucifertrj commited on
Commit ·
fa5a56f
1
Parent(s): 8eb0a0f
make space
Browse files- 1.jpg +0 -0
- 2.jpg +0 -0
- app.py +23 -0
- model_classifer.h5 +3 -0
- requirements.txt +4 -0
1.jpg
ADDED
|
2.jpg
ADDED
|
app.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from tensorflow.keras import models,utils
|
| 3 |
+
import numpy as np
|
| 4 |
+
|
| 5 |
+
st.header("Vehicle Check")
|
| 6 |
+
img = st.file_uploader("Upload the vehicle Image")
|
| 7 |
+
if img:
|
| 8 |
+
model = models.load_model("model_classifer.h5")
|
| 9 |
+
img = utils.load_img(img,target_size = (224,224,3))
|
| 10 |
+
x = utils.img_to_array(img)
|
| 11 |
+
x = np.expand_dims(x,axis=0)
|
| 12 |
+
|
| 13 |
+
target = model.predict(x)
|
| 14 |
+
target = np.argmax(target)
|
| 15 |
+
|
| 16 |
+
if target:
|
| 17 |
+
st.markdown("#### The vehicle is in good state")
|
| 18 |
+
st.markdown("<span style='color:green'>Regular check up done</span>", unsafe_allow_html=True)
|
| 19 |
+
else:
|
| 20 |
+
st.markdown("#### The vehicle is in pretty bad state.")
|
| 21 |
+
st.markdown("<span style='color:red'>Needs to be inspected</span>", unsafe_allow_html=True)
|
| 22 |
+
|
| 23 |
+
st.image(img)
|
model_classifer.h5
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2555dfaa038030c97c377fd582f4b72a0572d929c3d958008ea16de689d139fc
|
| 3 |
+
size 143462688
|
requirements.txt
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
tensorflow
|
| 2 |
+
numpy
|
| 3 |
+
streamlit
|
| 4 |
+
pillow
|