Update app.py
Browse files
app.py
CHANGED
@@ -8,6 +8,7 @@ with open('model-r.pkl', 'rb') as f:
|
|
8 |
|
9 |
# Define action mapping
|
10 |
action_map = {
|
|
|
11 |
1: "Hand at rest",
|
12 |
2: "Hand clenched in a fist",
|
13 |
3: "Wrist flexion",
|
@@ -22,7 +23,7 @@ def action(e1, e2, e3, e4, e5, e6, e7, e8):
|
|
22 |
input_data = np.array([e1, e2, e3, e4, e5, e6, e7, e8])
|
23 |
input_data_reshaped = input_data.reshape(1, -1)
|
24 |
predicted_label = model.predict(input_data_reshaped)[0]
|
25 |
-
return action_map.get(
|
26 |
|
27 |
# Define Gradio UI with improved styling
|
28 |
with gr.Blocks(theme=gr.themes.Soft()) as iface:
|
|
|
8 |
|
9 |
# Define action mapping
|
10 |
action_map = {
|
11 |
+
0: "CLASS0ACTION"
|
12 |
1: "Hand at rest",
|
13 |
2: "Hand clenched in a fist",
|
14 |
3: "Wrist flexion",
|
|
|
23 |
input_data = np.array([e1, e2, e3, e4, e5, e6, e7, e8])
|
24 |
input_data_reshaped = input_data.reshape(1, -1)
|
25 |
predicted_label = model.predict(input_data_reshaped)[0]
|
26 |
+
return action_map.get(predicted_label, "Unknown action")
|
27 |
|
28 |
# Define Gradio UI with improved styling
|
29 |
with gr.Blocks(theme=gr.themes.Soft()) as iface:
|