Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from transformers import
|
| 3 |
import torch
|
| 4 |
import numpy as np
|
| 5 |
from PIL import Image
|
|
@@ -19,7 +19,8 @@ def process_image(image_path):
|
|
| 19 |
image = image.resize((512,int(512*image.size[1]/image.size[0])),Image.Resampling.LANCZOS)
|
| 20 |
|
| 21 |
# prepare image for the model
|
| 22 |
-
encoding = feature_extractor(image, return_tensors="pt")
|
|
|
|
| 23 |
|
| 24 |
# forward pass
|
| 25 |
with torch.no_grad():
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from transformers import DPTImageProcessor, DPTForDepthEstimation
|
| 3 |
import torch
|
| 4 |
import numpy as np
|
| 5 |
from PIL import Image
|
|
|
|
| 19 |
image = image.resize((512,int(512*image.size[1]/image.size[0])),Image.Resampling.LANCZOS)
|
| 20 |
|
| 21 |
# prepare image for the model
|
| 22 |
+
# encoding = feature_extractor(image, return_tensors="pt")
|
| 23 |
+
inputs = processor(images=image, return_tensors="pt")
|
| 24 |
|
| 25 |
# forward pass
|
| 26 |
with torch.no_grad():
|