Jonkman Microblog
  • Login
Show Navigation
  • Public

    • Public
    • Network
    • Groups
    • Popular
    • People

Conversation

Notices

  1. Dr. Roy Schestowitz (罗伊) (schestowitz@pleroma.site)'s status on Wednesday, 17-Jun-2020 11:11:47 EDT Dr. Roy Schestowitz (罗伊) Dr. Roy Schestowitz (罗伊)
    Automatic Assignment of Tag Icons in #DigiKam https://kart1kx.wordpress.com/2020/06/17/automatic-assignment-of-tag-icons-in-digikam/ #kde #gnu #linux #freesw
    In conversation Wednesday, 17-Jun-2020 11:11:47 EDT from pleroma.site permalink

    Attachments

    1. File without filename could not get a thumbnail source.
      Automatic Assignment of Tag Icons in DigiKam
      By Kartik Ramesh from Kartik Ramesh

      Last week I implemented Automatic Addition/Removal of Tag Icons. DigiKam provides users with the option to assign Icons to Tags, to allow easy visibility of these tags. For Face Tags in particular, Users may assign a Face associated with that Tag as the Tag Icon. However, in the current implementation, most users don’t make use of the Tag Icon assignment. This is because the process involves 2 steps:

      • Confirm a face to a tag (which may lead to the creation of a new tag)
      • Manually assign the face as the Tag Icon.
      Watch on Imgur for higher resolution: https://imgur.com/a/ME34rht

      This can be annoying for the User if there are a large number of Tags.

      These two processes can be easily automated, so that whenever a new Tag is created (as a consequence of Face Confirmation), then the Face is automatically assigned as the Tag Icon. A similar process can be implemented in the reverse process, that is if the User deletes the last Face associated with the Tag, then the Tag Icon should be deleted.

      Implementation Details

      1. Automatic Assignment of Tag Icons

      People Tags are defined as Tag Albums (TAlbums) in the DigiKam database, as such there already exist methods for assignment of Album Icons (updateTAlbumIcon) provided by the AlbumManager class.

      Confirming and Rejecting faces ultimately happens at the Database level, which led to a problem. Functions of AlbumManager can only be used in files that are compiled with AlbumManager (gui_digikam_obj), and since Database functions are pretty low level, they aren’t compiled with AlbumManager.

      To get around this problem, I included Automatic Icon Assignment in higher-level classes (such as FaceUtils), and made use of QTimers to ensure that the lower level Database functions (sometimes in different threads), were completed before trying to assign a tag.

      Here are my commits regarding the same:

      • Initial implementation for Auto Icon Assignment
      • Implemening QTimer Functionality

      2. Automatic Removal of Tag Icons

      In case the User accidentally confirms a Face, this would lead to automatic assignment of the wrong face to a tag. Hence it’s important to enable Automatic Removal of Tag Icons, as it would allow re-Assignment of a different face to the Tag.

      If the face just deleted (or rejected) was the final face associated with a tag, then the Tag Icon associated should be removed. Here the role of QTimer becomes even more important, as you should check the number of Faces associated with the Tag, only when all the Core Database functionality have been completed.

      Faces can be removed from a Tag in 2 ways.

      • Delete the Face Region (using the ✖)
      • Remove the Face Tag (using the context menu for each Face)

      I patched tag removal for both of these cases in the following commits:

      • Automatic Removal when Face is Deleted (FaceUtils)
      • Automatic Removal using Context Menu (ItemIconView)

      Final Results

      All said and done, here’s how the feature looks!

      Watch on Imgur for higher resolution: https://imgur.com/a/cGNZCPr

      In the video I demonstrate 4 kinds of Automatic Icon functionality:

      • Icon Assignment to a newly created Tag.
      • Icon Assignment to an existing Tag with no Icon.
      • Icon Removal when Face Region is deleted.
      • Icon Removal when Face Tag is deleted.

      Future Improvements

      • Implement batch Auto Assignment. This would be helpful to current Users of DigiKam who might have a large set of Face Tags without Icon.
      • Increase the default size of the rows in People Sidebar, so that Tag Icons are easily recognizable.
      • Standardize the size of Icons. In this implementation, since the Face is assigned as the Tag Icon, the size of the Face (as recognized by the Detection Algorithm) has slight control over the size of the Icon. Rarely this leads to a slightly unequal Tag Icons. This isn’t a huge issue, but can be improved.
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

Jonkman Microblog is a social network, courtesy of SOBAC Microcomputer Services. It runs on GNU social, version 1.2.0-beta5, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All Jonkman Microblog content and data are available under the Creative Commons Attribution 3.0 license.

Switch to desktop site layout.