@Test public void searchByReverseImage() { // Search by image (image URL represented by: String or java.net.URL) client.searchInputs(SearchClause.matchImageVisually(ClarifaiImage.of("@@sampleTrain"))) .getPage(1) .executeSync(); // Search by image (image represented by: java.io.File or byte[]) client.searchInputs(SearchClause.matchImageVisually(ClarifaiImage.of(new File("image.png")))) .getPage(1) .executeSync(); }
@Test public void reverseImageSearch() { client.searchInputs(SearchClause.matchImageVisually(ClarifaiImage.of("http://i.imgur.com/HEoT5xR.png"))) .getPage(1) .executeSync(); }
@Test public void quickStartSearch() { final ClarifaiResponse<SearchInputsResult> trainImages = client.searchInputs( // Finds images that match this picture of a train OR images that match the "train" concept tag SearchClause.matchImageVisually(ClarifaiImage.of("@@sampleTrain")) ) .getPage(1) .executeSync(); }
@Test public void searchANDing() { client.searchInputs() .ands( SearchClause.matchUserTaggedConcept(Concept.forName("cat")), SearchClause.matchConcept(Concept.forName("dog").withValue(false)), SearchClause.matchImageVisually(ClarifaiImage.of("@@sampleTrain")) ) .getPage(1) .executeSync(); }