Skip to content

Commit

Permalink
added getter for net to access underlaying inference network
Browse files Browse the repository at this point in the history
  • Loading branch information
cansik committed Feb 17, 2022
1 parent bcf4fb8 commit be902ae
Show file tree
Hide file tree
Showing 19 changed files with 75 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/ch/bildspur/vision/CRNNNetwork.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,8 @@ public TextResult run(Mat frame) {

return new TextResult("hello", 0.0f);
}

public Net getNet() {
return net;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,8 @@ public int getFlags() {
public void setFlags(int flags) {
this.flags = flags;
}

public CascadeClassifier getNet() {
return net;
}
}
4 changes: 4 additions & 0 deletions src/main/java/ch/bildspur/vision/ColorizationNetwork.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,8 @@ public ImageResult run(Mat frame) {
CvProcessingUtils.toPImage(output, result);
return new ImageResult(result);
}

public Net getNet() {
return net;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,8 @@ public ImageResult run(Mat frame) {
CvProcessingUtils.toPImage(output, result);
return new ImageResult(result);
}

public Net getNet() {
return net;
}
}
4 changes: 4 additions & 0 deletions src/main/java/ch/bildspur/vision/Face3DDFAV2Network.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,8 @@ public ResultList<FacialLandmarkResult> runByDetections(Mat frame, ResultList<Ob

return results;
}

public Net getNet() {
return net;
}
}
4 changes: 4 additions & 0 deletions src/main/java/ch/bildspur/vision/FacemarkLBFNetwork.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,8 @@ public ResultList<FacialLandmarkResult> runByDetections(Mat frame, ResultList<Ob

return results;
}

public FacemarkLBF getNet() {
return net;
}
}
4 changes: 4 additions & 0 deletions src/main/java/ch/bildspur/vision/MaskRCNN.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,8 @@ public float getMaskThreshold() {
public void setMaskThreshold(float maskThreshold) {
this.maskThreshold = maskThreshold;
}

public Net getNet() {
return net;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,8 @@ public ResultList<ObjectDetectionResult> run(Mat frame) {

return new ResultList<>();
}

public Net getNet() {
return net;
}
}
4 changes: 4 additions & 0 deletions src/main/java/ch/bildspur/vision/MediaPipeFaceLandmark.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,8 @@ public ResultList<FacialLandmarkResult> runByDetections(Mat frame, ResultList<Ob

return results;
}

public Net getNet() {
return net;
}
}
4 changes: 4 additions & 0 deletions src/main/java/ch/bildspur/vision/MidasNetwork.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,8 @@ private void mapDepthToImage(Mat depthFrame, PImage img) {
depthFrame.convertTo(depthFrame, CV_8U, alpha, beta);
CvProcessingUtils.toPImage(depthFrame, img);
}

public Net getNet() {
return net;
}
}
4 changes: 4 additions & 0 deletions src/main/java/ch/bildspur/vision/OpenFaceNetwork.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,8 @@ public ResultList<VectorResult> runByDetections(PImage image, ResultList<ObjectD
public ResultList<VectorResult> runByDetections(Mat frame, ResultList<ObjectDetectionResult> detections) {
return multiProcessor.runByDetections(frame, detections);
}

public Net getNet() {
return net;
}
}
4 changes: 4 additions & 0 deletions src/main/java/ch/bildspur/vision/SSDMobileNetwork.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,8 @@ public float getConfidenceThreshold() {
public void setConfidenceThreshold(float confidenceThreshold) {
this.confidenceThreshold = confidenceThreshold;
}

public Net getNet() {
return net;
}
}
4 changes: 4 additions & 0 deletions src/main/java/ch/bildspur/vision/StyleTransferNetwork.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,8 @@ public ImageResult run(Mat frame) {
CvProcessingUtils.toPImage(output, result);
return new ImageResult(result);
}

public Net getNet() {
return net;
}
}
3 changes: 3 additions & 0 deletions src/main/java/ch/bildspur/vision/SuperResolutionNetwork.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,7 @@ public ImageResult run(Mat frame) {
return new ImageResult(result);
}

public DnnSuperResImpl getNet() {
return net;
}
}
4 changes: 4 additions & 0 deletions src/main/java/ch/bildspur/vision/TesseractNetwork.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,8 @@ public ResultList<TextResult> runByDetections(PImage image, ResultList<ObjectDet
public ResultList<TextResult> runByDetections(Mat frame, ResultList<ObjectDetectionResult> detections) {
return polyExecutor.runByDetections(frame, detections);
}

public TessBaseAPI getApi() {
return api;
}
}
4 changes: 4 additions & 0 deletions src/main/java/ch/bildspur/vision/TextBoxesNetwork.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,8 @@ public float getNmsThreshold() {
public void setNmsThreshold(float nmsThreshold) {
this.nmsThreshold = nmsThreshold;
}

public TextDetectorCNN getNet() {
return net;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,8 @@ public float getIouThreshold() {
public void setIouThreshold(float iouThreshold) {
this.iouThreshold = iouThreshold;
}

public Net getNet() {
return net;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,8 @@ public ResultList<ClassificationResult> runByDetections(PImage image, ResultList
public ResultList<ClassificationResult> runByDetections(Mat frame, ResultList<ObjectDetectionResult> detections) {
return multiProcessor.runByDetections(frame, detections);
}

public Net getNet() {
return net;
}
}
4 changes: 4 additions & 0 deletions src/test/java/ch/bildspur/vision/test/YOLODetectionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import ch.bildspur.vision.YOLONetwork;
import ch.bildspur.vision.result.ObjectDetectionResult;
import ch.bildspur.vision.test.tools.StopWatch;
import org.opencv.dnn.Dnn;
import processing.core.PApplet;
import processing.core.PImage;

Expand Down Expand Up @@ -44,6 +45,9 @@ public void setup() {
println("loading model...");
yolo.setup();

yolo.getNet().setPreferableBackend(Dnn.DNN_BACKEND_OPENCV);
yolo.getNet().setPreferableTarget(Dnn.DNN_TARGET_OPENCL);

yolo.setConfidenceThreshold(0.2f);

println("inferencing...");
Expand Down

0 comments on commit be902ae

Please sign in to comment.