Face Recognition in the File Window seems to skip every n Files

Started by Tveloso, October 10, 2022, 04:21:24 AM

Previous topic - Next topic

Tveloso

I have seen other topics here describing a perceived "reduced face detection accuracy" in the File Window, vs. the Viewer, and I have noted the same occasionally as well.  That is, while working on files in the Viewer, I found that pressing F6 for a file that had no Annotations, resulted in correct face annotations being added, when they had not been added by the Face Reignition operation in the File Window (Ctrl+M,F).

Recently, when running Face Recognition on a Folder containing about 350 Files, I noticed that after all files were processed, only every 5th file had Face Annotations.  My File Window Layout was such that it contained 5 files per row, so the files that were given Face Annotations all wound up in a single column:

   

The earlier files in the File Window (the first 40 or 50 Files) were all part of groups of shots taken in quick succession (several shots per second), so the pixel data for the file that had Face Annotations was essentially "exactly" the same as that for the files immediately before and after it (which did not get Annotations added), so it seemed that files really were being skipped somehow.

In those early files, it was actually column-2 where the faces had been added (so the files at index 2, 7, 12, et.).  But then that pattern broke, further down (with just a few - 2 or 3 - contiguous files having annotations, before then the "every 5" pattern resuming in a new column - now column-1, as shown in the above ScreenShot).

I wondered if perhaps:

  • This was some type of index increment problem
    Could it be that some index value was inadvertantly beincremented by 5 instead of 1?  Couldn't be (especially since the pattern didn't hold true throughout all files)...if there was an issue in this area, the next (also unlikely) item might be more likely.

  • The "timing" of some Event(s) interfered, causing 4 out of 5 files to fail
    Could there have been some other processes in my PC causing only 1 in 5 files to succeed most of the time?...making it seem like only every 5th file was processed, when in fact something was interfering with the Face Recognition operation throughout its duration?...(and the timing happened to cooincide with "every n files" most of the time)?...

I set out to work with the files in the Viewer, but as I kept encountering files for which an F6 gave the correct Annotations, I thought that something had to have gone wrong during the original (Ctrl+M,F) processing in the File Window.

So I got out of the viewer, and selected the range of files I had not yet worked on via the Viewer, and did another Ctrl+M,F...this time unchecking the option to "Ignore images with existing face annotations" .  Now, the result was more like what I would expect (with most files having Faces detected, and assigned to the correct Persons - i.e. files that "were not processed" before, now were processed).

