# Vision Transformer reconstruct image

**URL:** <https://discuss.huggingface.co/t/vision-transformer-reconstruct-image/18238>\
**Category:** 🤗Transformers\
**Created:** [May 22, 2022, 5:30pm UTC](https://discuss.huggingface.co/t/vision-transformer-reconstruct-image/18238 "2022-05-22T17:30:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcomameli01](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@marcomameli01](https://discuss.huggingface.co/u/marcomameli01)\
**Post date:** [May 22, 2022, 5:30pm UTC](https://discuss.huggingface.co/t/vision-transformer-reconstruct-image/18238/1 "2022-05-22T17:30:54Z")

</div>

Dear,  
from the output of a ViT how I can reconstruct an image of features like the output of a CNN?

I need this kind of representation for a network that uses that representation for the information information.

---

<div class="post-metadata">

**Author:** ![marcomameli01](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@marcomameli01](https://discuss.huggingface.co/u/marcomameli01)\
**Post date:** [July 21, 2022, 7:23am UTC](https://discuss.huggingface.co/t/vision-transformer-reconstruct-image/18238/2 "2022-07-21T07:23:52Z")

</div>

Hello,  
I need to obtain an output like the features images in the video of that image

 ![attention_maps](https://us1.discourse-cdn.com/hellohellohello/original/2X/c/c0bad13471baed783691c956a8193598bbf78245.jpeg)  
to use that image as input for another piece of the network.

---

<div class="post-metadata">

**Author:** ![nielsr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nielsr/32/39617_2.png) [@nielsr](https://discuss.huggingface.co/u/nielsr)\
**Post date:** [July 21, 2022, 11:19am UTC](https://discuss.huggingface.co/t/vision-transformer-reconstruct-image/18238/3 "2022-07-21T11:19:45Z")

</div>

Hi,

See my notebook here: [Transformers-Tutorials/Visualize\_self\_attention\_of\_DINO.ipynb at master · NielsRogge/Transformers-Tutorials · GitHub](https://github.com/NielsRogge/Transformers-Tutorials/blob/master/DINO/Visualize_self_attention_of_DINO.ipynb).
