Posts

Post not yet marked as solved
2 Replies
1.1k Views
Hi, I'm experimenting with the new MLModelCollection stuff in Xcode 12 and iOS 14 and I'm having trouble. I've created a Model Collection named "Collection" using the CoreML Model Deployment dashboard, added a Model to the collection, and created a deployment with an uploaded .mlarchive file. In the dashboard I can navigate to the deployment and see Model Assets, and I can download the assets (it appears to be a zip file that when opened contains weights and such). The mlmodel that I created the .mlarchive from works great when I drag and drop it into my project. In my iOS app, following the instructions in the MLModelCollection help files, I call: MLModelCollection.beginAccessing(identifier: "iNatTestCollectionID", completionHandler: modelCollectionAvailable) My modelCollectionAvailable method looks like:     func modelCollectionAvailable(result: Result<MLModelCollection, Error>) {         switch result {         case .success(let collection):             print("Model collection `\(collection.identifier)` is available.")             print("Model deployment id is \(collection.deploymentID)")             print("Model collection entries are \(collection.entries)")         case .failure(let error):             print("got \(error) when accessing collection")         }     } Unfortunately, the collection I get in the callback always has an empty deployment id and there are no entries in the collection. I've tried waiting a few days in case there were syncing or deployment issues, but still nothing. I do see this error in the console: 2020-11-03 15:12:27.600165-0800 ModelDeploymentTest[15009:910661] [coreml] MLModelCollection: experimentId unexpectedly not returned But I'm not sure what that means. Anyone have any advice? Thanks, alex
Posted Last updated
.
Post marked as solved
4 Replies
5.3k Views
Hi folks, I work on a free open source/open science app called iNaturalist, we use CoreML / computer vision to identify photos of wildlife, and users can turn those photos into geotagged occurrence records that scientists can use to study species in space and time. This preface is my way of explaining that I care a lot about getting accurate metadata for the photos my users share with our app. In iOS 14, I'm playing around with PhotosUI and PHPickerViewController and it seems that the only way to get photo metadata from the photo a user picks is by using the PHPhotoLibrary configuration. If I don't use the PHPhotoLibrary configuration when initializing the PHPickerViewController, my app will get UIImages that have no metadata in the underlying cgImage, and the assetIdentifier field is nil. When using the PHPhotoLibrary configuration when initializing PHPickerViewController, I'm seeing some unexpected (to me) behavior. It would be helpful if someone else can confirm this, and confirm that this is behaving as intended. if the user grants no access to the photo library, when the user selects a photo with PHPickerViewController, my app gets a UIImage but no PHAssetIdentifier, so no metadata at all. This seems totally reasonable - the user has chosen not to share full image metadata with me. if the user has granted full permissions to the photo library, when a user selects a photo with PHPickerViewController my app gets both a UIImage and a PHAssetIdentifier which can be used to fetch a PHAsset via the PHPhotoLibrary. Using the PHAsset I can get metadata directly from the asset properties (this can be problematic, see note below) or by loading the EXIF via CoreImage properties with the method [asset requestContentEditingInputWithOptions:completionHandler]. This also seems totally reasonable, the user has chosen to share full image metadata with me. if the user grants limited access to the photo library, things get interesting. When the user selects a photo with PHPickerViewController, my app gets a UIImage and a PHAssetIdentifier. If the photo is part of the limited access set for my app granted by the user, the PHAssetIdentifier will be valid and can be used to fetch a PHAsset, which can then be used to extract metadata as described in the previous bullet point. For this photo, the behavior is the same as if the user has granted full access to the photo library. This seems reasonable - the user has chosen to share full image metadata for this photo with me. If the photo is not part of the limited access set for my app granted by the user, the PHAssetIdentifier can be used to create but not fetch a PHAsset. I still see the fields on the PHAsset (location, datetime, etc) but I cannot fetch it from the PHPhotoLibrary - I get the error The operation couldn’t be completed. (Cocoa error -1.) So in this final case I get the selected UIImage, and a glimpse of the photo metadata as mediated (sometimes incorrectly, again see note below) by the PHAsset. This doesn't seem reasonable - the user has not chosen to share full image metadata for this photo with me, but some image metadata is leaked via the PHAsset properties. If the photo is not part of the limited access set, the user will be prompted by iOS to change the limited access set or keep it the same. This creates the scenario where a user is asked twice to select a photo to share with my app, once to pick the photo and then again to grant permissions to it. This is a little cumbersome but I'm happy to jump through some extra hoops to preserve my users privacy. Note that PHAssets always have a creation date, which might be an EXIF taken date. However, if the photo didn't have an EXIF taken date (it taken by another app or another device that doesn't save EXIF and then copied to the iPhone via iCloud or other photo sync mechanisms, for example), the creation date will be the date that it was imported into the Photo Library. So the PHAsset creation date is not 100% trustworthy for me if I'm trying to make records to be used by scientists to understand when an organism was seen. EXIF has problems but it's much more reliable. Thanks for reading, alex
Posted Last updated
.
Post not yet marked as solved
3 Replies
506 Views
It's 1:36pm PST on monday, june 1.Every campaign I have, when I click on it, goes to an error screen that says:We're Sorry.We can't find the page you're looking for.Please return to Search AdsI've tried making new campaigns, duplicating existing campaigns, they all end up here. I've tried Safari, Chrome, private browser, clearing cache, etc.Any advice?Thanks,alex
Posted Last updated
.