Spaces:
Running
on
T4
Running
on
T4
Update mono/model/decode_heads/RAFTDepthNormalDPTDecoder5.py
Browse files
mono/model/decode_heads/RAFTDepthNormalDPTDecoder5.py
CHANGED
@@ -216,8 +216,8 @@ def compute_depth_expectation(prob, depth_values):
|
|
216 |
return depth
|
217 |
|
218 |
def interpolate_float32(x, size=None, scale_factor=None, mode='nearest', align_corners=None):
|
219 |
-
with torch.autocast(device_type='cuda', dtype=torch.bfloat16, enabled=False):
|
220 |
-
|
221 |
|
222 |
# def upflow8(flow, mode='bilinear'):
|
223 |
# new_size = (8 * flow.shape[2], 8 * flow.shape[3])
|
@@ -225,8 +225,8 @@ def interpolate_float32(x, size=None, scale_factor=None, mode='nearest', align_c
|
|
225 |
|
226 |
def upflow4(flow, mode='bilinear'):
|
227 |
new_size = (4 * flow.shape[2], 4 * flow.shape[3])
|
228 |
-
with torch.autocast(device_type='cuda', dtype=torch.bfloat16, enabled=False):
|
229 |
-
|
230 |
|
231 |
def coords_grid(batch, ht, wd):
|
232 |
# coords = torch.meshgrid(torch.arange(ht), torch.arange(wd))
|
|
|
216 |
return depth
|
217 |
|
218 |
def interpolate_float32(x, size=None, scale_factor=None, mode='nearest', align_corners=None):
|
219 |
+
#with torch.autocast(device_type='cuda', dtype=torch.bfloat16, enabled=False):
|
220 |
+
return F.interpolate(x.float(), size=size, scale_factor=scale_factor, mode=mode, align_corners=align_corners)
|
221 |
|
222 |
# def upflow8(flow, mode='bilinear'):
|
223 |
# new_size = (8 * flow.shape[2], 8 * flow.shape[3])
|
|
|
225 |
|
226 |
def upflow4(flow, mode='bilinear'):
|
227 |
new_size = (4 * flow.shape[2], 4 * flow.shape[3])
|
228 |
+
#with torch.autocast(device_type='cuda', dtype=torch.bfloat16, enabled=False):
|
229 |
+
return F.interpolate(flow, size=new_size, mode=mode, align_corners=True)
|
230 |
|
231 |
def coords_grid(batch, ht, wd):
|
232 |
# coords = torch.meshgrid(torch.arange(ht), torch.arange(wd))
|