ecvalve/Predict.py
2025-09-01 21:43:35 +01:00

14 lines
378 B
Python

import tensorflow as tf
import numpy as np
import tensorflow as tf
import numpy as np
model = tf.keras.models.load_model('EcValve_1.h5')
input_data = np.array([[-0.029184604, 7, 60]], dtype=np.float32) # Shape: (1, 3)
prediction = model.predict(input_data)
print("Prediction (probability of leak):", prediction)
print("Leak detected" if prediction[0] > 0.5 else "No leak")