@Test
public void recognise() throws Exception {

    TikaConfig config = null;
    try (InputStream is = getClass().getResourceAsStream("dl4j-vgg16-config.xml")) {
        config = new TikaConfig(is);
    } catch (Exception e) {
        if (e.getMessage() != null
                && (e.getMessage().contains("Connection refused")
                || e.getMessage().contains("connect timed out"))) {
            assumeTrue("skipping test because of connection issue", false);
        }
        throw e;
    }
    assumeTrue("something went wrong loading tika config", config != null);
    Tika tika = new Tika(config);
    Metadata md = new Metadata();
    try (InputStream is = getClass().getResourceAsStream("lion.jpg")) {
        tika.parse(is, md);
    }
    String[] objects = md.getValues("OBJECT");
    boolean found = false;
    for (String object : objects) {
        if (object.contains("lion")) {
            found = true;
            break;
        }
    }
    assertTrue(found);
}