安装transformer
pip install transformers==4.30.0
from transformers import pipeline
from PIL import Image
import matplotlib.pyplot as plt
estimator = pipeline("depth-estimation",model="Intel/dpt-large")
result = estimator('/cloud/private/huh/scripts/biyelunwen/scale_estimation/dataset/r_95.png')
result["depth"].save('/cloud/private/huh/scripts/biyelunwen/scale_estimation/dataset/95_depth.jpg')
plt.imshow(result["depth"])