# What is ViTImageProcessor doing?

**URL:** <https://discuss.huggingface.co/t/what-is-vitimageprocessor-doing/82132>\
**Category:** Intermediate\
**Created:** [April 17, 2024, 1:13am UTC](https://discuss.huggingface.co/t/what-is-vitimageprocessor-doing/82132 "2024-04-17T01:13:32Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![raygx](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/raygx/32/17328_2.png) [@raygx](https://discuss.huggingface.co/u/raygx)\
**Post date:** [April 18, 2024, 1:36pm UTC](https://discuss.huggingface.co/t/what-is-vitimageprocessor-doing/82132/4 "2024-04-18T13:36:36Z")

</div>

@amyeroberts Thanks for your reply! I just figured what is happening.

But just for the record, I am gonna add this.

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/2/d/2dc8a36f81522938d644c500dbdccb9333a1c2b3.png)

I was doing Reshape. But It turns out, ImageProcessor is doing Transpose.  
The solution I found for myself is:

```auto
normalized = ( rescaled_image - 0.5 ) / 0.5 
tf.transpose(normalized , perm=(2,0,1))

```

which results in

```auto
<tf.Tensor: shape=(10,), dtype=float32, numpy=
array([-0.5384153 , -0.56822723, -0.50992393, -0.6224089 , -0.58579427,
       -0.62336934, -0.6540616 , 0.17835152, 0.34901977, 0.8013607 ],
      dtype=float32)>

```

Thanks.

---

_[View the full topic](https://discuss.huggingface.co/t/what-is-vitimageprocessor-doing/82132)._
