-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
162 prepare on device training #182
Conversation
…device-training-screen # Conflicts: # app/src/main/java/sensors_in_paradise/sonar/MainActivity.kt # app/src/main/java/sensors_in_paradise/sonar/screen_recording/RecordingMetadataStorage.kt # app/src/main/java/sensors_in_paradise/sonar/screen_recording/labels_editor/ClickableCarouselTextView.kt # app/src/main/java/sensors_in_paradise/sonar/screen_recording/labels_editor/EditableRecording.kt # app/src/main/java/sensors_in_paradise/sonar/screen_recording/labels_editor/IntervalLooper.kt # app/src/main/java/sensors_in_paradise/sonar/screen_recording/labels_editor/ItemClickableMotionLayout.kt # app/src/main/java/sensors_in_paradise/sonar/screen_recording/labels_editor/LabelTouchListener.kt # app/src/main/java/sensors_in_paradise/sonar/screen_recording/labels_editor/LabelsEditorDialog.kt # app/src/main/java/sensors_in_paradise/sonar/screen_recording/labels_editor/VideoViewHolder.kt # app/src/main/java/sensors_in_paradise/sonar/screen_recording/labels_editor/VisualSequenceViewHolder.kt
…o 161-support-multiple-models
…o 161-support-multiple-models
…o 161-support-multiple-models
…g-screen # Conflicts: # app/src/main/java/sensors_in_paradise/sonar/GlobalValues.kt # app/src/main/java/sensors_in_paradise/sonar/JSONStorage.kt # app/src/main/java/sensors_in_paradise/sonar/MainActivity.kt # app/src/main/java/sensors_in_paradise/sonar/PageInterface.kt # app/src/main/java/sensors_in_paradise/sonar/page2/RecordingDataManager.kt # app/src/main/java/sensors_in_paradise/sonar/screen_prediction/PredictionScreen.kt # app/src/main/java/sensors_in_paradise/sonar/screen_recording/RecordingScreen.kt
…o 161-support-multiple-models # Conflicts: # app/src/main/java/sensors_in_paradise/sonar/util/use_cases/UseCaseDialog.kt
…g-screen # Conflicts: # app/src/main/java/sensors_in_paradise/sonar/MainActivity.kt # app/src/main/java/sensors_in_paradise/sonar/screen_recording/RecordingScreen.kt
… in training screen and recording screen
# Conflicts: # app/build.gradle # app/src/main/java/sensors_in_paradise/sonar/GlobalValues.kt # app/src/main/java/sensors_in_paradise/sonar/screen_recording/CameraManager.kt # app/src/main/java/sensors_in_paradise/sonar/screen_recording/RecordingScreen.kt # app/src/main/java/sensors_in_paradise/sonar/screen_recording/camera/CameraManager.kt # app/src/main/java/sensors_in_paradise/sonar/screen_recording/camera/pose_estimation/ImageProcessor.kt # app/src/main/java/sensors_in_paradise/sonar/screen_recording/camera/pose_estimation/MoveNet.kt # app/src/main/java/sensors_in_paradise/sonar/screen_recording/camera/pose_estimation/PoseDetector.kt # app/src/main/java/sensors_in_paradise/sonar/screen_recording/camera/pose_estimation/PoseEstimationStorageManager.kt # app/src/main/java/sensors_in_paradise/sonar/screen_recording/camera/pose_estimation/VisualizationUtils.kt # app/src/main/java/sensors_in_paradise/sonar/screen_recording/camera/pose_estimation/data/BodyPart.kt # app/src/main/java/sensors_in_paradise/sonar/screen_recording/camera/pose_estimation/data/Device.kt # app/src/main/java/sensors_in_paradise/sonar/screen_recording/camera/pose_estimation/data/KeyPoint.kt # app/src/main/java/sensors_in_paradise/sonar/screen_recording/camera/pose_estimation/data/Person.kt # app/src/main/java/sensors_in_paradise/sonar/screen_recording/camera/pose_estimation/data/PoseSequence.kt # app/src/main/java/sensors_in_paradise/sonar/screen_recording/camera/pose_estimation/data/TorsoAndBodyDistance.kt # app/src/main/java/sensors_in_paradise/sonar/screen_recording/labels_editor/LabelsEditorDialog.kt # app/src/main/java/sensors_in_paradise/sonar/screen_recording/labels_editor/PoseSequenceViewHolder.kt # app/src/main/java/sensors_in_paradise/sonar/screen_recording/labels_editor/VisualSequenceViewHolder.kt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please review my comments, then I will make another review after being re-requested
Some are not necessary to change if there are arguments for it but all should definitely be looked at
@@ -90,5 +64,29 @@ class GlobalValues private constructor() { | |||
|
|||
return minutes.toString().padStart(2, '0') + ":" + seconds.toString().padStart(2, '0') | |||
} | |||
fun getMacAddress(): String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need the Device Mac Address for On Device Training? What is the benefit?
I saw the usage but I am not entirely sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get your point but I can imagine a situation where one would like to know on which device the model was trained and as it does no harm, I'd just keep it now
app/src/main/java/sensors_in_paradise/sonar/screen_prediction/PredictionScreen.kt
Show resolved
Hide resolved
@@ -217,17 +206,38 @@ class Page3Handler( | |||
predictionButton = activity.findViewById(R.id.button_start_predict) | |||
progressBar = activity.findViewById(R.id.progressBar_nextPrediction_predictionFragment) | |||
predictionButton.setOnClickListener { | |||
togglePrediction() | |||
if (currentUseCase.getModelFile().exists()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe you can use the function initModelFromUseCase with boolean return value to prevent a double check of the file
|
||
class TFLiteModel(tfLiteModelFile: File, inputShape: IntArray, outputSize: Int) { | ||
private val outputs = arrayOf(FloatArray(outputSize)) | ||
// TODO replace interpreter in PredictionScreen by this wrapper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please dont leave todos in commits that will get into the master branch rather turn them into issues
This seems to be done anyway
app/src/main/java/sensors_in_paradise/sonar/screen_recording/RecordingScreen.kt
Show resolved
Hide resolved
app/src/main/java/sensors_in_paradise/sonar/screen_recording/CategoryItemStorage.kt
Show resolved
Hide resolved
override fun onJSONInitialized() { | ||
} | ||
|
||
/*fun duplicateUseCaseData(originalTitle: String, duplicateTitle: String){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please no unused uncommented functions ;)
) | ||
} | ||
|
||
val dataSet = PieDataSet(entries, "Election Results") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Election results?
app/src/main/java/sensors_in_paradise/sonar/screen_train/TrainingScreen.kt
Show resolved
Hide resolved
return subDirs | ||
} | ||
|
||
fun saveModelFromBuffer(buffer: MappedByteBuffer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this pr now can be merged from my perspective
just make sure we have an old working branch for the lab please! (ask alex before pressing the green button)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just found a bug!
When you just start the app, record some sensors and start a recording without caring about use cases the app crashes.
Closes #162
![image](https://user-images.githubusercontent.com/29177177/166696667-7915183d-e5f4-4820-9d96-317825a36c01.png)
The user can now add new use cases via the usecasedialog:
Closes #163
![image](https://user-images.githubusercontent.com/29177177/166696943-42852ff3-ff65-4c55-bfc6-b493b7baed8f.png)
The user can now enable an on device training screen, which also displays a summary of recordings in the selected subdir of the current usecase
Foundation for #161