    # To read image file buffer as a 3D uint8 tensor with torchvision.io:
    bytes_data = img_file_buffer.getvalue()
    torch_img = torchvision.io.decode_image(
        torch.frombuffer(bytes_data, dtype=torch.uint8)
    )
# Check the type of torch_img:
# Should output: <class 'torch.Tensor'>
st.write(type(torch_img))
# Check the shape of torch_img:
# Should output shape: torch.Size([channels, height, width])
st.write(torch_img.shape)
```
PyTorch
Ensure you have installed PyTorch and NumPy.
To read the image file buffer as a 3 dimensional uint8 tensor with PyTorch:
```python
import streamlit as st
import torch
import numpy as np
img_file_buffer = st.camera_input("Take a picture")
if img_file_buffer is not None:
    # To read image file buffer as a 3D uint8 tensor with PyTorch:
    bytes_data = img_file_buffer.getvalue()
