Spaces:
Sleeping
Sleeping
Olivier commited on
Upload game_engine.py
Browse files- game_engine.py +10 -4
game_engine.py
CHANGED
|
@@ -484,6 +484,8 @@ class MathGame:
|
|
| 484 |
# Structure pour NOUVEAU DATASET CALCUL OCR
|
| 485 |
a, b, operation, correct_result = operation_data
|
| 486 |
|
|
|
|
|
|
|
| 487 |
entry = {
|
| 488 |
"session_id": session_id,
|
| 489 |
"timestamp": session_timestamp,
|
|
@@ -500,14 +502,18 @@ class MathGame:
|
|
| 500 |
"operation": operation,
|
| 501 |
"correct_answer": expected,
|
| 502 |
|
| 503 |
-
# OCR & Résultats
|
| 504 |
-
|
| 505 |
-
"
|
| 506 |
-
"ocr_device": ocr_info.get("device", "Unknown"),
|
| 507 |
"user_answer_ocr": row_data['recognized'],
|
| 508 |
"user_answer_parsed": row_data['recognized_num'],
|
| 509 |
"is_correct": row_data['is_correct'],
|
| 510 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 511 |
# Métadonnées
|
| 512 |
"total_questions": total_questions,
|
| 513 |
"app_version": "3.0_calcul_ocr_parallel" # Mis à jour pour le parallélisme
|
|
|
|
| 484 |
# Structure pour NOUVEAU DATASET CALCUL OCR
|
| 485 |
a, b, operation, correct_result = operation_data
|
| 486 |
|
| 487 |
+
# OCR & Résultats avec détection automatique du modèle
|
| 488 |
+
ocr_info_data = get_ocr_model_info()
|
| 489 |
entry = {
|
| 490 |
"session_id": session_id,
|
| 491 |
"timestamp": session_timestamp,
|
|
|
|
| 502 |
"operation": operation,
|
| 503 |
"correct_answer": expected,
|
| 504 |
|
| 505 |
+
# OCR & Résultats
|
| 506 |
+
"ocr_model": ocr_info_data.get("model_name", "Unknown"),
|
| 507 |
+
"ocr_device": ocr_info_data.get("device", "Unknown"),
|
|
|
|
| 508 |
"user_answer_ocr": row_data['recognized'],
|
| 509 |
"user_answer_parsed": row_data['recognized_num'],
|
| 510 |
"is_correct": row_data['is_correct'],
|
| 511 |
|
| 512 |
+
# Métadonnées
|
| 513 |
+
"total_questions": total_questions,
|
| 514 |
+
"app_version": "3.0_calcul_ocr_parallel"
|
| 515 |
+
}
|
| 516 |
+
|
| 517 |
# Métadonnées
|
| 518 |
"total_questions": total_questions,
|
| 519 |
"app_version": "3.0_calcul_ocr_parallel" # Mis à jour pour le parallélisme
|