Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -14,8 +14,11 @@ model = DPTForDepthEstimation.from_pretrained("Intel/dpt-large")
|
|
14 |
|
15 |
def process_image(image_path):
|
16 |
image_path = Path(image_path)
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
19 |
# prepare image for the model
|
20 |
encoding = feature_extractor(image, return_tensors="pt")
|
21 |
|
|
|
14 |
|
15 |
def process_image(image_path):
|
16 |
image_path = Path(image_path)
|
17 |
+
image_raw = Image.open(image_path)
|
18 |
+
image = image_raw.resize(
|
19 |
+
(1920, int(1920 * image_raw.size[1] / image_raw.size[0])),
|
20 |
+
Image.Resampling.LANCZOS,
|
21 |
+
)
|
22 |
# prepare image for the model
|
23 |
encoding = feature_extractor(image, return_tensors="pt")
|
24 |
|