Pet Recognition
Once a profile has reference images the backend proposes crops from new events that it believes show the same pet. Show them to the user and send back what they confirm or reject.
All calls are on InstaVision.petService.
Pre-requisite: The user has to be signed in to perform the following operations.
Get recommended images
To get the recommended profile images for a pet, the following method can be used:
spaceId(required): The space ID of the device.petId(required): The pet ID.
InstaVision.petService.getRecommendations(
spaceId = "spaceId",
petId = "petId",
onSuccess = { recommendations ->
// The list of PetProfileImage objects
},
onError = { error ->
// The error object contains the error code and message
}
)
Update recommended image feedback
To submit feedback on recommended images for a pet, the following method can be used:
spaceId(required): The space ID of the device.petId(required): The pet ID.recommendations(required): ARecommendedImagesFeedbackRequestcontaining a list ofImageFeedback(idandfeedback).
InstaVision.petService.updateRecommendations(
spaceId = "spaceId",
petId = "petId",
recommendations = RecommendedImagesFeedbackRequest(
feedbacks = listOf(ImageFeedback(id = "imageId1", feedback = true))
),
onSuccess = {
// Called when the feedback is submitted successfully
},
onError = { error ->
// The error object contains the error code and message
}
)
Deprecated An older overload of
updateRecommendations(spaceId, petId, recommendations: List<String>, onSuccess, onError)also exists but is deprecated in favor of theRecommendedImagesFeedbackRequestoverload above.