@Test
public void recognise() throws Exception {

    TensorflowImageRecParser recogniser = new TensorflowImageRecParser();
    recogniser.initialize(new HashMap<String, Param>());
    try (InputStream stream = getClass().getClassLoader().getResourceAsStream("test-documents/testJPEG.jpg")) {
        List<RecognisedObject> objects = recogniser.recognise(stream, new DefaultHandler(), new Metadata(), new ParseContext());
        Assert.assertTrue(5 == objects.size());
        Set<String> objectLabels = new HashSet<>();
        for (RecognisedObject object : objects) {
            objectLabels.add(object.getLabel());
        }
        System.out.println(objectLabels);
        String[] expected = {"Egyptian cat", "tabby, tabby cat"};
        for (String label : expected) {
            Assert.assertTrue(label + " is expected", objectLabels.contains(label));
        }
    }
}