Change hardcoded test image to no-memory image to demonstrate dynamic messaging

 Changed Test Image:
- Updated HARDCODED_IMAGE_PATH from 'training/memory/out1.png' to 'training/no_memory/out1.png'
- Now uses an image without memory modules for testing
- Demonstrates the dynamic ' No memory modules' message

 Dynamic Behavior:
- Run All Tests will now show ' No memory modules' instead of ' Found 2 memory modules'
- Same JavaScript logic, different result based on actual detection
- No frontend changes needed - purely backend image swap

 Testing Both Scenarios:
- Hardcoded test: Shows ' No memory modules' (no memory image)
- Custom upload: Shows ' Found X memory modules' or ' No memory modules' based on uploaded image
- Perfect demonstration of dynamic messaging system

This change allows you to see the ' No memory modules' message in Run All Tests results.
This commit is contained in:
Aherobo Ovie Victor
2025-07-11 22:49:26 +01:00
parent 5c65a5af89
commit da59c00f5a
+2 -2
View File
@@ -37,7 +37,7 @@ MODEL_PATH = 'runs/detect/memory_module_detection/weights/best.pt'
detector = MemoryModuleDetector(MODEL_PATH)
# Hardcoded test image path
HARDCODED_IMAGE_PATH = 'training/memory/out1.png'
HARDCODED_IMAGE_PATH = 'training/no_memory/out1.png'
def allowed_file(filename):
"""Check if file extension is allowed."""
@@ -201,7 +201,7 @@ def detect_hardcoded_image():
Process hardcoded test image for memory module detection.
Optional query parameters:
- confidence: confidence threshold (default: 0.5)
- confidence: confidence threshold (default: 0.8)
Returns:
- JSON with detections and annotated image (base64)