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

[BUG] FilterKeypoints does not work for embedded fields #3277

Closed
benjaminpkane opened this issue Jul 10, 2023 · 1 comment
Closed

[BUG] FilterKeypoints does not work for embedded fields #3277

benjaminpkane opened this issue Jul 10, 2023 · 1 comment
Labels
bug Bug fixes core Issues related to Core features

Comments

@benjaminpkane
Copy link
Contributor

import fiftyone as fo

F = fo.ViewField

dataset = fo.Dataset("filter-keypoints")
dataset.default_skeleton = fo.KeypointSkeleton(
    labels=["top-left", "center", "bottom-right"], edges=[[0, 1, 2]]
)
sample = fo.Sample(
    filepath="image.png",
    keypoint=fo.Keypoint(
        label="keypoint",
        points=[[0, 0], [0.5, 0.5], [1, 1]],
        confidence=[0, 0.5, 1],
        dynamic=["one", "two", "three"],
        tags=["keypoint"],
    ),
    keypoints=fo.Keypoints(
        keypoints=[
            fo.Keypoint(
                label="keypoint",
                points=[[0, 0], [0.5, 0.5], [1, 1]],
                confidence=[0, 0.5, 1],
                dynamic=["one", "two", "three"],
                tags=["keypoints"],
            )
        ]
    ),
    dynamic=fo.DynamicEmbeddedDocument(
        keypoint=fo.Keypoint(
            label="keypoint",
            points=[[0, 0], [0.5, 0.5], [1, 1]],
            confidence=[0, 0.5, 1],
            dynamic=["one", "two", "three"],
            tags=["dynamic.keypoint"],
        ),
        keypoints=[
            fo.Keypoint(
                label="keypoint",
                points=[[0, 0], [0.5, 0.5], [1, 1]],
                confidence=[0, 0.5, 1],
                dynamic=["one", "two", "three"],
                tags=["dynamic.keypoints"],
            )
        ],
    ),
)
dataset.add_sample(sample)
dataset.add_dynamic_sample_fields()

view = dataset
for field in [
    "keypoint",
    "keypoints",
    "dynamic.keypoint",
    "dynamic.keypoints",
]:
    view = view.filter_keypoints(field, labels="top-left")

fo.pprint(view.first())

Out

<SampleView: {
    'id': '64ac98d55ff139d8210151c1',
    'media_type': 'image',
    'filepath': '/Users/benjaminkane/code/scratch/image.png',
    'tags': [],
    'metadata': None,
    'keypoint': <Keypoint: {
        'id': '64ac98d55ff139d8210151bd',
        'attributes': {},
        'tags': ['keypoint'],
        'label': 'keypoint',
        'points': [[0, 0], [nan, nan], [nan, nan]],
        'confidence': [0.0, 0.5, 1.0],
        'index': None,
        'dynamic': ['one', 'two', 'three'],
    }>,
    'keypoints': <Keypoints: {
        'keypoints': [
            <Keypoint: {
                'id': '64ac98d55ff139d8210151be',
                'attributes': {},
                'tags': ['keypoints'],
                'label': 'keypoint',
                'points': [[0, 0], [nan, nan], [nan, nan]],
                'confidence': [0.0, 0.5, 1.0],
                'index': None,
                'dynamic': ['one', 'two', 'three'],
            }>,
        ],
    }>,
    'dynamic': <DynamicEmbeddedDocument: {
        'keypoint': <Keypoint: {
            'id': '64ac98d55ff139d8210151bf',
            'attributes': {},
            'tags': ['dynamic.keypoint'],
            'label': 'keypoint',
            'points': [[0, 0], [0.5, 0.5], [1, 1]],
            'confidence': [0.0, 0.5, 1.0],
            'index': None,
            'dynamic': ['one', 'two', 'three'],
            'keypoint': None,
        }>,
        'keypoints': [
            <Keypoint: {
                'id': '64ac98d55ff139d8210151c0',
                'attributes': {},
                'tags': ['dynamic.keypoints'],
                'label': 'keypoint',
                'points': [[0, 0], [0.5, 0.5], [1, 1]],
                'confidence': [0.0, 0.5, 1.0],
                'index': None,
                'dynamic': ['one', 'two', 'three'],
                'keypoints': [[]],
            }>,
        ],
    }>,
}>
@benjaminpkane benjaminpkane added bug Bug fixes core Issues related to Core features labels Jul 10, 2023
@brimoor
Copy link
Contributor

