Spaces:
Runtime error
Runtime error
updating to cast parts
Browse files
app.py
CHANGED
@@ -7,13 +7,11 @@ import os
|
|
7 |
from tensorflow.keras.models import load_model
|
8 |
from reader import get_article
|
9 |
|
10 |
-
|
11 |
### -------------------------------- ###
|
12 |
### model loading ###
|
13 |
### -------------------------------- ###
|
14 |
model = load_model('model.h5') # single file model from colab
|
15 |
|
16 |
-
|
17 |
## --------------------------------- ###
|
18 |
### reading: categories.txt ###
|
19 |
### -------------------------------- ###
|
@@ -24,18 +22,16 @@ if os.path.isfile("categories.txt"):
|
|
24 |
categories = open("categories.txt", "r")
|
25 |
labels = categories.readline().split()
|
26 |
|
27 |
-
|
28 |
## --------------------------------- ###
|
29 |
### reading: info.txt ###
|
30 |
### -------------------------------- ###
|
31 |
# borrow file reading functionality from reader.py
|
32 |
info = get_article()
|
33 |
|
34 |
-
|
35 |
### -------------------------------- ###
|
36 |
### interface creation ###
|
37 |
### -------------------------------- ###
|
38 |
-
samples = ['
|
39 |
|
40 |
def preprocess(image):
|
41 |
image = np.array(image) / 255
|
|
|
7 |
from tensorflow.keras.models import load_model
|
8 |
from reader import get_article
|
9 |
|
|
|
10 |
### -------------------------------- ###
|
11 |
### model loading ###
|
12 |
### -------------------------------- ###
|
13 |
model = load_model('model.h5') # single file model from colab
|
14 |
|
|
|
15 |
## --------------------------------- ###
|
16 |
### reading: categories.txt ###
|
17 |
### -------------------------------- ###
|
|
|
22 |
categories = open("categories.txt", "r")
|
23 |
labels = categories.readline().split()
|
24 |
|
|
|
25 |
## --------------------------------- ###
|
26 |
### reading: info.txt ###
|
27 |
### -------------------------------- ###
|
28 |
# borrow file reading functionality from reader.py
|
29 |
info = get_article()
|
30 |
|
|
|
31 |
### -------------------------------- ###
|
32 |
### interface creation ###
|
33 |
### -------------------------------- ###
|
34 |
+
samples = ['okay.jpeg', 'deffective.jpeg']
|
35 |
|
36 |
def preprocess(image):
|
37 |
image = np.array(image) / 255
|
defective.jpeg
ADDED
model.h5
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:aacf5ddc63a89f828b15fbb0fe87b7c28fce1b521271fe7a2ac563809ac23a9c
|
3 |
+
size 134670360
|
okay.jpeg
ADDED