POSEIDON / Phase_0 /predict.py
JullMol's picture
Initial commit: Uploading POSEIDON Pipeline (Phase 0 & Phase 4)
4cba5e1 verified
Raw
History Blame Contribute Delete
527 Bytes
import json
def load_model(config_path="model_config.json"):
with open(config_path) as f:
return json.load(f)
def predict_length(gt_value, config):
coef = config["coefficients"]
if config["model_type"] == "log_log_power_regression":
return coef["a"] * (gt_value ** coef["b"])
else:
return coef["intercept"] + coef["slope"] * gt_value
if __name__ == "__main__":
cfg = load_model()
gt = float(input("Masukkan nilai GT: "))
print("Prediksi Length:", predict_length(gt, cfg))