brimoor commented Jul 11, 2023

@benjaminpkane I will patch this

@brimoor brimoor closed this as completed Jul 11, 2023
@brimoor brimoor reopened this Jul 11, 2023
@brimoor brimoor mentioned this issue Jul 11, 2023
benjaminpkane pushed a commit that referenced this issue Jul 11, 2023
* fixing filter_keypoints() bug

* adding dynamic doc test
benjaminpkane added a commit that referenced this issue Jul 12, 2023
* Refactor schemaControls, use selectField() when searching, cleaner schema documentation

selection mode is default now for filed visibility

* update count dependency to refelct when applying filter rules

* add documentation links

* better disable field handling - (un)select is broken - fixing next

* improve select all control

* uncheck subpaths even if they are disabled

* show embedded document in selection mode

* field doc type using tertiary text color

* minor tweaks in color modal title style

* review comments and fix include nested fields selection view

* review comments, refactor selection row, and count fix

* add first vitest for visibility, upgrade vitest packages

* add basic test and refactor more

* keep one embed doc field

* no coverage when yarn test

* add support for multi-select with string type

* adds a Docker Hub Pulls badge

* Typo

* tweaking

* lint

* Add files via upload

* Update brain.rst

* Update index.rst

* Update index.rst

* Update index.rst

* Update index.rst

