@Test
public void jpegTFObjRecTest() throws IOException, TikaException, SAXException {

  TensorflowImageRecParser p = new TensorflowImageRecParser();
  Assume.assumeTrue(p.isAvailable());      
    try (InputStream stream = loader.getResourceAsStream(CONFIG_FILE_OBJ_REC)) {
        assert stream != null;
        Tika tika = new Tika(new TikaConfig(stream));
        Metadata metadata = new Metadata();
        try (InputStream imageStream = loader.getResourceAsStream(CAT_IMAGE_JPEG)) {
            Reader reader = tika.parse(imageStream, metadata);
            List<String> lines = IOUtils.readLines(reader);
            String text = StringUtils.join(lines, " ");
            String[] expectedObjects = {"Egyptian cat", "tabby, tabby cat"};
            String metaValues = StringUtils.join(metadata.getValues(ObjectRecognitionParser.MD_KEY_OBJ_REC), " ");
            for (String expectedObject : expectedObjects) {
                String message = "'" + expectedObject + "' must have been detected";
                Assert.assertTrue(message, text.contains(expectedObject));
                Assert.assertTrue(message, metaValues.contains(expectedObject));
            }
        }
    }
}