Spaces:
Runtime error
Runtime error
Update depth_app.py
Browse files- depth_app.py +9 -1
depth_app.py
CHANGED
|
@@ -7,12 +7,20 @@ import io
|
|
| 7 |
from torchvision import transforms
|
| 8 |
import matplotlib as mpl
|
| 9 |
import matplotlib.cm as cm
|
| 10 |
-
|
| 11 |
from resnet_encoder import ResnetEncoder
|
| 12 |
from depth_decoder import DepthDecoder
|
| 13 |
# from pose_decoder import PoseDecoder
|
| 14 |
# from pose_cnn import PoseCNN
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
# Function to load the model
|
| 17 |
def load_model(device, model_path):
|
| 18 |
|
|
|
|
| 7 |
from torchvision import transforms
|
| 8 |
import matplotlib as mpl
|
| 9 |
import matplotlib.cm as cm
|
| 10 |
+
|
| 11 |
from resnet_encoder import ResnetEncoder
|
| 12 |
from depth_decoder import DepthDecoder
|
| 13 |
# from pose_decoder import PoseDecoder
|
| 14 |
# from pose_cnn import PoseCNN
|
| 15 |
|
| 16 |
+
# def disp_to_depth_no_scaling(disp):
|
| 17 |
+
# """Convert network's sigmoid output into depth prediction
|
| 18 |
+
# The formula for this conversion is given in the 'additional considerations'
|
| 19 |
+
# section of the paper.
|
| 20 |
+
# """
|
| 21 |
+
# depth = 1 / (disp + 1e-7)
|
| 22 |
+
# return depth
|
| 23 |
+
|
| 24 |
# Function to load the model
|
| 25 |
def load_model(device, model_path):
|
| 26 |
|