* Release v0.21.2 (#3251) (#3255)

* update sidebar test, fix small regressions (#3250)

* remove next index ref, fix string filter is matching default (#3249)

* release notes

* package bumps

* disabled e2e

* lint

* fix mac arm64

* Teams v1.3.2 release note

* rm e2e

* add main

* add icon

* typo

* first pass at milvus integration docs

* adding milvus to user_guide/brain

* adding to integrations index

* adding milvus logo

* square image, lower resolution

* editing pass

* consistency

* bugfixes

* disable field unit testing

* group and video dataset unit tests disabled

* toPatches disabling tests

* toClips

* label types test

* more granular field selection when disabling label subfields

* geolocation, heatmap, segmentation tests

* complete disabling test

* review comments

* enable vector fields, disable top level id field, more grnular disabling of FrameSupportField and FrameNumberField

* disable list of valid labels from visibility toggle

* review comments

* linting

* editing pass

* tweaks

* cleanup

* fixing capitalization

* adding new vector integrations

* bumping package versions

* adding release notes

* or count label tags (#3267)

* has group slices only when group dataset (#3262)

* Updating `Session.close()` (#3253)

* kill server on session close

* close desktop app

* cleanup

* lint

* lint

* is_open

* rm remote warning

* Embedded frame label fixes (#3256)

* add frame cases to dynamic label tests

* embedded frame label fixes

* linting

* adding a merge_sample() method

* Minor typo fixes

* adding test for one() method

* updating release notes

* tweak

* documenting list bucket perms

* Fix sidebar matching on label fields (#3270)

* only matches

* db_field bug and path fix

* Suppress errors due to none fields (#3275)

* don't throw error

* add debug msg

* import order

* Fixing #3277 (#3279)

* fixing filter_keypoints() bug

* adding dynamic doc test

* interactive typo fix for Dave

* removing persistent dataset usage in unit tests

* Sidebar filtering tests and fixes (#3280)

* only matches

* db_field bug and path fix

* base image sample tests

* cleanup

* exclude bug

* rm onlyMatch

* frame and dynamic tests

* adding coverage

* keypoints fixes

* cleanup

* base image sample tests

* cleanup

* exclude bug

* rm onlyMatch

* frame and dynamic tests

* adding coverage

* keypoints fixes

* cleanup

* tweaks

* exclude no only matches

* add to release notes

* whitespace

* updating release notes

* Minor fixes (#3283)

* docs tweaks

* documenting cache=True feature

---------

Co-authored-by: manivoxel51 <mani@voxel51@gmail.com>
Co-authored-by: Lanny W <lanzhenwang9@gmail.com>
Co-authored-by: manivoxel51 <109545780+manivoxel51@users.noreply.github.com>
Co-authored-by: Brian Moore <brian@voxel51.com>
Co-authored-by: imanjra <ibrahim@voxel51.com>
Co-authored-by: topher <topher@voxel51.com>
Co-authored-by: Jacob Marks <jamarks13@gmail.com>
Co-authored-by: brimoor <brimoor@umich.edu>
Co-authored-by: Ayush Chaurasia <ayush.chaurarsia@gmail.com>
Co-authored-by: Kishan Savant <ksavant577@gmail.com>
Co-authored-by: Kacey <kacey@voxel51.com>
Co-authored-by: Kishan Savant <66986430+NeoKish@users.noreply.github.com>
benjaminpkane added a commit that referenced this issue Jul 12, 2023
* Release v0.21.2 (#3251)

* update sidebar test, fix small regressions (#3250)

* remove next index ref, fix string filter is matching default (#3249)

* release notes

* package bumps

* disabled e2e

* lint

* fix mac arm64

* Teams v1.3.2 release note

* rm e2e

* add main

* adding new vector integrations

* bumping package versions

* adding release notes

* or count label tags (#3267)

* has group slices only when group dataset (#3262)

* Updating `Session.close()` (#3253)

* kill server on session close

* close desktop app

* cleanup

* lint

* lint

* is_open

* rm remote warning

* Embedded frame label fixes (#3256)

* add frame cases to dynamic label tests

* embedded frame label fixes

* linting

* adding a merge_sample() method

* Minor typo fixes

* adding test for one() method

* updating release notes

* tweak

* documenting list bucket perms

* Fix sidebar matching on label fields (#3270)

* only matches

* db_field bug and path fix

* Suppress errors due to none fields (#3275)

* don't throw error

* add debug msg

* import order

* Fixing #3277 (#3279)

* fixing filter_keypoints() bug

* adding dynamic doc test

* interactive typo fix for Dave

* removing persistent dataset usage in unit tests

* Sidebar filtering tests and fixes (#3280)

* only matches

* db_field bug and path fix

* base image sample tests

* cleanup

* exclude bug

* rm onlyMatch

* frame and dynamic tests

* adding coverage

* keypoints fixes

* cleanup

* base image sample tests

* cleanup

* exclude bug

* rm onlyMatch

* frame and dynamic tests

* adding coverage

* keypoints fixes

* cleanup

* tweaks

* exclude no only matches

* add to release notes

* whitespace

* updating release notes

* Minor fixes (#3283)

* docs tweaks

* documenting cache=True feature

* Release/v0.21.3 (#3282)

* Refactor schemaControls, use selectField() when searching, cleaner schema documentation

selection mode is default now for filed visibility

* update count dependency to refelct when applying filter rules

* add documentation links

* better disable field handling - (un)select is broken - fixing next

* improve select all control

* uncheck subpaths even if they are disabled

* show embedded document in selection mode

* field doc type using tertiary text color

* minor tweaks in color modal title style

* review comments and fix include nested fields selection view

* review comments, refactor selection row, and count fix

* add first vitest for visibility, upgrade vitest packages

* add basic test and refactor more

* keep one embed doc field

* no coverage when yarn test

* add support for multi-select with string type

* adds a Docker Hub Pulls badge

* Typo

* tweaking

* lint

* Add files via upload

* Update brain.rst

* Update index.rst

* Update index.rst

* Update index.rst

* Update index.rst

* Release v0.21.2 (#3251) (#3255)

* update sidebar test, fix small regressions (#3250)

* remove next index ref, fix string filter is matching default (#3249)

* release notes

* package bumps

* disabled e2e

* lint

* fix mac arm64

* Teams v1.3.2 release note

* rm e2e

* add main

* add icon

* typo

* first pass at milvus integration docs

* adding milvus to user_guide/brain

* adding to integrations index

* adding milvus logo

* square image, lower resolution

* editing pass

* consistency

* bugfixes

* disable field unit testing

* group and video dataset unit tests disabled

* toPatches disabling tests

* toClips

* label types test

* more granular field selection when disabling label subfields

* geolocation, heatmap, segmentation tests

* complete disabling test

* review comments

* enable vector fields, disable top level id field, more grnular disabling of FrameSupportField and FrameNumberField

* disable list of valid labels from visibility toggle

* review comments

* linting

* editing pass

* tweaks

* cleanup

* fixing capitalization

* adding new vector integrations

* bumping package versions

* adding release notes

* or count label tags (#3267)

* has group slices only when group dataset (#3262)

* Updating `Session.close()` (#3253)

* kill server on session close

* close desktop app

* cleanup

* lint

* lint

* is_open

* rm remote warning

* Embedded frame label fixes (#3256)

* add frame cases to dynamic label tests

* embedded frame label fixes

* linting

* adding a merge_sample() method

* Minor typo fixes

* adding test for one() method

* updating release notes

* tweak

* documenting list bucket perms

* Fix sidebar matching on label fields (#3270)

* only matches

* db_field bug and path fix

* Suppress errors due to none fields (#3275)

* don't throw error

* add debug msg

* import order

* Fixing #3277 (#3279)

* fixing filter_keypoints() bug

* adding dynamic doc test

* interactive typo fix for Dave

* removing persistent dataset usage in unit tests

* Sidebar filtering tests and fixes (#3280)

* only matches

* db_field bug and path fix

* base image sample tests

* cleanup

* exclude bug

* rm onlyMatch

* frame and dynamic tests

* adding coverage

* keypoints fixes

* cleanup

* base image sample tests

* cleanup

* exclude bug

* rm onlyMatch

* frame and dynamic tests

* adding coverage

* keypoints fixes

* cleanup

* tweaks

* exclude no only matches

* add to release notes

* whitespace

* updating release notes

* Minor fixes (#3283)

* docs tweaks

* documenting cache=True feature

---------

Co-authored-by: manivoxel51 <mani@voxel51@gmail.com>
Co-authored-by: Lanny W <lanzhenwang9@gmail.com>
Co-authored-by: manivoxel51 <109545780+manivoxel51@users.noreply.github.com>
Co-authored-by: Brian Moore <brian@voxel51.com>
Co-authored-by: imanjra <ibrahim@voxel51.com>
Co-authored-by: topher <topher@voxel51.com>
Co-authored-by: Jacob Marks <jamarks13@gmail.com>
Co-authored-by: brimoor <brimoor@umich.edu>
Co-authored-by: Ayush Chaurasia <ayush.chaurarsia@gmail.com>
Co-authored-by: Kishan Savant <ksavant577@gmail.com>
Co-authored-by: Kacey <kacey@voxel51.com>
Co-authored-by: Kishan Savant <66986430+NeoKish@users.noreply.github.com>

* Updating logo wall links (#3288)

* updating logo wall links

* better links

---------

Co-authored-by: brimoor <brimoor@umich.edu>
Co-authored-by: Kishan Savant <ksavant577@gmail.com>
Co-authored-by: Brian Moore <brian@voxel51.com>
Co-authored-by: Kacey <kacey@voxel51.com>
Co-authored-by: topher <topher@voxel51.com>
Co-authored-by: Kishan Savant <66986430+NeoKish@users.noreply.github.com>
Co-authored-by: manivoxel51 <mani@voxel51@gmail.com>
Co-authored-by: Lanny W <lanzhenwang9@gmail.com>
Co-authored-by: manivoxel51 <109545780+manivoxel51@users.noreply.github.com>
Co-authored-by: imanjra <ibrahim@voxel51.com>
Co-authored-by: Jacob Marks <jamarks13@gmail.com>
Co-authored-by: Ayush Chaurasia <ayush.chaurarsia@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug fixes core Issues related to Core features
Projects
None yet
Development

No branches or pull requests

2 participants