Set confidence threshold to 80% and remove slider from frontend

 Frontend Changes:
- Removed confidence threshold slider from web interface
- Added fixed 80% confidence display with green info box
- Updated JavaScript to use fixed 0.8 threshold
- Removed slider-related CSS styles

 Backend Changes:
- Updated all API endpoints to default to 80% confidence (0.8)
- Modified POST /detect, GET /detect/hardcoded, POST /detect/base64
- Updated comments to reflect new default threshold

 Testing Updates:
- Updated test_api.py to use 80% confidence for all tests
- Ensures consistent testing with new threshold

 Benefits:
- High precision mode (80% confidence) reduces false positives
- Simplified user interface without threshold adjustment
- Consistent detection behavior across all endpoints
This commit is contained in:
Aherobo Ovie Victor
2025-07-11 20:47:04 +01:00
parent c4de90fbec
commit 26a6f6f625
6 changed files with 31 additions and 40 deletions
+3 -3
View File
@@ -53,7 +53,7 @@ def test_hardcoded_detection():
"""Test detection with hardcoded image."""
print("\n🖼️ Testing Hardcoded Image Detection...")
try:
response = requests.get(f"{BASE_URL}/detect/hardcoded?confidence=0.5")
response = requests.get(f"{BASE_URL}/detect/hardcoded?confidence=0.8")
if response.status_code == 200:
data = response.json()
if data['success']:
@@ -105,7 +105,7 @@ def test_file_upload():
try:
with open(test_image_path, 'rb') as f:
files = {'image': f}
data = {'confidence': '0.5'}
data = {'confidence': '0.8'}
response = requests.post(f"{BASE_URL}/detect", files=files, data=data)
if response.status_code == 200:
@@ -165,7 +165,7 @@ def test_base64_detection():
# Send request
payload = {
'image': base64_string,
'confidence': 0.5
'confidence': 0.8
}
response = requests.post(