use of com.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation in project java-vision by googleapis.
the class ITSystemTest method detectLocalizedObjectsTest.
@Test
public void detectLocalizedObjectsTest() throws IOException {
List<AnnotateImageResponse> responses = getResponsesList("puppies.jpg", Type.OBJECT_LOCALIZATION, false);
List<String> actual = new ArrayList<>();
for (AnnotateImageResponse res : responses) {
for (LocalizedObjectAnnotation entity : res.getLocalizedObjectAnnotationsList()) {
actual.add(entity.getName());
}
}
assertThat(actual).contains("Dog");
}
Aggregations