mirror of
https://github.com/TimeCrafters/FTC_2022
synced 2025-12-15 17:52:34 +00:00
Worked on Custom tensor flow model and had programmed it and had found that it would always be over 75% sure that there was always a steve even if the cone was out of frame and it would occasionally look and find that there was the team banner image from the website. but then i tested it with the pre programmed tensors and it could easily figure out which image was being shown. must train the computer better with different images as well that are even more distinctable. but i succesfully trained it something and implemented it, so partial success
This commit is contained in:
@@ -21,6 +21,14 @@ android {
|
||||
targetCompatibility JavaVersion.VERSION_1_7
|
||||
}
|
||||
namespace = 'com.qualcomm.ftcrobotcontroller'
|
||||
buildFeatures {
|
||||
mlModelBinding true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'org.tensorflow:tensorflow-lite-metadata:0.1.0'
|
||||
implementation 'org.tensorflow:tensorflow-lite-gpu:2.3.0'
|
||||
}
|
||||
|
||||
apply from: '../build.dependencies.gradle'
|
||||
|
||||
@@ -50,7 +50,7 @@ import org.firstinspires.ftc.robotcore.external.tfod.Recognition;
|
||||
* is explained below.
|
||||
*/
|
||||
@TeleOp(name = "Concept: TensorFlow Object Detection Webcam", group = "Concept")
|
||||
@Disabled
|
||||
//@Disabled
|
||||
public class ConceptTensorFlowObjectDetectionWebcam extends LinearOpMode {
|
||||
|
||||
/*
|
||||
@@ -60,8 +60,10 @@ public class ConceptTensorFlowObjectDetectionWebcam extends LinearOpMode {
|
||||
* has been downloaded to the Robot Controller's SD FLASH memory, it must to be loaded using loadModelFromFile()
|
||||
* Here we assume it's an Asset. Also see method initTfod() below .
|
||||
*/
|
||||
// private static final String TFOD_MODEL_ASSET = "model_20221009_154335.tflite";
|
||||
private static final String TFOD_MODEL_ASSET = "PowerPlay.tflite";
|
||||
// private static final String TFOD_MODEL_FILE = "/sdcard/FIRST/tflitemodels/CustomTeamModel.tflite";
|
||||
|
||||
// private static final String TFOD_MODEL_FILE = "/sdcard/FIRST/tflitemodels/CustomTeamModel.tflite";
|
||||
|
||||
|
||||
private static final String[] LABELS = {
|
||||
@@ -83,7 +85,7 @@ public class ConceptTensorFlowObjectDetectionWebcam extends LinearOpMode {
|
||||
* and paste it in to your code on the next line, between the double quotes.
|
||||
*/
|
||||
private static final String VUFORIA_KEY =
|
||||
" -- YOUR NEW VUFORIA KEY GOES HERE --- ";
|
||||
"Abmu1jv/////AAABmYzrcgDEi014nv+wD6PkEPVnOlV2pI3S9sGUMMR/X7hF72x20rP1JcVtsU0nI6VK0yUlYbCSA2k+yMo4hQmPDBvrqeqAgXKa57ilPhW5e1cB3BEevP+9VoJ9QYFhKA3JJTiuFS50WQeuFy3dp0gOPoqHL3XClRFZWbhzihyNnLXgXlKiq+i5GbfONECucQU2DgiuuxYlCaeNdUHl1X5C2pO80zZ6y7PYAp3p0ciXJxqfBoVAklhd69avaAE5Z84ctKscvcbxCS16lq81X7XgIFjshLoD/vpWa300llDG83+Y777q7b5v7gsUCZ6FiuK152Rd272HLuBRhoTXAt0ug9Baq5cz3sn0sAIEzSHX1nah";
|
||||
|
||||
/**
|
||||
* {@link #vuforia} is the variable we will use to store our instance of the Vuforia
|
||||
@@ -185,6 +187,6 @@ public class ConceptTensorFlowObjectDetectionWebcam extends LinearOpMode {
|
||||
// Use loadModelFromAsset() if the TF Model is built in as an asset by Android Studio
|
||||
// Use loadModelFromFile() if you have downloaded a custom team model to the Robot Controller's FLASH.
|
||||
tfod.loadModelFromAsset(TFOD_MODEL_ASSET, LABELS);
|
||||
// tfod.loadModelFromFile(TFOD_MODEL_FILE, LABELS);
|
||||
// tfod.loadModelFromFile(TFOD_MODEL_FILE, LABELS);
|
||||
}
|
||||
}
|
||||
|
||||
BIN
FtcRobotController/src/main/ml/model_20221009_154335.tflite
Normal file
BIN
FtcRobotController/src/main/ml/model_20221009_154335.tflite
Normal file
Binary file not shown.
Reference in New Issue
Block a user