import sys, os, cv2
from keras.models import load_model
import keras.backend as K
import numpy as np

if __name__ == "__main__":
    m = load_model("l_p_model.h5")

    fn = sys.argv[1]
    lr = cv2.imread(fn)[:, :, ::-1]

    im = m.predict(lr[None, :])[0]
    im = np.clip(im, 0, 255).round().astype("uint8")
    cv2.imwrite("x8.png", im[:, :, ::-1])
