How to get a list of the known categories for Photos 3.0

by: 
Last modified: Feb 23, 2021 11:15 PM
5 7918 Last modified Feb 23, 2021 11:15 PM

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 a 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/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


This user tip was generated from the following discussion: How to search for photos according to categories

Comments

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