问题描述
Apple的Photo应用程序具有面部识别功能.我想知道是否存在API来访问已由应用分类的照片的关联数据.
Apple's Photo app has facial recognition capabilities. I would like to know if an API exists to access the associated data for photos which have been classified by the app.
(用API标记,不确定哪个标记.)
(tagged with API, not sure which tags.)
谢谢!
推荐答案
Apple发布了用于访问Apple Photos的SDK,名为照片套件.在文档中,您将找到对照片应用程序和照片云的API访问.但是,如果您正在寻找一种HTTP API,我认为不会公开宣布该API.
Apple released an SDK for accessing Apple Photos called Photo Kit. In the documentation, you will find API access to the photos application and photos cloud. However, if you are looking for an HTTP API I do not believe one has been announced publicly.
如果您只需要访问Photos MacOS应用程序上的数据,建议您浏览照片库数据库目录中的SQLite photos.db.
If you only need access to is data on Photos MacOS app I would recommend digging through the SQLite photos.db located in the photos library database directory.
/Users/[yourUserName]/Pictures/Photos Library.photoslibrary/database/photos.db
我这个周末正在研究一个项目,该项目需要类似的人脸数据,并将记录我的进度.这是一个示例SQLite查询,可用于获取所有面孔,照片和对应的人:
I am working on a project this weekend that requires similar face data and will document my progress. Here is a sample SQLite query you can use to get all faces, photos, and corresponding person:
SELECT *, RKFace.modelId AS fId
FROM RKFace
JOIN RKMaster ON RKMaster.modelId = RKFace.imageModelId
LEFT JOIN RKFaceGroup ON RKFaceGroup.modelId = RKFace.faceGroupId
LEFT JOIN RKFaceCrop ON RKFaceCrop.faceId = RKFace.imageModelId
LEFT JOIN RKFacePrint ON RKFacePrint.faceId = RKFace.imageModelId
LEFT JOIN RKPerson ON RKPerson.modelId = RKFace.personId;
我希望这会有所帮助. :-)
I hope this helps. :-)
这篇关于如何访问Apple的“照片"应用中使用的“人物"相册的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!