coremltools icon indicating copy to clipboard operation
coremltools copied to clipboard

Sometimes, the output image will be rotated?

Open fg0521 opened this issue 1 year ago • 1 comments

❓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")],
    )

63537EC1-9154-42B6-BE60-BC3C8DA6DFA1

fg0521 avatar Jun 26 '24 02:06 fg0521

Can you share code to reproduce this result?

TobyRoseman avatar Jul 01 '24 23:07 TobyRoseman