MCPcopy Create free account
hub / github.com/geekcomputers/Python / display_results

Method display_results

ML/src/python/neuralforge/cli/gui.py:458–474  ·  view source on GitHub ↗
(self, predictions, confidences, main_prediction)

Source from the content-addressed store, hash-verified

456 self.prediction_thread.start()
457
458 def display_results(self, predictions, confidences, main_prediction):
459 self.progress_bar.setVisible(False)
460 self.predict_btn.setEnabled(True)
461
462 self.main_prediction.setText(f'🎯 {main_prediction}')
463 self.main_prediction.setStyleSheet('color: #4CAF50; padding: 20px; font-size: 28px;')
464
465 self.confidence_label.setText(f'Confidence: {confidences[0]:.2f}%')
466
467 top5_text = '<h3>Top-5 Predictions:</h3><hr>'
468 for i, (pred, conf) in enumerate(zip(predictions, confidences), 1):
469 bar_width = int(conf * 3)
470 bar = '█' * bar_width
471 top5_text += f'<p style="margin: 10px 0;"><b>{i}. {pred}</b><br>'
472 top5_text += f'<span style="color: #4CAF50;">{bar}</span> {conf:.2f}%</p>'
473
474 self.top5_display.setHtml(top5_text)
475
476 def display_error(self, error_msg):
477 self.progress_bar.setVisible(False)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected