Spaces:
Sleeping
Sleeping
Update Traffic_Signs_Classification.py
Browse files
Traffic_Signs_Classification.py
CHANGED
@@ -9,7 +9,7 @@ import torch
|
|
9 |
from IPython.display import Audio
|
10 |
|
11 |
# Streamlit application title
|
12 |
-
st.title("
|
13 |
|
14 |
#Traffic Sign Classification
|
15 |
model= ViTForImageClassification.from_pretrained('Rae1230/Traffic_Signs_Classification')
|
@@ -33,7 +33,8 @@ if uploaded_file is not None:
|
|
33 |
text_col = df['Name']
|
34 |
|
35 |
text_value = text_col.loc[num_col == img_class_idx].values[0]
|
36 |
-
st.
|
|
|
37 |
|
38 |
|
39 |
#speech the Traffic Sign
|
@@ -46,5 +47,6 @@ if uploaded_file is not None:
|
|
46 |
|
47 |
with torch.no_grad():
|
48 |
output = model2(**inputs).waveform
|
49 |
-
|
|
|
50 |
st.audio(output.numpy(),sample_rate=model2.config.sampling_rate)
|
|
|
9 |
from IPython.display import Audio
|
10 |
|
11 |
# Streamlit application title
|
12 |
+
st.title("Phonically describe traffic signs")
|
13 |
|
14 |
#Traffic Sign Classification
|
15 |
model= ViTForImageClassification.from_pretrained('Rae1230/Traffic_Signs_Classification')
|
|
|
33 |
text_col = df['Name']
|
34 |
|
35 |
text_value = text_col.loc[num_col == img_class_idx].values[0]
|
36 |
+
st.subtitle("Predicted traffic sign:")
|
37 |
+
st.write(text_value)
|
38 |
|
39 |
|
40 |
#speech the Traffic Sign
|
|
|
47 |
|
48 |
with torch.no_grad():
|
49 |
output = model2(**inputs).waveform
|
50 |
+
|
51 |
+
st.subtitle("Phonically describe this traffic sign:")
|
52 |
st.audio(output.numpy(),sample_rate=model2.config.sampling_rate)
|