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

Unble to edit Attribute name #5978

Closed
2 tasks done
phjae opened this issue Apr 5, 2023 · 11 comments
Closed
2 tasks done

Unble to edit Attribute name #5978

phjae opened this issue Apr 5, 2023 · 11 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@phjae
Copy link

phjae commented Apr 5, 2023

My actions before raising this issue

Steps to Reproduce (for bugs)

  1. Create Project
  2. Make label that has couple attributes
  3. Annotate
  4. Edit attribute on project page

Expected Behaviour

It should be possible to change attribute name

Current Behaviour

Unable to change attirubte name after i created

Possible Solution

can add new attribute however, it's not possible to delete attribute either

Context

when doing project, customers want to change attribute name on the middle of or at the end of the project.
it's pain to annotate all again just for the change of attribute name

Is there any reason why cvat disabled attribute edit box?

thanks so much for your help!

@phjae phjae changed the title Able to edit Attribute name Unble to edit Attribute name Apr 5, 2023
@zhiltsov-max zhiltsov-max added the enhancement New feature or request label Apr 5, 2023
@zhiltsov-max
Copy link
Contributor

Hi, there is no such option yet. As a workaround, you can export a backup, rename the attribute in the downloaded files, then recreate the project from the backup.

@ritikraj26
Copy link
Contributor

Hello @bsekachev
I would like to take up this issue

@ScriptShah
Copy link

hi , i would like to contribute please assign me .

@ritikraj26
Copy link
Contributor

So currently we don't have the endpoint for deleting an attribute?

@zhiltsov-max
Copy link
Contributor

Hi, I think, currently the attribute changes require all the attributes to be sent in the request. You can find tests here. Skeleton labels can also only be sent as a full list, specific sublabels cannot be changed separately. There are 2 ways to update labels now, one it changing a specific label via /api/labels, and another one is by sending the new list of labels in /api/{projects|tasks}/<id> endpoints. The implementation for these endpoints is located here.

@ritikraj26
Copy link
Contributor

Yes, currently all the attributes are sent in the request. Currently updating an attribute name is creating a new one and not updating the previous one. That might have something to do with the serialization. Thanks for providing the reference.

@ritikraj26
Copy link
Contributor

Currently, the attribute name is being used as the primary key, so when I am trying to send the updated list of attributes with the new names, a new attribute is being created instead of updating.
Possible fix:
1)Adding a primary key field in the AttributeSpec table
2)Sending both the old name and the new name of the attribute in the request

@nmanovic
Copy link
Contributor

@ritikraj26 ,

the attribute name is being used as the primary key

Could you please explain why you think so? Please post a link on the code in the GitHub repo.

@ritikraj26
Copy link
Contributor

@nmanovic ,
Let's say an attribute's name is updated in the front-end and the updated list of attributes is being passed in the request. Now to locate the same attribute in the database we will require the previous name as it is the primary key. However, we will receive the updated name which is not present in the database, and hence a new attribute will be created instead of updating the previous one.
Please find the reference here

@nmanovic
Copy link
Contributor

@ritikraj26 , an attribute's name isn't a primary key. You reference a correct piece of code, but it doesn't support the "updating an attribute" case. It should be fixed. Try to propose the best way to fix the issue. Just prepare a PR and we will review it.

@ritikraj26
Copy link
Contributor

@nmanovic
Raised the PR here

Marishka17 pushed a commit that referenced this issue Apr 11, 2024
This PR fixes two open issues:
- Fixed the [issue](#5978) Unable to edit Attribute name #5978
- Fixed the [issue](#6503) - REST API renaming an attribute does not work #6503

Used attribute id to fetch attribute from the database and renamed it from the list received in the request.

Tested it under multiple scenarios, like different attribute types, input values, and labels.

![image](https://github.com/opencv/cvat/assets/76646497/64bf8a0f-becb-442d-bf27-09e77dddfc86)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

7 participants