kingabzpro commited on
Commit
5ca4ddd
1 Parent(s): 06a2a0c

model and app file

Browse files
Files changed (3) hide show
  1. .gitattributes +1 -0
  2. app.py +46 -0
  3. glass_pipeline.skops +3 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ glass_pipeline.skops filter=lfs diff=lfs merge=lfs -text
app.py ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import skops.io as sio
3
+
4
+ pipe = sio.load("glass_pipeline.skops", trusted=True)
5
+
6
+ classes = [
7
+ "None",
8
+ "Building Windows Float Processed",
9
+ "Building Windows Non Float Processed",
10
+ "Vehicle Windows Float Processed",
11
+ "Vehicle Windows Non Float Processed",
12
+ "Containers",
13
+ "Tableware",
14
+ "Headlamps",
15
+ ]
16
+
17
+
18
+ def classifier(RI, Na, Mg, Al, Si, K, Ca, Ba, Fe):
19
+ pred_glass = pipe.predict([[RI, Na, Mg, Al, Si, K, Ca, Ba, Fe]])[0]
20
+ label = f"Predicted Glass label: **{classes[pred_glass]}**"
21
+ return label
22
+
23
+
24
+ inputs = [
25
+ gr.Slider(1.51, 1.54, step=0.01, label="Refractive Index"),
26
+ gr.Slider(10, 17, step=1, label="Sodium"),
27
+ gr.Slider(0, 4.5, step=0.5, label="Magnesium"),
28
+ gr.Slider(0.3, 3.5, step=0.1, label="Aluminum"),
29
+ gr.Slider(69.8, 75.4, step=0.1, label="Silicon"),
30
+ gr.Slider(0, 6.2, step=0.1, label="Potassium"),
31
+ gr.Slider(5.4, 16.19, step=0.1, label="Calcium"),
32
+ gr.Slider(0, 3, step=0.1, label="Barium"),
33
+ gr.Slider(0, 0.5, step=0.1, label="Iron"),
34
+ ]
35
+ outputs = [gr.Label(num_top_classes=7)]
36
+
37
+ title = "Glass Classification"
38
+ description = "Enter the details to correctly identify glass type?"
39
+
40
+ gr.Interface(
41
+ fn=classifier,
42
+ inputs=inputs,
43
+ outputs=outputs,
44
+ title=title,
45
+ description=description,
46
+ ).launch()
glass_pipeline.skops ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:278ddba88aa87f13b2635d70a4e5def89c8ca24bac28dfda48ca41cb17720c05
3
+ size 2867730