Spaces:
Runtime error
Runtime error
Tushar-Thoriya
commited on
Commit
•
6022569
1
Parent(s):
65c0aac
Update app.py
Browse files
app.py
CHANGED
@@ -36,16 +36,16 @@ model.eval()
|
|
36 |
|
37 |
EXAMPLES_FOLDER = 'examples'
|
38 |
examples_names = os.listdir(EXAMPLES_FOLDER)
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
|
50 |
def predict(input_image:Image.Image, true_label:str):
|
51 |
"""Predict the label of the input_image"""
|
|
|
36 |
|
37 |
EXAMPLES_FOLDER = 'examples'
|
38 |
examples_names = os.listdir(EXAMPLES_FOLDER)
|
39 |
+
examples = []
|
40 |
+
for example_name in examples_names:
|
41 |
+
example_path = os.path.join(EXAMPLES_FOLDER, example_name)
|
42 |
+
label = example_name.split('_')[0]
|
43 |
+
example = {
|
44 |
+
'path': example_path,
|
45 |
+
'label': label
|
46 |
+
}
|
47 |
+
examples.append(example)
|
48 |
+
np.random.shuffle(examples) # shuffle
|
49 |
|
50 |
def predict(input_image:Image.Image, true_label:str):
|
51 |
"""Predict the label of the input_image"""
|