-
Notifications
You must be signed in to change notification settings - Fork 29
Add whisper and parakeet to build list #211
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
Changes from 14 commits
1f520f1
a777abd
624c84b
f9b1b3e
a7ce8d7
dfce255
5695b7d
d72b1ea
dd0c964
f2fde90
d3ce4a6
baad8f0
9d89d87
0ed3f8a
f690fed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -97,30 +97,6 @@ protected void onCreate(Bundle savedInstanceState) { | |
| } | ||
| } | ||
|
Comment on lines
80
to
98
|
||
|
|
||
| @Override | ||
| protected void onDestroy() { | ||
| super.onDestroy(); | ||
|
|
||
| // Clean up the detection pipeline | ||
| if (detectionPipeline != null) { | ||
| detectionPipeline.close(); | ||
| detectionPipeline = null; | ||
| } | ||
|
|
||
| Log.d(TAG, "BirdDetectionActivity destroyed"); | ||
| } | ||
|
|
||
| @Override | ||
| protected void onPause() { | ||
| super.onPause(); | ||
|
|
||
| // Optional: Release resources when app goes to background | ||
| if (detectionPipeline != null) { | ||
| detectionPipeline.close(); | ||
| detectionPipeline = null; | ||
| } | ||
| } | ||
|
|
||
| private void initializeViews() { | ||
| previewView = findViewById(R.id.previewView); | ||
| overlayImageView = findViewById(R.id.overlayImageView); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -154,22 +154,19 @@ private void loadBirdSpeciesNames(Context context) throws IOException { | |
| public List<BirdDetection> detectBirds(Bitmap bitmap) { | ||
| List<BirdDetection> results = new ArrayList<>(); | ||
| frameCounter++; | ||
|
|
||
| Tensor yoloInput = null; | ||
| EValue[] yoloOutputs = null; | ||
|
|
||
|
|
||
| try { | ||
| // Cleanup old detection history every 30 frames | ||
| if (frameCounter % 30 == 0) { | ||
| cleanupOldDetections(); | ||
| } | ||
| yoloInput = preprocessForYolo(bitmap); | ||
|
|
||
| Tensor yoloInput = preprocessForYolo(bitmap); | ||
| if (yoloInput == null) { | ||
| return results; | ||
| } | ||
| yoloOutputs = yoloModule.forward(EValue.from(yoloInput)); | ||
|
|
||
| EValue[] yoloOutputs = yoloModule.forward(EValue.from(yoloInput)); | ||
| if (yoloOutputs == null || yoloOutputs.length == 0) { | ||
| return results; | ||
|
||
| } | ||
|
|
@@ -240,29 +237,8 @@ public List<BirdDetection> detectBirds(Bitmap bitmap) { | |
|
|
||
| } catch (Exception e) { | ||
| Log.e(TAG, "Error in detectBirds", e); | ||
| } finally { | ||
| // CRITICAL: Release tensors to prevent memory leak | ||
| if (yoloInput != null) { | ||
| try { | ||
| yoloInput.close(); | ||
| } catch (Exception e) { | ||
| Log.e(TAG, "Error closing yoloInput", e); | ||
| } | ||
| } | ||
|
|
||
| if (yoloOutputs != null) { | ||
| for (EValue output : yoloOutputs) { | ||
| if (output != null) { | ||
| try { | ||
| output.close(); | ||
| } catch (Exception e) { | ||
| Log.e(TAG, "Error closing output", e); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| return results; | ||
| } | ||
|
|
||
|
|
@@ -596,19 +572,15 @@ private Tensor preprocessForClassifier(Bitmap bitmap) { | |
| } | ||
| } | ||
|
|
||
| private String[] classifyBird(Bitmap bitmap, RectF boundingBox) throws Exception { | ||
| Bitmap croppedBird = cropBitmap(bitmap, boundingBox); | ||
| if (croppedBird == null) { | ||
| return new String[]{"Bird", "0.5"}; | ||
| } | ||
|
|
||
| Tensor classifierInput = preprocessForClassifier(croppedBird); | ||
| private String classifyBird(Bitmap croppedBitmap) throws Exception { | ||
| Tensor classifierInput = preprocessForClassifier(croppedBitmap); | ||
| if (classifierInput == null) { | ||
| return new String[]{"Bird", "0.5"}; | ||
| return "Bird"; | ||
| } | ||
|
|
||
| EValue[] classifierOutputs = classifierModule.forward(EValue.from(classifierInput)); | ||
| return parseClassifierOutput(classifierOutputs); | ||
| String[] result = parseClassifierOutput(classifierOutputs); | ||
| return result[0]; | ||
|
||
| } | ||
|
|
||
| private String[] parseClassifierOutput(EValue[] outputs) { | ||
|
|
||
This file was deleted.
This file was deleted.
This file was deleted.
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.
The matrix marks Whisper/Parakeet as
require_aar: trueand then conditionally skips checkout/JDK/Gradle/build steps wheninputs.local_aaris not provided. This yields matrix jobs that do no work but still succeed, which can hide build regressions. Prefer a job-levelif:(or matrixexclude) to skip those entries entirely, or removerequire_aarif the Maven dependency fallback is sufficient.