adpro commited on
Commit
33dff3c
·
verified ·
1 Parent(s): 9b79d8f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
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
- image = Image.open(image_path)
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