Alp İpekçiler commited on
Commit
888d9dd
·
1 Parent(s): a323602

Fix: Add predicted_label field and detection/gender fields for frontend compatibility

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -117,11 +117,14 @@ def predict_pet():
117
  logger.info(f"Prediction: {top_5_breeds[0]['breed']} ({top_5_breeds[0]['confidence']:.2%})")
118
 
119
  return jsonify({
 
120
  'breed': top_5_breeds[0]['breed'],
121
  'confidence': top_5_breeds[0]['confidence'],
122
  'top_5': top_5_breeds,
123
  'model': 'ConvNextV2-large-DogBreed',
124
- 'accuracy': '91.39%'
 
 
125
  })
126
 
127
  except Exception as e:
 
117
  logger.info(f"Prediction: {top_5_breeds[0]['breed']} ({top_5_breeds[0]['confidence']:.2%})")
118
 
119
  return jsonify({
120
+ 'predicted_label': top_5_breeds[0]['breed'],
121
  'breed': top_5_breeds[0]['breed'],
122
  'confidence': top_5_breeds[0]['confidence'],
123
  'top_5': top_5_breeds,
124
  'model': 'ConvNextV2-large-DogBreed',
125
+ 'accuracy': '91.39%',
126
+ 'detection': {'box': {'x': 0, 'y': 0, 'width': 0, 'height': 0}},
127
+ 'gender': 'Unknown'
128
  })
129
 
130
  except Exception as e: