1919
2020/**
2121 *
22- * https://github.com/luxonis/depthai
23- * python3 depthai_demo.py -cb callbacks.py
22+ * https://github.com/luxonis/depthai python3 depthai_demo.py -cb callbacks.py
2423 *
2524 * https://github.com/luxonis/depthai-experiments/tree/master/gen2-face-recognition
2625 *
@@ -69,6 +68,7 @@ public void installDepthAi() {
6968
7069 // git.clone("./", config.depthaiCloneUrl)
7170 List <String > packages = new ArrayList <>();
71+ packages .add ("depthai_sdk==1.15.1" );
7272 packages .add ("depthai==2.29.0" );
7373 packages .add ("blobconverter==1.4.3" );
7474 packages .add ("opencv-python" );
@@ -79,19 +79,19 @@ public void installDepthAi() {
7979 }
8080 // py4j.exec("");
8181 }
82-
82+
8383 public void startRecognition () {
84-
84+
8585 }
86-
86+
8787 public void stopRecognition () {
88-
88+
8989 }
90-
90+
9191 /**
92- * FIXME - turn into interface
93- * Will publish processing messages to the processor(s) currently
94- * subscribed.
92+ * FIXME - turn into interface Will publish processing messages to the
93+ * processor(s) currently subscribed.
94+ *
9595 * @param method
9696 * @param data
9797 */
@@ -102,9 +102,8 @@ public void processMessage(String method, Object data) {
102102 }
103103
104104 /**
105- * FIXME - turn into interface
106- * Processing publishing point, where everything InMoov2 wants to be processed
107- * is turned into a message and published.
105+ * FIXME - turn into interface Processing publishing point, where everything
106+ * InMoov2 wants to be processed is turned into a message and published.
108107 *
109108 * @param msg
110109 * @return
@@ -113,7 +112,6 @@ public Message publishProcessMessage(Message msg) {
113112 return msg ;
114113 }
115114
116-
117115 public Classification publishClassification (Classification classification ) {
118116 classification .src = getName ();
119117 // we have a detection or recognition event ... publish the associated image
@@ -122,19 +120,19 @@ public Classification publishClassification(Classification classification) {
122120 // imageToWeb("classification.png");
123121 invoke ("imageToWeb" , "classification.png" );
124122 }
125-
123+
126124 return classification ;
127125 }
128-
126+
129127 public String imageToWeb (String filePath ) {
130128 byte [] content = null ;
131129 try (FileInputStream fileInputStream = new FileInputStream (new File (filePath ))) {
132- content = new byte [(int ) new File (filePath ).length ()];
133- fileInputStream .read (content );
134- String img = Base64 .getEncoder ().encodeToString (content );
135- return String .format ("data:image/png;base64,%s" , img );
130+ content = new byte [(int ) new File (filePath ).length ()];
131+ fileInputStream .read (content );
132+ String img = Base64 .getEncoder ().encodeToString (content );
133+ return String .format ("data:image/png;base64,%s" , img );
136134 } catch (IOException e ) {
137- error (e );
135+ error (e );
138136 }
139137 return null ;
140138 }
0 commit comments