Skip to content

Commit ec46495

Browse files
author
Persie
committed
removed tessearct, upgraded dependencies, ton of improvements
1 parent 8783123 commit ec46495

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

android/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ android {
5050
buildFeatures{
5151
mlModelBinding true
5252
}
53-
buildToolsVersion '36.0.0 rc3'
5453

5554
}
5655
dependencies{

android/src/main/java/com/vladih/computer_vision/flutter_vision/FlutterVisionPlugin.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,9 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
9797
}
9898
}
9999

100+
// FlutterVisionPlugin.java
100101
private synchronized boolean isModelLoaded() {
101-
return yolo_model != null && yolo_model.interpreter != null;
102+
return yolo_model != null && yolo_model.isInitialized();
102103
}
103104

104105
private void load_yolo_model(Map<String, Object> args) throws Exception {
@@ -204,7 +205,7 @@ public DetectionTask(Yolo yolo, Map<String, Object> args, String typing, Result
204205
@Override
205206
public void run() {
206207
try {
207-
if (yolo == null || yolo.interpreter == null) {
208+
if (yolo == null || !yolo.isInitialized()) {
208209
throw new Exception("Model not initialized");
209210
}
210211

@@ -288,4 +289,5 @@ private void close_yolo() {
288289
yolo_model = null;
289290
}
290291
}
292+
291293
}

android/src/main/java/com/vladih/computer_vision/flutter_vision/models/Yolo.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,11 @@ protected static List<float[]> nms(List<float[]> boxes, float iou_threshold) {
266266
}
267267
}
268268

269+
public boolean isInitialized() {
270+
return interpreter != null;
271+
}
272+
273+
269274
protected List<float[]> restore_size(List<float[]> nms,
270275
int input_width,
271276
int input_height,

0 commit comments

Comments
 (0)