-
Notifications
You must be signed in to change notification settings - Fork 0
/
Classifier.java
67 lines (53 loc) · 1.77 KB
/
Classifier.java
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package org.faceit.demo;
import android.graphics.Bitmap;
import android.graphics.RectF;
import java.util.List;
public interface Classifier {
public static class Recognition {
private final Float confidence;
private final String id;
private RectF location;
private final String title;
public Recognition(String id, String title, Float confidence, RectF location) {
this.id = id;
this.title = title;
this.confidence = confidence;
this.location = location;
}
public String getId() {
return this.id;
}
public String getTitle() {
return this.title;
}
public Float getConfidence() {
return this.confidence;
}
public RectF getLocation() {
return new RectF(this.location);
}
public void setLocation(RectF location) {
this.location = location;
}
public String toString() {
String resultString = "";
if (this.id != null) {
resultString = resultString + "[" + this.id + "] ";
}
if (this.title != null) {
resultString = resultString + this.title + " ";
}
if (this.confidence != null) {
resultString = resultString + String.format("(%.1f%%) ", new Object[]{Float.valueOf(this.confidence.floatValue() * 100.0f)});
}
if (this.location != null) {
resultString = resultString + this.location + " ";
}
return resultString.trim();
}
}
void close();
void enableStatLogging(boolean z);
String getStatString();
List<Recognition> recognizeImage(Bitmap bitmap);
}