Skip to content

Commit

Permalink
np.float -> float
Browse files Browse the repository at this point in the history
  • Loading branch information
MedericFourmy committed Feb 14, 2024
1 parent c3b2c71 commit 242a1ce
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def make_empty_predictions():
"view_id": np.empty(0, dtype=int),
"scene_id": np.empty(0, dtype=int),
"label": np.empty(0, dtype=np.object),
"score": np.empty(0, dtype=np.float),
"score": np.empty(0, dtype=float),
}
bboxes = torch.empty(0, 4, dtype=torch.float)
return tc.PandasTensorCollection(infos=pd.DataFrame(infos), bboxes=bboxes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def make_empty_predictions():
"view_id": np.empty(0, dtype=int),
"scene_id": np.empty(0, dtype=int),
"label": np.empty(0, dtype=np.object),
"score": np.empty(0, dtype=np.float),
"score": np.empty(0, dtype=float),
}
poses = torch.empty(0, 4, 4, dtype=torch.float)
return tc.PandasTensorCollection(infos=pd.DataFrame(infos), poses=poses)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def compute_ap(label_df, label_n_gt):
label_df = label_df.sort_values("score", ascending=False).reset_index(
drop=True,
)
label_df["n_tp"] = np.cumsum(label_df[valid_k].values.astype(np.float))
label_df["n_tp"] = np.cumsum(label_df[valid_k].values.astype(float))
label_df["prec"] = label_df["n_tp"] / (np.arange(len(label_df)) + 1)
label_df["recall"] = label_df["n_tp"] / label_n_gt
y_true = label_df[valid_k]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def compute_ap(label_df, label_n_gt):
label_df = label_df.sort_values("score", ascending=False).reset_index(
drop=True,
)
label_df["n_tp"] = np.cumsum(label_df[valid_k].values.astype(np.float))
label_df["n_tp"] = np.cumsum(label_df[valid_k].values.astype(float))
label_df["prec"] = label_df["n_tp"] / (np.arange(len(label_df)) + 1)
label_df["recall"] = label_df["n_tp"] / label_n_gt
y_true = label_df[valid_k]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def get_normal(
mask[depth_refine == 0] = 1
depth_refine = depth_refine.astype(np.float32)
depth_refine = cv2.inpaint(depth_refine, mask, 2, cv2.INPAINT_NS)
depth_refine = depth_refine.astype(np.float)
depth_refine = depth_refine.astype(float)
depth_refine = ndimage.gaussian_filter(depth_refine, 2)

uv_table = np.zeros((res_y, res_x, 2), dtype=np.int16)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def objects_pos_orn_rand_falling(self):

def sample_camera(self):
assert self.focal_interval.shape == (2, 2)
K = np.zeros((3, 3), dtype=np.float)
K = np.zeros((3, 3), dtype=float)
fxfy = self.np_random.uniform(*self.focal_interval)
W, H = max(self.resolution), min(self.resolution)
K[0, 0] = fxfy[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ def mark_inliers(cand_inputs, cand_matched):
on=["scene_id", "view_id", "label", "cand_id"],
how="left",
)
infos["is_inlier"] = infos["is_inlier"].astype(np.float)
infos.loc[~np.isfinite(infos.loc[:, "is_inlier"].astype(np.float)), "is_inlier"] = 0
infos["is_inlier"] = infos["is_inlier"].astype(float)
infos.loc[~np.isfinite(infos.loc[:, "is_inlier"].astype(float)), "is_inlier"] = 0
infos["is_inlier"] = infos["is_inlier"].astype(np.bool)
cand_inputs.infos = infos
return cand_inputs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def make_empty_predictions():
"view_id": np.empty(0, dtype=int),
"scene_id": np.empty(0, dtype=int),
"label": np.empty(0, dtype=np.object),
"score": np.empty(0, dtype=np.float),
"score": np.empty(0, dtype=float),
}
poses = torch.empty(0, 4, 4, dtype=torch.float)
return tc.PandasTensorCollection(infos=pd.DataFrame(infos), poses=poses)
Expand Down
4 changes: 2 additions & 2 deletions happypose/pose_estimators/megapose/inference/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ def from_numpy(
Args:
----
rgb: [H,W,3] np.uint8
depth: [H,W] np.float
K: [3,3] np.float
depth: [H,W] float
K: [3,3] float
"""
assert rgb.dtype == np.uint8
Expand Down
4 changes: 2 additions & 2 deletions happypose/toolbox/inference/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ def from_numpy(
Args:
----
rgb: [H,W,3] np.uint8
depth: [H,W] np.float
K: [3,3] np.float
depth: [H,W] float
K: [3,3] float
"""
assert rgb.dtype == np.uint8
Expand Down

0 comments on commit 242a1ce

Please sign in to comment.