Skip to content

Commit

Permalink
- Optimizations.
Browse files Browse the repository at this point in the history
  • Loading branch information
jjzazuet committed Mar 30, 2022
1 parent dfe964c commit eea96c5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins { id("io.vacco.oss.gitflow") version "0.9.8" }

group = "io.vacco.kimaris"
version = "0.1.1"
version = "0.1.2"

configure<io.vacco.oss.gitflow.GsPluginProfileExtension> {
addJ8Spec()
Expand Down
7 changes: 1 addition & 6 deletions src/main/java/io/vacco/kimaris/impl/KmDetFace.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@

public class KmDetFace {

private static int binTestGtEq(int px1, int px2) {
if (px1 <= px2) { return 1; }
return 0;
}

public static double classifyRegion(int r, int c, int s, int treeDepth, byte[] pixels, int dim, KmFaceCascade pg) {
double out = 0;
int root = 0, px1, px2;
Expand All @@ -23,7 +18,7 @@ public static double classifyRegion(int r, int c, int s, int treeDepth, byte[] p
x2 = ((r + pg.treeCodes[root + 4 * idx + 2] * s) >> 8) * dim + ((c + pg.treeCodes[root + 4 * idx + 3] * s) >> 8);
px1 = pixels[x1] & 0xff;
px2 = pixels[x2] & 0xff;
idx = 2 * idx + binTestGtEq(px1, px2);
idx = 2 * idx + (px1 <= px2 ? 1 : 0);
}
out += pg.treePred[treeDepth * i + idx - treeDepth];
if (out <= pg.treeThreshold[i]) {
Expand Down
7 changes: 1 addition & 6 deletions src/main/java/io/vacco/kimaris/impl/KmDetPup.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@

public class KmDetPup {

private static int binTestLt(int px1, int px2) {
if (px1 > px2) { return 1; }
return 0;
}

public static void classifyRegion(double r, double c, double s,
int treeDepth, int nrows, int ncols,
byte[] pixels, int dim, boolean flipV,
Expand All @@ -32,7 +27,7 @@ public static void classifyRegion(double r, double c, double s,
}
px1 = pixels[r1 * dim + c1] & 0xff;
px2 = pixels[r2 * dim + c2] & 0xff;
idx = 2 * idx + 1 + binTestLt(px1, px2);
idx = 2 * idx + 1 + (px1 > px2 ? 1 : 0);
}
int lutIdx = 2 * (int) (plc.trees * treeDepth * i + treeDepth * j + idx - (treeDepth - 1));
dr += plc.treePreds[lutIdx + 0];
Expand Down

0 comments on commit eea96c5

Please sign in to comment.