-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathv2_split.txt
More file actions
42 lines (34 loc) · 1.21 KB
/
v2_split.txt
File metadata and controls
42 lines (34 loc) · 1.21 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
42
import com.mindee.input.LocalInputSource;
import com.mindee.v2.MindeeClient;
import com.mindee.v2.product.split.SplitResponse;
import com.mindee.v2.product.split.SplitResult;
import com.mindee.v2.product.split.params.SplitParameters;
import java.io.IOException;
public class SimpleMindeeClientV2 {
public static void main(String[] args)
throws IOException, InterruptedException
{
String apiKey = "MY_API_KEY";
String filePath = "/path/to/the/file.ext";
String modelId = "MY_MODEL_ID";
// Init a new client
MindeeClient mindeeClient = new MindeeClient(apiKey);
// Set inference parameters
SplitParameters splitParams = SplitParameters
// ID of the model, required.
.builder(modelId)
.build();
// Load a file from disk
LocalInputSource inputSource = new LocalInputSource(filePath);
// Send for processing using polling
SplitResponse response = mindeeClient.enqueueAndGetResult(
SplitResponse.class,
inputSource,
splitParams
);
// Print a summary of the response
System.out.println(response.getInference().toString());
// Access the split result
SplitResult result = response.getInference().getResult();
}
}