You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to search for photos according to categories

After upgrading to macOS 10.12 Sierra or 10.13 High Sierra, you may have noticed that Photos is using a lot of processing time to scan the library and to classify the photos according to their content into categories. This can take days or weeks for a large Photos Library.


We can use categories to search for photos showing certain scenes or objects, without having to add keywords to the photos. For example, type "Bridge into the search field in Photos, click "Bridge Category" and you will see many of your photos showing a bridge, and perhaps some wrong matches. Or search for "Bridge, Spain" and you will restrict the search to pictures of bridges taken in Spain.

Find photos by text, content, or date - Apple Support

User uploaded file


Or ask Siri - for example "Show me photos of puffins".

The only problem is, that the user guide for Photos does not list the categories that Photos (or Siri) can recognize. So it is a bit of trial and error to come up with the correct search phrase.


But we can get a list of known phrases by looking into the PhotoAnalysis.framework. It contains a file "scenetaxonomy.strings". An easy way to see the text inside is to open a Terminal window, then copy and paste the line below into the Terminal window. It will create a text file named "photoscategories.txt"on your Desktop with any text found inside the scene taxonomy file.

strings /System/Library/PrivateFrameworks/PhotoAnalysis.framework/Versions/A/Frameworks /PhotoVision.framework/Versions/A/Resources/en.lproj/scenetaxonomy.strings > ~/Desktop/photoscategories.txt


The Terminal command needs to go onto one single line - there should be no line break after "strings " and after ">", just a space character. The forum software is inserting the line breaks. Remove them when you copy the command.


The first few lines of the text will be garbage. Scroll down until you see human readable words to find the known categories. You'll find a compact text block like this

.....

MayonnaiseXClothingXBalloonsWMartiniYBlowtorch_

?Flower Garden|Flower Gardens|Gardens|Horticulture|HorticulturesWHammock_

Magnifying GlassesWWillowsUPolesUStool_

'Dials|Gauge|Gauges|Indicator|Indicators_

Pumps|StilettosXSnappersVSewingYFishtanks_

Marimba|Marimbas|XylophonesSPeaWPagodas_

Tires|Tyre|TyresWShotgunWRaisinsVWheels_

2Extinguishers|Fire Extinguisher|Fire Extinguishers_

"Cobweb|Cobwebs|Spiderwebs|Web|WebsVPaellaSAxeWGeysersZFairgroundVHennasUClams_

Beetroot|Beetroots|BeetsXDomicileZThermostatYAnchovies_

Falcon|Falcons|PeregrinesWTermite]Jack RussellsUWheat_

Aqualung|Aqualungs|ScubasUGraph_

/Block|Blocks|Pulley Block|Pulley Blocks|PulleysVPuffinUCloak_

mDisc|Discs|Disk|Disks|Phonograph Record|Phonograph Recording|Phonograph Recordings|Phonograph Records|RecordsYBriefcaseXScissorsXTeriyaki\Hummingbirds_

Sunflower SeedsTNULLTIcesWReptileXDustpansXHalibuts[Bruschettas^Frozen YogurtsVRabbitWLobsterUSarisYUngulates\HippopotamusWCalzone_

1Bass Horn|Bass Horns|Sousaphone|Sousaphones|TubasXPyramidsZPersimmonsYBookshelf_

1Pignolia|Pignolias|Pine Nuts|Pinon Nut|Pinon NutsYTortoisesZBlackberryZChandelierWPuddlesUCurry

MacBook Pro (Retina, 15-inch, Mid 2015), macOS High Sierra (10.13.1), 2,8 GHz Intel Core i7, 16 GB, 1TB

Posted on Nov 14, 2017 12:25 AM

Reply
Question marked as Top-ranking reply

Posted on Nov 15, 2017 12:41 AM

You're welcome, Antonio. I first tried to ask Siri "Give me a list of known categories for Photos", but Siri did not know or understand. 😁


I added this to my user tips: How to get a list of the known categories for Photos 3.0

2 replies

How to search for photos according to categories

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.