Skip to content

Commit

Permalink
fixing deprecated numpy type names
Browse files Browse the repository at this point in the history
  • Loading branch information
CCareaga committed Apr 29, 2024
1 parent 2ea7651 commit 2e5c57b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions intrinsic_compositing/albedo/model/MiDaS/midas/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def apply_min_size(sample, size, image_interpolation_method=cv2.INTER_AREA):
sample["disparity"], tuple(shape[::-1]), interpolation=cv2.INTER_NEAREST
)
sample["mask"] = cv2.resize(
sample["mask"].astype(np.float32),
sample["mask"].astype(np.single),
tuple(shape[::-1]),
interpolation=cv2.INTER_NEAREST,
)
Expand Down Expand Up @@ -185,7 +185,7 @@ def __call__(self, sample):
)

sample["mask"] = cv2.resize(
sample["mask"].astype(np.float32),
sample["mask"].astype(np.single),
(width, height),
interpolation=cv2.INTER_NEAREST,
)
Expand Down Expand Up @@ -217,18 +217,18 @@ def __init__(self):

def __call__(self, sample):
image = np.transpose(sample["image"], (2, 0, 1))
sample["image"] = np.ascontiguousarray(image).astype(np.float32)
sample["image"] = np.ascontiguousarray(image).astype(np.single)

if "mask" in sample:
sample["mask"] = sample["mask"].astype(np.float32)
sample["mask"] = sample["mask"].astype(np.single)
sample["mask"] = np.ascontiguousarray(sample["mask"])

if "disparity" in sample:
disparity = sample["disparity"].astype(np.float32)
disparity = sample["disparity"].astype(np.single)
sample["disparity"] = np.ascontiguousarray(disparity)

if "depth" in sample:
depth = sample["depth"].astype(np.float32)
depth = sample["depth"].astype(np.single)
sample["depth"] = np.ascontiguousarray(depth)

return sample
2 changes: 1 addition & 1 deletion intrinsic_compositing/shading/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def compute_reshading(orig, msk, inv_shd, depth, normals, alb, coeffs, model):
inv_shd = resize(inv_shd, (round_32(h), round_32(w)))
dpt = resize(depth, (round_32(h), round_32(w)))
nrm = resize(normals, (round_32(h), round_32(w)))
msk = msk.astype(np.float32)
msk = msk.astype(np.single)

hard_msk = (msk > 0.5)

Expand Down

0 comments on commit 2e5c57b

Please sign in to comment.