coremltools
coremltools copied to clipboard
Sometimes, the output image will be rotated?
❓Question
when I use PIL.Image to input an image, I find the output will be rotated! It's horizontal and vertical flips! if I use opencv to read and convert to PIL.Image , the output will be normal! Then I use other different images, they are all normal. it is interesting! this is my convert function,I think it's right:
model = ct.convert(
traced_model,
convert_to="neuralnetwork",
source='pytorch',
inputs=[ct.ImageType(name="input",
shape=trace_input.shape,
channel_first=True,
color_layout=ct.colorlayout.RGB,
scale=1 / (255.0),
)],
outputs=[ct.TensorType(name="output")],
)
Can you share code to reproduce this result?