-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbarcode_reader_v1.txt
More file actions
41 lines (31 loc) · 1.2 KB
/
barcode_reader_v1.txt
File metadata and controls
41 lines (31 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import com.mindee.input.LocalInputSource;
import com.mindee.v1.MindeeClient;
import com.mindee.v1.parsing.common.PredictResponse;
import com.mindee.v1.product.barcodereader.BarcodeReaderV1;
import java.io.File;
import java.io.IOException;
public class SimpleMindeeClientV1 {
public static void main(String[] args) throws IOException {
String apiKey = "my-api-key";
String filePath = "/path/to/the/file.ext";
// Init a new client
var mindeeClient = new MindeeClient(apiKey);
// Load a file from disk
var inputSource = new LocalInputSource(filePath);
// Parse the file
PredictResponse<BarcodeReaderV1> response = mindeeClient.parse(
BarcodeReaderV1.class,
inputSource
);
// Print a summary of the response
System.out.println(response.toString());
// Print a summary of the predictions
// System.out.println(response.getDocument().toString());
// Print the document-level predictions
// System.out.println(response.getDocument().getInference().getPrediction().toString());
// Print the page-level predictions
// response.getDocument().getInference().getPages().forEach(
// page -> System.out.println(page.toString())
// );
}
}