forked from Rowland-Hall-Iron-Lions/ARC-Freight-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request FIRST-Tech-Challenge#77 from IsaccBarker/milobanks…
…/integrate-base-tensorflow Basic tensorflow implementation
- Loading branch information
Showing
3 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
TeamCode/src/main/java/org/rowlandhall/arc/autonomous/detection/ObjectDetection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.rowlandhall.arc.detection; | ||
|
||
import org.tensorflow.lite.Interpreter; | ||
|
||
import java.util.Map; | ||
import java.util.HashMap; | ||
import java.io.File; | ||
|
||
public class ObjectDetection { | ||
Interpreter interpreter; | ||
Map<String, Object> inputs = new HashMap<>(); | ||
Map<String, Object> outputs = new HashMap<>(); | ||
|
||
public ObjectDetection() { | ||
File model = new File("future_model_location.tflite"); | ||
interpreter = new Interpreter(model); | ||
} | ||
|
||
public void run(long[] frame) { | ||
inputs.put("frame", frame); | ||
|
||
// TODO: Figure out what these outputs should be | ||
// TODO: after we train the model. | ||
|
||
interpreter.runSignature(inputs, outputs); | ||
} | ||
|
||
// NOTE: This will be finished after we, again, figure out | ||
// NOTE: what the outputs should be. | ||
/* public UNKNOWN get_detected_boundaries() { | ||
// Query the output map | ||
} */ | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters