Commit 71e4af9
Github Executorch
Upgrade to Yolov26 from Yolov8
1. Fixed memory management (BirdDetectionActivity.java)
- Added proper cleanup in onDestroy() to call birdPipeline.close() which destroys both YOLO and classifier models
- Fixed variable naming from detectionPipeline to birdPipeline throughout
2. Fixed YOLOv26 detection (BirdDetectionPipeline.java)
- Added auto-detection of YOLO version based on output size (1800 = YOLOv26, 705600 = YOLOv8)
- Added new parseYoloV26Output() method to handle YOLOv26's format: [x1, y1, x2, y2, confidence, class] × 300 detections
- Kept backward compatibility with YOLOv8 by extracting original logic into parseYoloV8Output()
3. Fixed memory leak and cleanup
- Added proper cleanup in onDestroy() to call birdPipeline.close() which destroys both YOLO and classifier models
- Root cause of OOM crash: The app was never releasing the models, causing them to accumulate in memory with each frame1 parent ba020ee commit 71e4af9
2 files changed
Lines changed: 160 additions & 130 deletions
File tree
- Yolo/android/app/src/main/java/com/example/executorchyolodemo
Lines changed: 22 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | | - | |
106 | | - | |
107 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
108 | 118 | | |
109 | | - | |
| 119 | + | |
110 | 120 | | |
111 | 121 | | |
112 | 122 | | |
113 | 123 | | |
114 | 124 | | |
115 | 125 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
122 | 133 | | |
123 | 134 | | |
124 | 135 | | |
| |||
438 | 449 | | |
439 | 450 | | |
440 | 451 | | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | 452 | | |
0 commit comments