Stefan Langenbach commited on
Commit
f27c131
·
1 Parent(s): 382c697
Files changed (5) hide show
  1. .gitattributes +1 -0
  2. app.py +24 -0
  3. chemical.jpg +3 -0
  4. chemical.pkl +3 -0
  5. power.jpg +3 -0
.gitattributes CHANGED
@@ -32,3 +32,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
32
  *.zip filter=lfs diff=lfs merge=lfs -text
33
  *.zst filter=lfs diff=lfs merge=lfs -text
34
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
32
  *.zip filter=lfs diff=lfs merge=lfs -text
33
  *.zst filter=lfs diff=lfs merge=lfs -text
34
  *tfevents* filter=lfs diff=lfs merge=lfs -text
35
+ *.jpg filter=lfs diff=lfs merge=lfs -text
app.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from fastai.vision.all import * # noqa: ruff[F403]
3
+
4
+ learner = load_learner("chemical.pkl")
5
+
6
+
7
+ def classify(img):
8
+ pred, idx, probs = learner.predict(img)
9
+
10
+ return dict(zip(("chemical plant", "power plant"), map(float, probs)))
11
+
12
+
13
+ image = gr.inputs.Image(
14
+ label="Upload image of chemical or power plant", type="filepath", shape=(192, 192)
15
+ )
16
+ label = gr.outputs.Label()
17
+ examples = ["chemical.jpg", "power.jpg"]
18
+
19
+ gr.Interface(
20
+ classify,
21
+ inputs=image,
22
+ outputs=label,
23
+ title="Chemical plant? Or Not?",
24
+ )
chemical.jpg ADDED

Git LFS Details

  • SHA256: a896b8e0cdb746ab63a600b0dcea5bb8345ebffdb1c7cf94be4e48ca829681ca
  • Pointer size: 132 Bytes
  • Size of remote file: 5.82 MB
chemical.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ae2613382e53a8e95c19f4d8f8024ba92346af16afcfe441a622285dc071ec8d
3
+ size 46971770
power.jpg ADDED

Git LFS Details

  • SHA256: d30011674a36067fda2f3140683458e4cb9a605cca6fdc8dbbaad1faf34b719a
  • Pointer size: 132 Bytes
  • Size of remote file: 1.13 MB