gpt4 book ai didi

ios - 苹果照片 : Get list of “face albums” from Photos. 应用程序

转载 作者:行者123 更新时间:2023-12-01 16:22:42 25 4
gpt4 key购买 nike

我想制作一个应用程序,您可以在其中从 Apple 的照片应用程序中选择一张脸,然后该应用程序会在 map 上探索这些照片。

到目前为止,我发现这个查询返回一个 PHCollectionList命名为“人”:

let peopleFolder = PHCollectionList.fetchCollectionLists(
with: .smartFolder,
subtype: .smartFolderFaces,
options: nil).firstObject!

...但我看不到将这些面孔放入此文件夹中的方法。以下是我迄今为止尝试过的查询:
let people1 = PHCollectionList.fetchCollections(in: peopleFolder, options: nil)
let people2 = PHCollection.fetchCollections(in: peopleFolder, options: nil)
let people3 = PHAssetCollection.fetchCollections(in: peopleFolder, options: nil)

...但是这三个都返回空 PHFetchResult s。

有没有办法在用户的照片库中获取人脸列表?

最佳答案

我最好的猜测是,Apple 不希望应用程序访问这些信息,因为它是高度私密的信息。我建议提交一个雷达,并希望他们在 future 的 macOS 版本中以一些应用程序权限打开它。

另一种选择是直接从磁盘上的照片库中访问 sqlite 数据库文件(如这里所建议的 How to access People album used in Apple's Photos app),但内部格式可以随时更改。

关于ios - 苹果照片 : Get list of “face albums” from Photos. 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50788850/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com