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

ED-436 - adding Skeletoncoordinates parser #822

Merged
merged 6 commits into from
Jan 9, 2025

Conversation

anurag-encord
Copy link
Contributor

Adding SkeletonCoordinates object parser to work with the INVISIBLE/ OCCLUDED in SkeletonCoordinate.

Copy link

github-actions bot commented Dec 12, 2024

SDK integration test report

284 tests  ±0   277 ✅ ±0   20m 19s ⏱️ -17s
  1 suites ±0     7 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 008e6b4. ± Comparison against base commit 8d44e08.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@Jim-Encord Jim-Encord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly surprised that the shape changed quite a lot and interested in dataclass Vs BaseDTO

encord/objects/coordinates.py Outdated Show resolved Hide resolved
else:
raise LabelRowError(f"Invalid format for skeleton coordinates: {skeleton_dict}")
for value in sorted_dict_values:
if value.get("invisible") and value["invisible"]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking the condition multiple times?
Likewise with the other checks.

Should be sufficient. Just to do value.get('invisible')

encord/objects/coordinates.py Show resolved Hide resolved
@arthur-encord arthur-encord force-pushed the av/create_skeletoncoordinates_instance branch from 72d989a to 740b5f1 Compare January 2, 2025 17:05
Copy link

github-actions bot commented Jan 2, 2025

Unit test report (Pydantic 1.x)

195 tests   195 ✅  5s ⏱️
  1 suites    0 💤
  1 files      0 ❌

Results for commit 008e6b4.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jan 2, 2025

Unit test report ((Pydantic 2.x)

195 tests   195 ✅  6s ⏱️
  1 suites    0 💤
  1 files      0 ❌

Results for commit 008e6b4.

♻️ This comment has been updated with latest results.

@arthur-encord arthur-encord force-pushed the av/create_skeletoncoordinates_instance branch 2 times, most recently from 1143905 to 5607bee Compare January 2, 2025 18:01
@@ -298,7 +284,9 @@ class SkeletonCoordinate(BaseDTO):
color (Optional[str]): The color associated with the skeleton point.
feature_hash (Optional[str]): A unique hash for the feature.
value (Optional[str]): An optional value associated with the skeleton point.
visibility (Optional[Visibility]): The visibility state of the skeleton point.
visible (Optional[bool]): `True` if the skeleton point is visible within the frame (default).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is transitioning from basically directly de-serializing the underlying JSON to a Python object and not trying to have it as an Enum which somewhat represents the domain better.
There's arguments for both: This version: Matches underlying data better. Prev version: Tries to hide some complexity from the consumer.
I think this version is fine just acknowledging.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh interesting. So we're throwing away the 3-state visible/occluded/invisible in favor of visible true/false? (looking at the green vs red in the above diff)

Does sort of seem like we want to just pass the enum through yeah? Otherwise no point in having the 3 different states in the editor?

There's value in having visibility = full mean normally on screen, occluded mean in frame but partially or fully blocked by something else (user's choice). and visibility = none can mean fully blocked or off screen (user's choice -- as long as their consistent).

If I'm missing context here, do correct but otherwise prefer we represent the 3-states absent a strong argument to not do so. nice flag jim.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This particular line that I've responded too doesn't give full context as to what the change is.

But basically it's:
visibility: Enum vs: (visible: bool, occluded: bool, invisible: bool)

where the underlying JSON has: the latter but it may be better encapsulated as the former.
I wouldn't worry too much Justin.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a string enum is definitely preferable to 3 fields. However we're technically not "throwing away" the enum since it is here but (as far as I can see) was always None. At the moment we have:

  • label row export, JSON -> 3 fields (visible/occluded/invisible)
  • label row export, COCO -> "enum" 0/1/2
  • SDK export -> didn't work; deciding in this PR

Given that it's already not consistent, maybe we can lean towards the enum here

@arthur-encord arthur-encord force-pushed the av/create_skeletoncoordinates_instance branch from 73702b5 to 008e6b4 Compare January 9, 2025 12:13
@arthur-encord arthur-encord merged commit 6b9cbba into master Jan 9, 2025
7 checks passed
@arthur-encord arthur-encord deleted the av/create_skeletoncoordinates_instance branch January 9, 2025 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants