[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/extragear/graphics/digikam/libs/database/face
From:       Aditya Jitesh Bhatt <adityabhatt1991 () gmail ! com>
Date:       2010-09-04 17:07:56
Message-ID: 20100904170756.5F354AC887 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1171605 by adityab:

Make the face rejection work properly - unassign the relevant name tag when all there \
are no more instances of the person (usually Unknown), and don't reject all faces in \
an image if only one of them is rejected.

 M  +18 -11    faceiface.cpp  


--- branches/extragear/graphics/digikam/libs/database/face/faceiface.cpp \
#1171604:1171605 @@ -610,6 +610,11 @@
     ImageTagPair pairNamed   ( imageid, nameTagId );
 
     pairUnknown.removeProperty(ImageTagPropertyName::autodetectedFace(), region);
+
+    if(!pairUnknown.hasProperty(ImageTagPropertyName::tagRegion()))
+        {
+        kDebug()<<"No more face properties here";
+        }
     pairNamed.setProperty(ImageTagPropertyName::tagRegion(), region);
 
     markForTraining(imageid);
@@ -617,13 +622,13 @@
 
     MetadataManager::instance()->assignTag(ImageInfo(imageid), nameTagId);
 
-    if(faceCountForPersonInImage(imageid, d->unknownPeopleTagId) == 0)
-    {
-            ImageTagPair pair(imageid, d->unknownPeopleTagId);
-            pair.removeProperties(ImageTagPropertyName::tagRegion());
-            pair.removeProperties("face");
-            MetadataManager::instance()->removeTag(ImageInfo(imageid), \
                d->unknownPeopleTagId);
-    }
+//    if(faceCountForPersonInImage(imageid, d->unknownPeopleTagId) == 0)
+//    {
+//            ImageTagPair pair(imageid, d->unknownPeopleTagId);
+//            pair.removeProperties(ImageTagPropertyName::tagRegion());
+//            pair.removeProperties("face");
+//            MetadataManager::instance()->removeTag(ImageInfo(imageid), \
d->unknownPeopleTagId); +//    }
 
     return nameTagId;
 }
@@ -746,15 +751,17 @@
             kDebug()<<"A Rect in this image is : "<<rectString;
             if (rectString == regionString)
             {
-                pair.clearProperties();
-                if (pair.isAssigned())
-                {
+                pair.removeProperty(ImageTagPropertyName::autodetectedFace(), \
regionString); +
+                ImageTagPair unknownPair(imageid, d->unknownPeopleTagId);
+                if(!unknownPair.hasProperty(ImageTagPropertyName::tagRegion()))
                     MetadataManager::instance()->removeTag(ImageInfo(imageid), \
pair.tagId()); +
                     return pair.tagId();
+
                 }
             }
         }
-    }
     return -1;
 
     /*


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic