Skip to content

Commit

Permalink
Update CameraFragment.kt (#420)
Browse files Browse the repository at this point in the history
the fix was to update the onItemSelectedListener for spinnerModel. Instead of setting objectDetectorHelper.currentDelegate, we now directly set objectDetectorHelper.currentModel = p2. This ensures that when a new model is selected, the objectDetectorHelper actually uses the correct model for predictions, resolving the issue where results weren't updating.
  • Loading branch information
thebusted committed Jul 16, 2024
1 parent 88792a9 commit a07683d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class CameraFragment : Fragment(), ObjectDetectorHelper.DetectorListener {
p3: Long
) {
try {
objectDetectorHelper.currentDelegate = p2
objectDetectorHelper.currentModel = p2
updateControlsUi()
} catch(e: UninitializedPropertyAccessException) {
Log.e(TAG, "ObjectDetectorHelper has not been initialized yet.")
Expand Down

0 comments on commit a07683d

Please sign in to comment.