Handling model download failures
Q: What ifprepareModel
doesn't complete beforegetConfig
?
prepareModel
doesn't complete beforegetConfig
?A: The captur SDK will return an error
Captur.prepareModel prepares the AI model and fetch necessary configurations. If the user does not already have the latest version of the model on device, this includes a step to download the model over the air (OTA). Even under optimal network conditions, this process can take around 4 seconds, and it may take longer on devices with older Android versions.
Delays and model download failures can occur in several edge cases:
User Immediately Kills the App After Ride Begins:
If a user starts a ride and then quickly kills the app before the AI model finishes downloading, the model remains unprepared.
When the user restarts the app to end the ride, the app needs to re-download and prepare the model, causing significant delays.
Very Short Rides:
In cases where rides are very short, the app may not have enough time to complete the model download during the ride.
Upon attempting to end the ride, the user experiences delays because the AI model isn't ready.
Network Issues or Poor Connectivity:
Even if the user keeps the app running, poor network conditions can prevent the model from downloading successfully.
This results in the AI model not being ready when needed, causing delays during the end-of-ride process.
Solutions:
Fallback to Non-Captur end-trip image:
Some devices are not supported by the captur SDK, and in rare cases, like model download failures above, the captur SDK can throw an error instead of initialising the camera.
The recommended approach is to fallback to previous take photo flows.
(v2.6+) Bundled Default Model
Bundled Default Models in SDK version 2.6+ ensures that prepareModel() does not rely on a model download, and can complete quickly.
How is the Default Model chosen?
The default model is tied to the configuration of a default location. This means that whatever model and policy are associated with this default location will be bundled with the SDK.
The default location is chosen to provide a user experience that is applicable to most of your operational locations.
Please reach out to our team for specific details of the default location chosen.
Updated 5 months ago