-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
32 lines (29 loc) · 1.08 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import streamlit as st
from PIL import Image
st.title("--------- Denomination Detector ---------")
st.write("made as a part of CS299 by Sunny Chaturvedi(1801CS54) and Sohil Yadav(1801CS49)")
st.header("Classifies 6 types of Indian Currency Denominations\n 10, 20, 50, 100, 500, 1000")
st.text("Upload image of Indian Currency note in jpg format")
from img_classification import currency_classification
uploaded_file = st.file_uploader("upload here",type="jpg")
if uploaded_file is not None:
image = Image.open(uploaded_file)
st.image(image, caption='Uploaded Note', use_column_width=True)
st.write("")
st.write("Classifying...")
st.write("Just a minute")
label = currency_classification(image, 'model.h5')
switcher = {
0 : "fifty",
1: "fivehundred",
2: "hundred",
3: "ten",
4:"thousand",
5:"twenty"
}
s=switcher.get(label, "Not Maching")
st.write("Done..")
if s=="Not Maching":
st.write("Enter valid Image")
else :
st.write("This is ", s," rupees note")