Skip to content

Commit 8da19e6

Browse files
authored
methods documented - ClassifyFacialEmotions_4labels.java
1 parent eefec77 commit 8da19e6

File tree

1 file changed

+29
-4
lines changed

1 file changed

+29
-4
lines changed

Video-based-Facial-Expression-Recognition/src/main/java/org/uiux/maven/fer/ClassifyFacialEmotions_4labels.java

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,11 @@ static int maxIndex(float[] probabilities) {
141141
}
142142
return best;
143143
}
144-
144+
/**
145+
* read all bytes or exit
146+
* @param path
147+
* @return byteArray
148+
*/
145149
static byte[] readAllBytesOrExit(Path path) {
146150
try {
147151
return Files.readAllBytes(path);
@@ -151,7 +155,13 @@ static byte[] readAllBytesOrExit(Path path) {
151155
}
152156
return null;
153157
}
154-
158+
159+
/**
160+
* read all lines or exit
161+
* @param path
162+
*
163+
* return lines
164+
*/
155165
static List<String> readAllLinesOrExit(Path path) {
156166
try {
157167
return Files.readAllLines(path, Charset.forName("UTF-8"));
@@ -164,7 +174,7 @@ static List<String> readAllLinesOrExit(Path path) {
164174

165175
// In the fullness of time, equivalents of the methods of this class should be auto-generated from
166176
// the OpDefs linked into libtensorflow_jni.so. That would match what is done in other languages
167-
// like Python, C++ and Go.
177+
// like Python, C++ and Go.
168178
static class GraphBuilder {
169179
GraphBuilder(Graph g) {
170180
this.g = g;
@@ -227,11 +237,26 @@ Output<Integer> constant(String name, int[] value) {
227237
Output<Float> constant(String name, float value) {
228238
return this.constant(name, value, Float.class);
229239
}
230-
240+
/**
241+
* binary OP
242+
*
243+
* @param type
244+
* @param in1
245+
* @param in2
246+
* @return <T>
247+
*/
231248
private <T> Output<T> binaryOp(String type, Output<T> in1, Output<T> in2) {
232249
return g.opBuilder(type, type).addInput(in1).addInput(in2).build().<T>output(0);
233250
}
234251

252+
/**
253+
* binary OP3
254+
*
255+
* @param type
256+
* @param in1
257+
* @param in2
258+
* @return <T, U, V>
259+
*/
235260
private <T, U, V> Output<T> binaryOp3(String type, Output<U> in1, Output<V> in2) {
236261
return g.opBuilder(type, type).addInput(in1).addInput(in2).build().<T>output(0);
237262
}

0 commit comments

Comments
 (0)