Model Architecture
Key Features
Prediction Endpoint (excerpt)
python
@app.route('/predict', methods=['POST'])
def predict():
file = request.files['image']
img = image.load_img(file, target_size=(150, 150))
img_array = image.img_to_array(img) / 255.0
img_array = np.expand_dims(img_array, axis=0)
prediction = model.predict(img_array)
label = 'Dog' if prediction[0][0] > 0.5 else 'Cat'
return jsonify({'result': label, 'confidence': float(prediction[0][0])})