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.


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
  }
)

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): A RecommendedImagesFeedbackRequest containing a list of ImageFeedback (id and feedback).
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 the RecommendedImagesFeedbackRequest overload above.


This site uses Just the Docs, a documentation theme for Jekyll.