Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 13951

How to display the reconstructed image from huggingface ViTMAEModel?

$
0
0

I am using the following code example:

Using the autoencoder, I want to display the recontracted image. How to display it?

from transformers import AutoImageProcessor, ViTMAEModelfrom PIL import Imageimport requestsurl = "http://images.cocodataset.org/val2017/000000039769.jpg"image = Image.open(requests.get(url, stream=True).raw)image_processor = AutoImageProcessor.from_pretrained("facebook/vit-mae-base")model = ViTMAEModel.from_pretrained("facebook/vit-mae-base")inputs = image_processor(images=image, return_tensors="pt")outputs = model(**inputs)last_hidden_states = outputs.last_hidden_state

Viewing all articles
Browse latest Browse all 13951

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>