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] Resolve bug when uploading to projects in CVAT #1926

Merged
merged 1 commit into from Jul 6, 2022

Conversation

ehofesmann
Copy link
Member

When uploading to an existing CVAT project, you can choose not to provide a label schema or label field and instead use the CLI prompt to specify the names of fields into which to load annotations. This PR resolves a bug when attempting to upload to a CVAT project and no label schema is provided.

Traceback (most recent call last):                                                                                                                                                                                                                                                 
  File "/home/eric/work/fiftyone/fiftyone/tests/intensive/cvat_tests.py", line 498, in test_project                                                                                                                                                                                
    results3 = dataset.annotate(                                                                                                                                                                                                                                                   
  File "/home/eric/work/fiftyone/fiftyone/fiftyone/core/collections.py", line 6482, in annotate                                                                                                                                                                                    
    return foua.annotate(                                                                                                                                                                                                                                                          
  File "/home/eric/work/fiftyone/fiftyone/fiftyone/utils/annotations.py", line 211, in annotate                                                                                                                                                                                    
    results = anno_backend.upload_annotations(                                                                                                                                                                                                                                     
  File "/home/eric/work/fiftyone/fiftyone/fiftyone/utils/cvat.py", line 3199, in upload_annotations                                                                                                                                                                                
    results = api.upload_samples(samples, self)                                                                                                                                                                                                                                    
  File "/home/eric/work/fiftyone/fiftyone/fiftyone/utils/cvat.py", line 4154, in upload_samples                                                                                                                                                                                    
    has_ignored_attributes = self._has_ignored_attributes(label_schema)                                                                                                                                                                                                            
  File "/home/eric/work/fiftyone/fiftyone/fiftyone/utils/cvat.py", line 4745, in _has_ignored_attributes                                                                                                                                                                           
    ) = self._to_cvat_attributes(label_info["attributes"])                                                                                                                                                                                                                         
KeyError: 'attributes'    

The project test has been updated to handle this case, it now passes.

@ehofesmann ehofesmann added bug Bug fixes annotation Issues related to FiftyOne's annotation API labels Jul 5, 2022
@ehofesmann ehofesmann requested a review from a team July 5, 2022 22:56
@ehofesmann ehofesmann self-assigned this Jul 5, 2022
Copy link
Contributor

@brimoor brimoor left a comment

Choose a reason for hiding this comment

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

LGTM

@ehofesmann ehofesmann merged commit 8bc5d6e into develop Jul 6, 2022
@ehofesmann ehofesmann deleted the feature/cvat-project-bug branch July 6, 2022 13:00
kaixi-wang pushed a commit that referenced this pull request May 11, 2023
* bson fix

* dataset 404s

* fix selection css and setting

* bumps

* release notes

* bump teams app

* 404 fix

* bump os compat

* Fix custom_parser implementation (get_label should return an instance of the label_cls)

* bump helm charts for 0.1.7 (#79)

* more get_field() fixes

* adding support for serializing aggregations

* adding serialization tests for aggregations

* linting

* adding __eq__ methods

* linting

* more unit testy

* bug fixes

* adding set_values() and exclude_fields() tests

* adding get_field() tests

* adding label ID tests

* reverting to v0.15.1 implementation

* fixing #1893

* id updates

* adding id back to repr

* fixing more ID bugs

* adding rel_dir option

* finishing implementation

* Fix bug when loading group ids in CVAT video tasks (#1917)

* catch tags in app aggregation data flow (#1924)

* adding weighted_sample() and balanced_sample() utils

* moving random_split() to random module

* updating docstrings

* bug

* adding new_ids option to add_collection()

* adding tests for add_collection()

* Resolve bug when uploading to projects in CVAT (#1926)

* proper handling of db fields in mixin methods

* proper handling of db fields in view stages/saving

* fixing clips media type bug

* removing duplicate method definition

* fixing edge case and adding tests

* fixing typo

* view refresh fix

* fix result alignment

* adding quantile aggregation

* adding unit tests for quantile aggregation

* bug fix

* handling string vs numeric

* adding bad values test

* adding quantiles to docs

* implementing kwargs

* relaxing numpy version requirement

* updating nan tests

* supporting serializing and deserializing of arbitrary ObjectId data

* handling SON serialization

* adding stats() method to sample collections

* move all auth0 Teams App configuration to env config

* add targets conversion to graphql datasets (#1943)

* use correct dict default

* fixing bug

* db field is no longer necessary

* fixing one part of #1945

* fixing #1945

* adding object ID tests

* removing default_classes usage

* removing outdated syntax

* adding missing docs

* raising informative error when trying to combine splits

* fixing frames bug

* testing ID fields/db fields

* make ObjectIdField handle str/ObjectId conversions

* validating sample_id field

* documenting stats() method

* tweaking langugage

* more robust implementation

* optimizing convert datasets method

* adding test to cover expected ObjectId behavior

* fixing ObjectId bugs in to_dict()/from_dict()

* unnecessary

* fixing set indexing bug

* unique

* only use patches selection mode for spatial label fields

* fixing bool bugs

* adding bool unit test

* adding numpy bool support

* added field name validation

* finishing implementation of ObjectIdField handling for DatasetViews

* fixing bug

* handling edge case

* proper handling of private fields when serializing collections

* adding dataset serialization tests

* updating unit test

* adding dynamic/BSON field tests

* tweaking todos

* fixing tests

* adding persistent option to clone()

* clarifying that add field methods are idempotent

* production defaults

* be more explicit

* removes helm chart from fiftyone-teams repo(#81)

* helm charts moved to fiftyone-teams-app-deploy repo

* removes deployment/helm from .gitignore

* removes helm chart from fiftyone-teams repo(#81)

* helm charts moved to fiftyone-teams-app-deploy repo

* removes deployment/helm from .gitignore

* adding missing brain call

* fix session views

* gracefully casting to numpy array

* updating documentation

* lifting plotly<5 requirement

* adding missing brain call

* update tabulate to 0.8.10 for source install

* Added clarification to tie attribute argument to label_schema (#1973)

* trying looser requirements

* making tags optional

* fixing bug

* documenting explanation of #1748 in all relevant places

* passing attributes through during label coercions

* linting

* fixing test

* adding field_names, iter_fields(), and merge() to SerializableDocument

* CVAT optimizations (#1944)

* avoid listing tasks at download time

* pass api into results methods

* document api optimization

* lint

* lint pro tip

* add api close context

* refactoring connect_to_api() into an interface concept

* refactoring connect_to_api() into an interface concept

* updating documentation

* cleanup

* moving context manager to AnnotationAPI class

Co-authored-by: brimoor <brimoor@umich.edu>
Co-authored-by: Brian Moore <brian@voxel51.com>

* noting that dataset-level metadata is excluded

* Label studio integration (#1848)

* add label studio integration for classification, detection and polyline

* handle export and import of other label types

* upload predictions to label studio for classification

* upload predictions for all label types

* update labelstudio docstrings and formatting

* store existing labels in id_map

* read api key from env or prompt, small fixes

* add supports attrs property

* add label studio integration for classification, detection and polyline

* handle export and import of other label types

* upload predictions to label studio for classification

* upload predictions for all label types

* update labelstudio docstrings and formatting

* store existing labels in id_map

* read api key from env or prompt, small fixes

* raise error if label studio version is below 1.5,
prompt for a specific label studio sdk version if not installed

* add warning about ignoring attributes

* add labelstudio docs

* fix tests

Co-authored-by: Eric Hofesmann <ehofesmann@gmail.com>

* adding support for writing transformed images to a new location

* adding support for writing transformed videos to a new location

* adding unique filename utils

* updating CLI

* Label studio updates (#2006)

* add label studio integration for classification, detection and polyline

* handle export and import of other label types

* upload predictions to label studio for classification

* upload predictions for all label types

* update labelstudio docstrings and formatting

* store existing labels in id_map

* read api key from env or prompt, small fixes

* add supports attrs property

* add label studio integration for classification, detection and polyline

* handle export and import of other label types

* upload predictions to label studio for classification

* upload predictions for all label types

* update labelstudio docstrings and formatting

* store existing labels in id_map

* read api key from env or prompt, small fixes

* raise error if label studio version is below 1.5,
prompt for a specific label studio sdk version if not installed

* add warning about ignoring attributes

* add labelstudio docs

* fix tests

* update docstrings

* add supports video flag to annotation backend

* update connect_to_api

* parse config parameters for labelstudio tests

* track label ids to merge properly

* support unsubmitted tasks

* note supported scalar types

* currently doesnt support classifications plural

* linting

* fixing typos

* linting docs

* linting

* one more linting pass

* final pass

* fix labelstudio tests

Co-authored-by: rusteam <rustemgal@gmail.com>
Co-authored-by: brimoor <brimoor@umich.edu>

* bumps, release notes

* add to release notes

* linting

* converting to public SaveContext class

* adding missing _save_replacements implementation

* adding public save_context() method

* adding logging configuration

* documenting

* finishing work

* generated views don't support save contexts

* setting default behavior

* compute ops in real-time

* adding ipywidgets<8 requirement

* documenting save contexts

* refactoring into a deferred=True option

* fixing docs warnings

* adding unit tests

* unnecessary

* adding more examples, standardizing default batch_size logic

* adding compatible DB versions

* using client version terminology

* making DatasetDocument dynamic

* optimizing get dataset version

* read path variable from dataset.yaml

* update docs for path in dataset.yaml

* tweaking docs

* tweaks

* avoid deserializing extra fields

* updating unit test

* using strict=False in more places

* more non-strict

* showing available logging levels

* adding normpath

* updating compatibility version

* documenting compatible versions

* fixing LegacyFiftyOneDataset import bug

* removes artifacts I should not have added (#88)

* clarifying

* oops

* updating pkg versions

* removing unnecessary pull

* removes helm chart from fiftyone-teams repo(#81)

* helm charts moved to fiftyone-teams-app-deploy repo

* removes deployment/helm from .gitignore

* removes artifacts I should not have added (#88)

* remove editable flag

* move App build to end

* updating release notes

* always migrate when user is admin

* moving legacy troubleshooting to another page

* adding docs on coordinating migrations

* adding helpful error when a dataset fails to load

* pinning max requirement

* using more cloud-friendly layout

* cloud-friendly updates

* adding upgrade note

* reverting premature version changes

* packages bumps

Co-authored-by: Benjamin Kane <ben@voxel51.com>
Co-authored-by: brimoor <brimoor@umich.edu>
Co-authored-by: Brian Moore <brian@voxel51.com>
Co-authored-by: idow09 <idow09@gmail.com>
Co-authored-by: Eric Hofesmann <ehofesmann@gmail.com>
Co-authored-by: imanjra <ibrahim@voxel51.com>
Co-authored-by: Geoffrey Keating <96071142+geoffrp@users.noreply.github.com>
Co-authored-by: Rustem Galiullin <rustemgal@gmail.com>
Co-authored-by: Victor Oancea <victor.oancea@me.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
annotation Issues related to FiftyOne's annotation API bug Bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants