-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
18 lines (16 loc) · 729 Bytes
/
Main.java
File metadata and controls
18 lines (16 loc) · 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import java.util.List;
public class Main {
public static void main(String[] args) throws Exception {
/* ImageProcessor returns 4-dimensional float array -> float[?][224][224][3]
* First dimension of the array is a batch for neural network,
* You may pass multiple image paths to ImageProcessor
* */
ImageProcessor imageProcessor = new ImageProcessor();
Classificator classificator = new Classificator();
float[][][][] imageData = imageProcessor.loadAndNormalizeImages("images/cat.jpg", "images/cat3.jpg");
List<String> result = classificator.classify(imageData);
for(String label: result) {
System.out.println(label);
}
}
}