codic commited on
Commit
545379f
·
verified ·
1 Parent(s): 01c376a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -1,20 +1,20 @@
1
  import base64
2
  from gradio_client import Client
3
- from transformers import DPTFeatureExtractor, DPTForDepthEstimation
4
  import torch
5
  import numpy as np
6
  from PIL import Image
7
  import open3d as o3d
8
  from pathlib import Path
9
  import os
10
- import gradio as gr # Add this import
11
 
12
  # Initialize Gradio client for background removal
13
  client = Client("not-lain/background-removal")
14
 
15
- # Initialize DPT depth estimation model
16
- feature_extractor = DPTFeatureExtractor.from_pretrained("Intel/dpt-large")
17
- model = DPTForDepthEstimation.from_pretrained("Intel/dpt-large")
18
 
19
  def process_image(image_path, depth_map_path=None):
20
  image_path = Path(image_path)
 
1
  import base64
2
  from gradio_client import Client
3
+ from transformers import DPTImageProcessor, DPTForDepthEstimation
4
  import torch
5
  import numpy as np
6
  from PIL import Image
7
  import open3d as o3d
8
  from pathlib import Path
9
  import os
10
+ import gradio as gr
11
 
12
  # Initialize Gradio client for background removal
13
  client = Client("not-lain/background-removal")
14
 
15
+ # Initialize DPT depth estimation model (using the new ImageProcessor)
16
+ feature_extractor = DPTImageProcessor.from_pretrained("Intel/dpt-large")
17
+ model = DPTForDepthEstation.from_pretrained("Intel/dpt-large")
18
 
19
  def process_image(image_path, depth_map_path=None):
20
  image_path = Path(image_path)