So now I wondered if:

  • The "Ignore images with existing face annotations" Impacted this when it should not have
    Could it be that (even though none of the files originally had face Annotations), leaving the "Ignore...with existing..." option Checked, caused some files to be skipped (because they were perceived as having Faces Annotations when they really didn't)?

    In fact all of the files in the File Window already did have Face Regions, but not Face Annotations.  These are all iPhone Photos, and I have IMatch set to not create Face Annotations from those Face Regions (preferring to use the Face Recognition in IMatch to do that):

       

    ...so perhaps something about the Face Region data in these files caused the issue?

    But if that were the case, then shouldn't all files have been skipped?...(not just 4 out of 5)?...

When I get to processing the next batch of files, I'll conduct some experiments, and will pay closer attention, and provide Debug Logs if I am able to find some repeatable behavior relating to "skipped files".
--Tony

hluxem

QuoteI have seen other topics here describing a perceived "reduced face detection accuracy" in the File Window, vs. the Viewer, and I have noted the same occasionally as well.  That is, while working on files in the Viewer, I found that pressing F6 for a file that had no Annotations, resulted in correct face annotations being added, when they had not been added by the Face Reignition operation in the File Window (Ctrl+M,F).

I can confirm that on my system pressing F6 in the viewer often find faces previously missed as well. For me it was mostly pictures with smaller faces. I got even pretty good at knowing when F6 will find a face and when the face was just too small to be picked up.
I created a separate small database, but this effect didn't behave the same for the pictures and I could not make sense out of it. I did not see a pattern, but I did not look for one either.
Sometimes just one face is found and if I run it again in the viewer with F6, 2 faces are found. Therefore, I don't think the ignore setting is involved.

I do remember that I read somewhere in an older thread that for pictures displayed in the viewer a full preview is loaded, maybe that's the difference? 

Heiner

Mario

Quote from: Tveloso on October 10, 2022, 04:21:24 AMI have seen other topics here describing a perceived "reduced face detection accuracy" in the File Window, vs. the Viewer,

Link?

I could not reproduce this effect. When you run FR for 100 files, the Dashboard should show clearly if these files are processed. If it hows less than 100 files, this would be a hint. Maybe process 1000 files at once, so you can more clearly see what the Dashboard reports (at the top).

I don't have many original Apple files with face data here (privacy) but I put them all into a folder, disabled XMP region import, indexed them and run FR in the File Window. All files were processed and faces detected.

Please create a set of sample images which produce this problem on your PC, upload them to your cloud space and send me a link to support email address. I will use them for testing and delete them afterwards.

I don't recall a similar problem ever having been reported. But Apple is always special, doing things in ways that keep users in their walled garden. Interoperability or standard compliance was never one of Apple's major goals, and maybe they somehow managed to bamboozle the region import or face handling in IMatch. I need the actual images to further analyze this.

@ hluxem

When you run face recognition in the Viewer, it uses the image at the full cache size as loaded. As documented in the help topic, this may be able to detect smaller faces the face recognition command in the File Window misses when you don't use the "Optimize for small faces" mode (which uses a much larger image for detection but can be 5 to 20 times slower, depending on your processors).
So your results are normal and expected.

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Tveloso

Quote from: Mario on October 10, 2022, 06:31:46 PM
Quote from: Tveloso on October 10, 2022, 04:21:24 AMI have seen other topics here describing a perceived "reduced face detection accuracy" in the File Window, vs. the Viewer,

Link?

I could not reproduce this effect. When you run FR for 100 files, the Dashboard should show clearly if these files are processed. If it hows less than 100 files, this would be a hint. Maybe process 1000 files at once, so you can more clearly see what the Dashboard reports (at the top).

Sorry for the late response Mario.  I didn't get back to this until this past weekend.

I didn't search for those other topics on this subject, but I recall one or two discussions on this - where you pointed out that the viewer uses the "optimized for smaller faces" option, and the file window does not by default.  Since reading that, I have always used the "for smaller faces option when running FR in the File Window.  And despite that, I occasionally encounter the "better in the Viewer" results.  But this was the first time that I noticed an apparent "every n" pattern.

Last night, I tried checking to see if the FR processing would behave differently on a new batch of files, based on the use of the "Ignore...with existing..." option.

I first ran FR with the option checked (even though none had Face Annotations yet), made note of the number of files where faces were detected, then closed IMatch, and restored a copy of the database that I had saved immediately prior to that FR operation.

Now I ran FR with the "Ignore...with existing..." option unchecked.  The results were exactly the same, and there was no "every n" pattern.  (I didn't actually scrutinize the files to see if it was really the exact same results, but the file count was the same.)

I used a pretty small batch of files though (only 165), so maybe the issue didn't manifest because of that?

It does seem that this behavior happens periodically (not the "every n" thing, but some files seeming to have been skipped), so I'll keep an eye on this and will report back if I encounter it again.

As hluxem says, this may be difficult to recreate on a smaller database, and might depend on the "face state" in a user's specific PC/database?


Quote from: Mario on October 10, 2022, 06:31:46 PMPlease create a set of sample images which produce this problem on your PC, upload them to your cloud space and send me a link to support email address. I will use them for testing and delete them afterwards.
.
.
.
Interoperability or standard compliance was never one of Apple's major goals, and maybe they somehow managed to bamboozle the region import or face handling in IMatch. I need the actual images to further analyze this.
I'll keep trying to recreate the issue (to identify a clear instance of "this file didn't get the same annotations as the files around it"), and will send along the files involved.

But again, as hluxem points out, those same files might not have the issue in another database.

I have also encountered a small issue with Face Manager (that perhaps, might be somehow related to this?), and will post about that later tonight.
--Tony

Mario


QuoteAs hluxem says, this may be difficult to recreate on a smaller database, and might depend on the "face state" in a user's specific PC/database?
I have repeated my test (see above) on a database which has over 400,000 faces. No problems.
This was never reported before and I assume that this is something particular to your database or images. Apple images.

Running the FR on "optimize for small faces" is usually not needed and may even produce worse results or false positives.
The "small faces option" may be useful when you regularly photograph large groups of persons.
Not for normal portraits, family photos and similar. You can keep the default to "default" and select the "optimize" mode in the dialog when you run FR in the File Window.

On the other hand, when the very slow runtime is OK for you and the setting does not produce additional false positives, keep it.

But it will cause a lot of additional stress on your processors, more heart, use more energy.
Maybe the issue you are setting is a stress issue? Running the IMatch AI on all processor cores and force full-size images will cause prolonged 100% CPU utilization - and this is prone to reveal system instability issues not seen during normal operation. And this again can cause strange effects and random errors.

Run the log file in debug mode (log file) and when you experience this peculiar problem again, secure the log file by copying it. If the IMatch AI runs into a problem or there are issues with loading/creating cache files for FR, this will be logged.


QuoteI used a pretty small batch of files though (only 165), so maybe the issue didn't manifest because of that
You can always Ctrl+V and Ctrl+C a number of times to scale your test set to 1650 images or so.
If this is a stress issue, running FR on 10 times as many files will cause stress for 10 times longer, maybe revealing something.
If you can reproduce this with more images processed in a batch, reduce the number of parallel threads used under Edit > Preferences > Application: Process Control. Especially when you use a notebook-type computer, which overheat much faster than a desktop or a workstation.
Reducing the number of parallel operations will reduce the load on the processor cores, reducing overall stress.

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook