Skip to content

Feat: Option to remove wrong AI image tagging. #1168

@codex-yv

Description

@codex-yv

Describe the feature

Description

The AI tagging of the images in PictoPy are sometimes wrong. There should be a feature to remove the wrong AI tagging so that user have an option to remove that tag.

Current Feature

  • Image show AI tags but they don't have option to remove it.

Expected Feature

  • Tags should have option to remove it. This option should be visible when we hover on it.

Implementation

  • Backend :
    • Created a delete route with parameters for tag name and image id.
    • Get class_id from mapping (Database) with the help of tag name.
    • With the help of image_id and class_id we can remove the tagging from image_classes.
  • Frontend :
    • Added the delete endpoint to apiEndpoints.ts and created an asynchronous function using Axios to handle the DELETE request to the backend.
    • Implemented a reducer in imageSlice.ts that filters out the deleted tag from the Redux store, ensuring the UI reflects the change immediately without a page refresh.
    • Linked the tag removal logic to the ImageTags (home gallery) and MediaInfoPanel (image details) components, passing necessary imageId props to trigger deletions.
    • Added an "X" button to each tag that stops click propagation to prevent opening the image and includes a loading state to disable multiple clicks during the deletion process.

Add ScreenShots

Screenshots

  • API working properly.
Image
  • Wrong AI tagging. ( no frisbee in image ) and there is not any option to remove the tagging.

Image

  • Added an option to remove the tags.

Image

  • Tag removed on clicking the "X" icon.

Image

  • Tags with option to remove is also visible in Media Info.

Image

Record

  • I agree to follow this project's Code of Conduct
  • I want to work on this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions