Hello everyone,
I am trying to convert the CycleGAN model to .mlmodel to be used on IOS application. The problem is that the model is producing a different result than what it produces in Python. I came across similar questions, and from what I understood is that I should preprocess the input data of mlmodel in the same way it is processed in Python. Can anyone help me to do the preprocessing required of the CycleGAN?
This is the preprocessing done in Python:
And here is the code where I should provide the preprocessing:
Can anyone provide me with the correct argument values should I enter?
I am trying to convert the CycleGAN model to .mlmodel to be used on IOS application. The problem is that the model is producing a different result than what it produces in Python. I came across similar questions, and from what I understood is that I should preprocess the input data of mlmodel in the same way it is processed in Python. Can anyone help me to do the preprocessing required of the CycleGAN?
This is the preprocessing done in Python:
Code Block Transfrom from int image ([0,255]) to float tensor ([-1.,1.]) """ image = tf.image.convert_image_dtype(image, dtype=tf.float32) return (image/127.5) - 1.0
And here is the code where I should provide the preprocessing:
Code Block mlmodel = tfcoreml.convert('./savedmodel', input_name_shape_dict={input_name: (1, 256, 256, 3)}, output_feature_names=[graph_output_node_name], minimum_ios_deployment_target='13', image_input_names=input_name, image_scale=2/ 255.0, red_bias=-1, green_bias=-1, blue_bias=-1 ) mlmodel.save('./cyclegan.mlmodel')
Can anyone provide me with the correct argument values should I enter?