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

EmbeddedDocument field with a label type (ex: ground_truth of type Detections) should not have other typed fields of type primitives. #3577

Merged
merged 2 commits into from Sep 30, 2023

Conversation

manivoxel51
Copy link
Contributor

What changes are proposed in this pull request?

An embedded document field with a label list type (ex: ground_truth of type Detections) should not have other typed fields (ground_truth.annotator for example) of type primitives.

Note this can be extended to more use cases but a good safeguard for now.

import fiftyone as fo

dataset = fo.load_datase("quickstart")
sample = dataset.first()
sample["ground_truth.annotator"] = "foo"
sample.save()

dataset.add_dynamic_sample_fields()
dataset.save()

// launch app

before fix

Screen Shot 2023-09-26 at 2 38 10 PM

after fix

Screen Shot 2023-09-26 at 2 08 50 PM

How is this patch tested? If it is not, please explain why.

(Details)

Release Notes

Is this a user-facing change that should be mentioned in the release notes?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release
    notes for FiftyOne users.

(Details in 1-2 sentences. You can just refer to another PR with a description
if this PR is part of a larger change.)

What areas of FiftyOne does this PR affect?

  • App: FiftyOne application changes
  • Build: Build and test infrastructure changes
  • Core: Core fiftyone Python library changes
  • Documentation: FiftyOne documentation changes
  • Other

@manivoxel51 manivoxel51 changed the title skip non label fields in a label list field EmbeddedDocument field with a label type (ex: ground_truth of type Detections) should not have other typed fields of type primitives. Sep 26, 2023
@lkaneda
Copy link
Contributor

lkaneda commented Sep 26, 2023

in your screenshot after fix, the field annotator got moved to live at the Detection level. did you change your code to make that happen? or are you showing it nested incorrectly?

@codecov
Copy link

codecov bot commented Sep 26, 2023

Codecov Report

All modified lines are covered by tests ✅

❗ No coverage uploaded for pull request base (release/v0.22.1@2d75b2e). Click here to learn what that means.

Additional details and impacted files
@@                Coverage Diff                 @@
##             release/v0.22.1    #3577   +/-   ##
==================================================
  Coverage                   ?   16.02%           
==================================================
  Files                      ?      594           
  Lines                      ?    72861           
  Branches                   ?      912           
==================================================
  Hits                       ?    11676           
  Misses                     ?    61185           
  Partials                   ?        0           
Flag Coverage Δ
app 16.02% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@manivoxel51
Copy link
Contributor Author

in your screenshot after fix, the field annotator got moved to live at the Detection level. did you change your code to make that happen? or are you showing it nested incorrectly?

good point! the two shouldn't really be compared. I added a nested annotator to detections field (in the second screenshare) which is ok to show I believe. The fix is to remove the annotator as in the first screenshare

@lkaneda
Copy link
Contributor

lkaneda commented Sep 26, 2023

By showing it though, doesn't it imply that it can be visualized like the other fields (and that it would appear in the side bar). This is how I understand it.

@manivoxel51
Copy link
Contributor Author

manivoxel51 commented Sep 26, 2023

By showing it though, doesn't it imply that it can be visualized like the other fields (and that it would appear in the side bar). This is how I understand it.

right! the annotator within ground_truth.detections is showing in the sidebar and in field visibility no? The other annotator is removed.
Screen Shot 2023-09-26 at 4 06 43 PM

@lkaneda
Copy link
Contributor

lkaneda commented Sep 28, 2023

sweet - thanks for clarifying. lgtm!

Copy link
Contributor

@benjaminpkane benjaminpkane left a comment

Choose a reason for hiding this comment

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

I made a tweak to this because I think we only need to include the list field itself. This ensures all fields are excluded, includings list fields, dict fields, etc.

For example

dataset = foz.load_zoo_dataset("quickstart")
first = dataset.first()
first.detections["other_list"] = ["data"]
first.save()

We want other_list to be omitted from schema settings, which should be handled now.

I am seeing an issue with frame fields (see screenshot). The nested detection fields are missing detections.detections in the path. Is there an easy fix for that?
Screenshot 2023-09-28 at 9 04 12 AM

@manivoxel51
Copy link
Contributor Author

I made a tweak to this because I think we only need to include the list field itself. This ensures all fields are excluded, includings list fields, dict fields, etc.

For example

dataset = foz.load_zoo_dataset("quickstart")
first = dataset.first()
first.detections["other_list"] = ["data"]
first.save()

We want other_list to be omitted from schema settings, which should be handled now.

I am seeing an issue with frame fields (see screenshot). The nested detection fields are missing detections.detections in the path. Is there an easy fix for that? Screenshot 2023-09-28 at 9 04 12 AM

thanks for testing Ben! I'll address your comment out later today

Copy link
Contributor

@benjaminpkane benjaminpkane left a comment

Choose a reason for hiding this comment

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

LGTM, last comment is unrelated

@manivoxel51 manivoxel51 merged commit 9690966 into release/v0.22.1 Sep 30, 2023
13 of 15 checks passed
@manivoxel51 manivoxel51 deleted the bug/field-visibility-non-label-attr branch September 30, 2023 19:08
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.

None yet

3 participants