| 170 | return panel |
| 171 | |
| 172 | def create_right_panel(self): |
| 173 | panel = QWidget() |
| 174 | layout = QVBoxLayout() |
| 175 | panel.setLayout(layout) |
| 176 | |
| 177 | results_group = QGroupBox('Prediction Results') |
| 178 | results_layout = QVBoxLayout() |
| 179 | |
| 180 | self.main_prediction = QLabel('No prediction yet') |
| 181 | self.main_prediction.setFont(QFont('Arial', 24, QFont.Weight.Bold)) |
| 182 | self.main_prediction.setAlignment(Qt.AlignmentFlag.AlignCenter) |
| 183 | self.main_prediction.setStyleSheet('color: #4CAF50; padding: 20px;') |
| 184 | results_layout.addWidget(self.main_prediction) |
| 185 | |
| 186 | self.confidence_label = QLabel('') |
| 187 | self.confidence_label.setFont(QFont('Arial', 16)) |
| 188 | self.confidence_label.setAlignment(Qt.AlignmentFlag.AlignCenter) |
| 189 | results_layout.addWidget(self.confidence_label) |
| 190 | |
| 191 | self.progress_bar = QProgressBar() |
| 192 | self.progress_bar.setVisible(False) |
| 193 | results_layout.addWidget(self.progress_bar) |
| 194 | |
| 195 | results_group.setLayout(results_layout) |
| 196 | layout.addWidget(results_group) |
| 197 | |
| 198 | top5_group = QGroupBox('Top-5 Predictions') |
| 199 | top5_layout = QVBoxLayout() |
| 200 | |
| 201 | self.top5_display = QTextEdit() |
| 202 | self.top5_display.setReadOnly(True) |
| 203 | self.top5_display.setMinimumHeight(200) |
| 204 | top5_layout.addWidget(self.top5_display) |
| 205 | |
| 206 | top5_group.setLayout(top5_layout) |
| 207 | layout.addWidget(top5_group) |
| 208 | |
| 209 | info_group = QGroupBox('Model Information') |
| 210 | info_layout = QVBoxLayout() |
| 211 | |
| 212 | self.model_info = QTextEdit() |
| 213 | self.model_info.setReadOnly(True) |
| 214 | self.model_info.setMaximumHeight(150) |
| 215 | info_layout.addWidget(self.model_info) |
| 216 | |
| 217 | info_group.setLayout(info_layout) |
| 218 | layout.addWidget(info_group) |
| 219 | |
| 220 | layout.addStretch() |
| 221 | |
| 222 | return panel |
| 223 | |
| 224 | def apply_stylesheet(self): |
| 225 | qss = """ |