Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tiny] Updated htype docstring for segment mask #1264

Merged
merged 3 commits into from
Oct 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions hub/api/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ def test_htype(memory_ds: Dataset):
video = memory_ds.create_tensor("video", htype="video")
bin_mask = memory_ds.create_tensor("bin_mask", htype="binary_mask")
segment_mask = memory_ds.create_tensor("segment_mask", htype="segment_mask")
keypoint_coco = memory_ds.create_tensor("keypoint_coco", htype="keypoint_coco")
keypoints_coco = memory_ds.create_tensor("keypoints_coco", htype="keypoints_coco")

image.append(np.ones((28, 28, 3), dtype=np.uint8))
bbox.append(np.array([1.0, 1.0, 0.0, 0.5], dtype=np.float32))
Expand All @@ -468,7 +468,7 @@ def test_htype(memory_ds: Dataset):
video.append(np.ones((10, 28, 28, 3), dtype=np.uint8))
bin_mask.append(np.zeros((28, 28), dtype=np.bool8))
segment_mask.append(np.ones((28, 28), dtype=np.uint32))
keypoint_coco.append(np.ones((51, 2), dtype=np.float32))
keypoints_coco.append(np.ones((51, 2), dtype=np.float32))


def test_dtype(memory_ds: Dataset):
Expand Down Expand Up @@ -703,7 +703,7 @@ def test_htypes_list():
"generic",
"image",
"json",
"keypoint_coco",
"keypoints_coco",
"list",
"segment_mask",
"text",
Expand Down
6 changes: 3 additions & 3 deletions hub/htype.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
| bbox | float32 | none |
| video | uint8 | none |
| binary_mask | bool | none |
| segment_mask | int32 | none |
| keypoint_coco | int32 | none |
| segment_mask | uint32 | none |
| keypoints_coco | int32 | none |

"""

Expand Down Expand Up @@ -58,7 +58,7 @@
"dtype": "bool"
}, # TODO: pack numpy arrays to store bools as 1 bit instead of 1 byte
"segment_mask": {"dtype": "uint32"},
"keypoint_coco": {"dtype": "float32"},
"keypoints_coco": {"dtype": "float32"},
"json": {
"dtype": "Any",
},
Expand Down