swiftweb-servicesios10ios11.2algorithmia

Algorithmia RecognizeCharacters version 0.3.0 service response time differs on iOS 10 and iOS 11 device


We are using Algorithmia .../ocr/RecognizeCharacters/0.3.0 service to post image png data and get Characters Recognized in our Swift 4 App.

We had tested it earlier on iOS 10 device (iPhone5s) and the time was around 1 minute for single scan.

Now we have two iPhone5s devices. One have latest iOS 11.2.1 OS. The second has old iOS 10.3.3.

We found the following difference of time taken for the same service in both these devices.

Same Photo captured in both devices and scanned.

Response time on both iPhone5s device in our app took

We exchanged photos on both devices. ( copied the scanned photo from one device to another and then called the service again on both devices. )

the following is the code used for the service in our app.

// difference of time
let startDate = Date()
print( "Start Date/time \(startDate)" )

// Algorithmia starts
let client = Algorithmia.client(simpleKey: "*****")
let algo = client.algo(algoUri: "ocr/RecognizeCharacters/0.3.0").pipe( data: image.png )
    { resp, error in
        if (error == nil) {
            .... code to handle response ....
        } else {
            .... code to handle error ....
        }
        // Algorithmia ends

        let endDate = Date()
        let components = Calendar.current.dateComponents([.hour, .minute], from: startDate, to: endDate)

        print( "End Date/time \(endDate)   diff \(components.hour ?? 0):\(components.minute ?? 0)" )
    }

Why is this difference in case of two different OS?

What need to be changed for the code to run properly on iOS 11 and above?

Is there some changes for the code of services on new iOS OS?

Any clue, links, help will be appreciated.


Solution

  • This was strange.

    I received just now the update of iOS os version. to 11.2.2.

    As per the hint from @Upholder Of Truth, I updated the same iPhone 5S device.

    Started the app, for the same functionality.

    The scanning time was back to the normal 1 minute.

    relived....