Post

Replies

Boosts

Views

Activity

Reply to Core ML - image similarity ranking
Apple provides a sample project - https://developer.apple.com/documentation/vision/analyzing_image_similarity_with_feature_print to show how to use feature print to compare images. The code below I modified shows how to compare two apple images to a pear image. The smaller the distance the similar the images are. import UIKit import Vision func featureprintObservationForImage(atURL url: URL) -> VNFeaturePrintObservation? {     let requestHandler = VNImageRequestHandler(url: url, options: [:])     let request = VNGenerateImageFeaturePrintRequest()     do {       try requestHandler.perform([request])       return request.results?.first as? VNFeaturePrintObservation     } catch {       print("Vision error: \(error)")       return nil     }   } let apple1 = featureprintObservationForImage(atURL: Bundle.main.url(forResource:"apple1", withExtension: "jpg")!) let apple2 = featureprintObservationForImage(atURL: Bundle.main.url(forResource:"apple2", withExtension: "jpg")!) let pear = featureprintObservationForImage(atURL: Bundle.main.url(forResource:"pear", withExtension: "jpg")!) var distance = Float(0) try apple1!.computeDistance(&distance, to: apple2!) var distance2 = Float(0) try apple1!.computeDistance(&distance2, to: pear!)
Jun ’20
Reply to Loading SVG smbol in swiftui image
You can do this with SVGKit import SwiftUI import SVGKit struct SVGKFastImageViewSUI:UIViewRepresentable {   var url:URL   func makeUIView(context: Context) -> SVGKFastImageView {          //let svg = URL(string: url)!    // let data = try? Data(contentsOf: url)     let svgImage = SVGKImage(contentsOf: url)     return SVGKFastImageView(svgkImage: svgImage ?? SVGKImage())         }   func updateUIView(_ uiView: SVGKFastImageView, context: Context) {         }         } struct SVGImage_Previews: PreviewProvider {   static var previews: some View {     SVGKImageViewSUI(url:URL(string:"https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/android.svg")!)   } }
Jun ’20
Reply to Running AVAudioEngine on Watch Series 2
Sound is noisy and scrannel on watch. I'm using this repo, https://github.com/GrantJEmerson/SwiftSynth and set Oscillator.amplitude and Synth.shared.frequency. 2. I didn't tried on other watches, I don't have them. I only tried with Watch simulators (Series 4 and Series 5) that worked fine. I will download Series 2 sim and try on that too. 3. I mean Hz for frequencies. I placed a slider between 100-900 Hz and tried different values on this range. Is there a spec where I can check available frequencies for watch hardware? 4. I couldn't. I don't have wireless headphones.
Oct ’20
Reply to How to test Universal Links before releasing app?
Should App be uploaded to TestFlight to test the association? I'm working on a new app, created the app on AppStore to get appId but didn't upload any build yet. I can't make it work with Xcode builds deployed to my iPhone. This setting is checked Settings>Developer>Associated Domains and developer mode is used. File validation gives this result: Link to Application | Action required Could not extract required information for application links. Learn how to implement the recommended Universal Links. | Error cannot fetch app site association
Jul ’21