Vishalakak commited on
Commit
1f6a386
·
1 Parent(s): d24225f

added dropdown features

Browse files
Files changed (2) hide show
  1. app.py +9 -9
  2. templates/index.html +23 -11
app.py CHANGED
@@ -25,16 +25,16 @@ LABELS = {
25
  }
26
  # Dictionary of placeholders for each feature
27
  placeholders = {
28
- 'Operation_Mode': 'low-1,med-2,high-3',
29
  'Temperature_C': 'Enter the temprature',
30
- 'Vibration_Hz': 'Enter in range(0.1-5)',
31
- 'Power_Consumption_kW': 'Enter in range(1-10)',
32
- 'Network_Latency_ms': 'Enter in range(1-50)',
33
- 'Packet_Loss_%': 'e.g., 0.5....to 5',
34
- 'Quality_Control_Defect_Rate_%': 'Enter in range(1-10)',
35
- 'Production_Speed_units_per_hr': 'e.g., 1000',
36
- 'Predictive_Maintenance_Score': 'e.g., 85',
37
- 'Error_Rate_%': 'e.g., 1.2',
38
 
39
  }
40
 
 
25
  }
26
  # Dictionary of placeholders for each feature
27
  placeholders = {
28
+ 'Operation_Mode': 'Select Operation Mode',
29
  'Temperature_C': 'Enter the temprature',
30
+ 'Vibration_Hz': 'Enter the Vibration',
31
+ 'Power_Consumption_kW': 'Enter the power consuption',
32
+ 'Network_Latency_ms': 'Enter the network latency',
33
+ 'Packet_Loss_%': 'Enter Packet Loss:',
34
+ 'Quality_Control_Defect_Rate_%': 'Enter quality Defect Rate',
35
+ 'Production_Speed_units_per_hr': 'Enter Production Unit',
36
+ 'Predictive_Maintenance_Score': 'Enter Maintenance Score',
37
+ 'Error_Rate_%': 'Enter Error Rate',
38
 
39
  }
40
 
templates/index.html CHANGED
@@ -56,14 +56,14 @@
56
  color: #34495e;
57
  }
58
 
59
- input[type="text"] {
60
  padding: 10px;
61
  border: 1px solid #ccc;
62
  border-radius: 6px;
63
  transition: border-color 0.3s;
64
  }
65
 
66
- input[type="text"]:focus {
67
  border-color: #3498db;
68
  outline: none;
69
  }
@@ -104,22 +104,34 @@
104
  <h1>Smart Manufacturing Machines Efficiency Prediction</h1>
105
 
106
  <form method="post" class="form-container">
107
- <div class="form-grid">
108
- {% for feature in features %}
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  <div class="form-group">
110
  <label for="{{ feature }}">{{ feature }}:</label>
111
  <input type="text" name="{{ feature }}" placeholder="{{ placeholders[feature] }}" required>
112
-
113
  </div>
114
- {% endfor %}
115
- </div>
 
116
 
117
- <button type="submit" class="submit-btn">PREDICT</button>
118
  </form>
119
 
120
  {% if prediction %}
121
  <h2>Prediction : {{ prediction }}</h2>
122
- {% endif %}
123
  </body>
124
-
125
- </html>
 
56
  color: #34495e;
57
  }
58
 
59
+ input[type="text"], select {
60
  padding: 10px;
61
  border: 1px solid #ccc;
62
  border-radius: 6px;
63
  transition: border-color 0.3s;
64
  }
65
 
66
+ input[type="text"]:focus, select:focus {
67
  border-color: #3498db;
68
  outline: none;
69
  }
 
104
  <h1>Smart Manufacturing Machines Efficiency Prediction</h1>
105
 
106
  <form method="post" class="form-container">
107
+ <div class="form-grid">
108
+ <!-- First, manually add dropdown for Operation_Mode -->
109
+ <div class="form-group">
110
+ <label for="Operation_Mode">Operation Mode:</label>
111
+ <select name="Operation_Mode" required>
112
+ <option value="">Select Mode</option>
113
+ <option value="1">Low</option>
114
+ <option value="2">Medium</option>
115
+ <option value="3">High</option>
116
+ </select>
117
+ </div>
118
+
119
+ <!-- Then loop through the rest of the features, skipping Operation_Mode -->
120
+ {% for feature in features %}
121
+ {% if feature != 'Operation_Mode' %}
122
  <div class="form-group">
123
  <label for="{{ feature }}">{{ feature }}:</label>
124
  <input type="text" name="{{ feature }}" placeholder="{{ placeholders[feature] }}" required>
 
125
  </div>
126
+ {% endif %}
127
+ {% endfor %}
128
+ </div>
129
 
130
+ <button type="submit" class="submit-btn">PREDICT</button>
131
  </form>
132
 
133
  {% if prediction %}
134
  <h2>Prediction : {{ prediction }}</h2>
135
+ {% endif %}
136
  </body>
137
+ </html>