Skip to content

ITEP-33590 Dataset ie support for keypoint detection #169

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
Domain.ANOMALY_DETECTION,
Domain.ANOMALY_SEGMENTATION,
Domain.ROTATED_DETECTION,
Domain.KEYPOINT_DETECTION,
]


Expand Down Expand Up @@ -142,6 +143,7 @@ def get_validated_task_type(cls, project: Project) -> TaskType:
TaskType.ANOMALY_DETECTION,
TaskType.ANOMALY_SEGMENTATION,
TaskType.ROTATED_DETECTION,
TaskType.KEYPOINT_DETECTION,
]

trainable_tasks = project.get_trainable_task_nodes()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,5 @@ class KeypointDetectionCounterConfig(DatasetCounterConfig):
description="The minimum number of new annotations required "
"before auto-train is triggered. Auto-training will start every time "
"that this number of annotations is created.",
visible_in_ui=False,
visible_in_ui=True,
)
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,9 @@ def get_keypoint_structure(
if not include_all_labels and not any(label in selected_labels for label in joint_names):
continue
structure["edges"].append({"nodes": list(joint_names)})
# structure["positions"].append(???) TODO CVS-156570
for i in range(0, len(cat.positions), 2):
structure["positions"].append(
{"label": cat.labels[i // 2], "x": cat.positions[i], "y": cat.positions[i + 1]}
)

return structure
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class ImportErrorDetail:
Domain.ANOMALY_DETECTION,
Domain.ANOMALY_SEGMENTATION,
Domain.ROTATED_DETECTION,
Domain.KEYPOINT_DETECTION,
]


Expand Down Expand Up @@ -839,6 +840,7 @@ def get_validated_task_type(cls, project: Project) -> TaskType:
TaskType.ANOMALY_DETECTION,
TaskType.ANOMALY_SEGMENTATION,
TaskType.ROTATED_DETECTION,
TaskType.KEYPOINT_DETECTION,
]

trainable_tasks = project.get_trainable_task_nodes()
Expand Down
4 changes: 2 additions & 2 deletions interactive_ai/workflows/geti_domain/common/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ evaluation = [
]

shard-dataset = [
"datumaro==1.8.0",
"datumaro==1.10.0",
]

datumaro-conversion = [
"media-utils",
"datumaro==1.8.0",
"datumaro==1.10.0",
]


Expand Down
50 changes: 32 additions & 18 deletions interactive_ai/workflows/geti_domain/common/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -557,17 +557,6 @@ def parse_project_pipeline(self) -> dict[str, Any]:
FeatureFlagProvider.is_enabled(FeatureFlag.FEATURE_FLAG_KEYPOINT_DETECTION)
and task_type == TaskType.KEYPOINT_DETECTION
):
# need 'keypoint_structure' field in the task
# "keypoint_structure": [
# "edges": [
# {"nodes": [label1, label2]},
# ...,
# ],
# "positions": [
# {"label": label1, "x": 0.5, "y": 0.5},
# ...,
# ]
# ]
task["keypoint_structure"] = self.get_keypoint_structure()

tasks.append(task)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ def get_dataset_info(fxt_dataset_id_str: str) -> DatasetInfo:
"left_ankle", # 16
"right_ankle", # 17
}
keypoint_structure = {
keypoint_structure: dict[str, list] = {
"edges": [
{"nodes": ["left_shoulder", "left_hip"]}, # [6,12]
{"nodes": ["left_ear", "left_shoulder"]}, # [4,6]
Expand All @@ -795,7 +795,25 @@ def get_dataset_info(fxt_dataset_id_str: str) -> DatasetInfo:
{"nodes": ["left_eye", "right_eye"]}, # [2,3]
{"nodes": ["left_ankle", "left_knee"]}, # [16,14]
],
"positions": [], # TODO CVS-156570
"positions": [
{"label": "nose", "x": 0.1, "y": 0.4},
{"label": "left_eye", "x": 0.2, "y": 0.5},
{"label": "right_eye", "x": 0.3, "y": 0.6},
{"label": "left_ear", "x": 0.4, "y": 0.7},
{"label": "right_ear", "x": 0.5, "y": 0.8},
{"label": "left_shoulder", "x": 0.6, "y": 0.9},
{"label": "right_shoulder", "x": 0.7, "y": 1.0},
{"label": "left_elbow", "x": 0.8, "y": 0.9},
{"label": "right_elbow", "x": 0.9, "y": 0.8},
{"label": "left_wrist", "x": 1.0, "y": 0.7},
{"label": "right_wrist", "x": 0.9, "y": 0.6},
{"label": "left_hip", "x": 0.8, "y": 0.5},
{"label": "right_hip", "x": 0.7, "y": 0.4},
{"label": "left_knee", "x": 0.6, "y": 0.3},
{"label": "right_knee", "x": 0.5, "y": 0.2},
{"label": "left_ankle", "x": 0.4, "y": 0.1},
{"label": "right_ankle", "x": 0.3, "y": 0.0},
],
}
return DatasetInfo(
exported_project_type=GetiProjectType.KEYPOINT_DETECTION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,25 @@ def test_parse_dataset_for_import_to_new_project__datumaro_format__keypoint_dete
{"nodes": ["left_eye", "right_eye"]}, # [2,3]
{"nodes": ["left_ankle", "left_knee"]}, # [16,14]
],
"positions": [], # TODO CVS-156570
"positions": [
{"label": "nose", "x": 0.1, "y": 0.4},
{"label": "left_eye", "x": 0.2, "y": 0.5},
{"label": "right_eye", "x": 0.3, "y": 0.6},
{"label": "left_ear", "x": 0.4, "y": 0.7},
{"label": "right_ear", "x": 0.5, "y": 0.8},
{"label": "left_shoulder", "x": 0.6, "y": 0.9},
{"label": "right_shoulder", "x": 0.7, "y": 1.0},
{"label": "left_elbow", "x": 0.8, "y": 0.9},
{"label": "right_elbow", "x": 0.9, "y": 0.8},
{"label": "left_wrist", "x": 1.0, "y": 0.7},
{"label": "right_wrist", "x": 0.9, "y": 0.6},
{"label": "left_hip", "x": 0.8, "y": 0.5},
{"label": "right_hip", "x": 0.7, "y": 0.4},
{"label": "left_knee", "x": 0.6, "y": 0.3},
{"label": "right_knee", "x": 0.5, "y": 0.2},
{"label": "left_ankle", "x": 0.4, "y": 0.1},
{"label": "right_ankle", "x": 0.3, "y": 0.0},
],
}
if fxt_keypoint_detection:
dataset_info = DatasetInfo(
Expand Down
Loading
Loading