ultralytics / yolo-flutter-app

A Flutter plugin for Ultralytics YOLO computer vision models
https://ultralytics.com
GNU Affero General Public License v3.0
77 stars 32 forks source link

model seems like loaded but nothing on the screen after some bugs #65

Open Jaemani opened 1 day ago

Jaemani commented 1 day ago

preinstall, bug fixed run terminal at yolo-flutter-app/example. required flutter create, ran it.

  1. win32 version caused error, clean cache&flutter get+ flutter pub upgrade win32 not worked, manually upgraded from 3.1.4 to 5.6.0. solved it.

  2. flutter minimum required kotlin > 1.7.0, but now 1.5.10 changed to "ext.kotlin_version = '1.7.10'".

  3. requierd compileSdkVersion 34, so changed compileSdkVersion 33 to 34

  4. transforms-3/...transformed/jetified-core-ktx-1.13.1-api.jar!/META-INF/core-ktx_release.kotlin_module metadata is 1.8.0, expected 1.5.1 changed back to "ext.kotlin_version = '1.5.10'". and flutter required 1.7.10 again. so fix again to "ext.kotlin_version = '1.7.10'"

android build successful. uncomment the object detector, and choosed builted-in .tflite model. Not working, it was black when it is asking about permission, but only white blank screen after request permission. when click button just show 1,0,1,0 at terminal.

macOS & iOS simulator build successful. uncomment the object detector, and choosed builted-in .mlmodel model. Not working, only white screen after request permission.

also added loading placeholder code as github page, but no any letters shown, only blank white screen.

loadingPlaceholder: const Center(
                                    child: Wrap(
                                      direction: Axis.vertical,
                                      crossAxisAlignment:
                                          WrapCrossAlignment.center,
                                      children: [
                                        CircularProgressIndicator(
                                          color: Colors.white,
                                          strokeWidth: 2,
                                        ),
                                        SizedBox(height: 20),
                                        Text(
                                          'Loading model...',
                                          style: TextStyle(
                                            fontStyle: FontStyle.italic,
                                            fontSize: 14,
                                          ),
                                        ),
                                      ],
                                    ),
                                  )

Performing hot reload...
Reloaded 0 libraries in 333ms (compile: 21 ms, reload: 0 ms, reassemble: 77 ms). I/ViewRootImpl@aba3422MainActivity: MSG_WINDOW_FOCUS_CHANGED 0 0 I/ViewRootImpl@aba3422MainActivity: stopped(false) old = false I/DecorView(20421): notifyKeepScreenOnChanged: keepScreenOn=false I/MSHandlerLifeCycle(20421): removeMultiSplitHandler: no exist. decor=DecorView@60f07b1[MainActivity] I/ViewRootImpl@aba3422MainActivity: performTraversals params={(0,0)(fillxfill) sim={adjust=resize forwardNavigation} ty=BASE_APPLICATION fmt=TRANSLUCENT wanim=0x1030001 I/ViewRootImpl@aba3422MainActivity: fl=81810100 I/ViewRootImpl@aba3422MainActivity: pfl=12020040 I/ViewRootImpl@aba3422MainActivity: vsysui=500 I/ViewRootImpl@aba3422MainActivity: bhv=DEFAULT I/ViewRootImpl@aba3422MainActivity: fitSides= naviIconColor=0 I/ViewRootImpl@aba3422MainActivity: sfl=100000} I/ViewRootImpl@aba3422MainActivity: performTraversals mFirst=false windowShouldResize=false viewVisibilityChanged=false mForceNextWindowRelayout=false params={(0,0)(fillxfill) sim={adjust=resize forwardNavigation} ty=BASE_APPLICATION fmt=TRANSLUCENT wanim=0x1030001 I/ViewRootImpl@aba3422MainActivity: fl=81810100 I/ViewRootImpl@aba3422MainActivity: pfl=12020040 I/ViewRootImpl@aba3422MainActivity: vsysui=500 I/ViewRootImpl@aba3422MainActivity: bhv=DEFAULT I/ViewRootImpl@aba3422MainActivity: fitSides= naviIconColor=0 I/ViewRootImpl@aba3422MainActivity: sfl=100000} I/ViewRootImpl@aba3422MainActivity: updateBlastSurfaceIfNeeded mBlastBufferQueue=0xb4000076015deff0 isSameSurfaceControl=true I/BLASTBufferQueue(20421): update, w= 1080 h= 2316 mName = ViewRootImpl@aba3422[MainActivity] mNativeObject= 0xb4000076015deff0 sc.mNativeObject= 0xb40000759161f950 format= -3 caller= android.view.ViewRootImpl.updateBlastSurfaceIfNeeded:2898 android.view.ViewRootImpl.relayoutWindow:9847 android.view.ViewRootImpl.performTraversals:3884 android.view.ViewRootImpl.doTraversal:3116 android.view.ViewRootImpl$TraversalRunnable.run:10885 android.view.Choreographer$CallbackRecord.run:1301 I/ViewRootImpl@aba3422MainActivity: Relayout returned: old=(0,0,1080,2316) new=(0,0,1080,2316) req=(1080,2316)0 dur=8 res=0x0 s={true 0xb400007691649b50} ch=false seqId=0 I/ViewRootImpl@aba3422MainActivity: updateBoundsLayer: t = android.view.SurfaceControl$Transaction@bf9e8da sc = Surface(name=Bounds for - com.ultralytics.ultralytics_yolo_example/com.ultralytics.ultralytics_yolo_example.MainActivity@0)/@0xf6c10b frame = 2 I/ViewRootImpl@aba3422MainActivity: mWNT: t=0xb4000075c15efdf0 mBlastBufferQueue=0xb4000076015deff0 fn= 2 caller= android.view.ViewRootImpl.prepareSurfaces:2985 android.view.ViewRootImpl.performTraversals:4233 android.view.ViewRootImpl.doTraversal:3116 I/ViewRootImpl@aba3422MainActivity: MSG_WINDOW_FOCUS_CHANGED 1 0 I/ViewRootImpl@aba3422MainActivity: mThreadedRenderer.initializeIfNeeded()#2 mSurface={isValid=true 0xb400007691649b50} D/InputMethodManager(20421): startInputInner - Id : 0 I/InputMethodManager(20421): startInputInner - mService.startInputOrWindowGainedFocus

pderrenger commented 1 day ago

@Jaemani it seems like you're encountering issues with the app displaying a blank screen after loading the model. Please ensure you're using the latest version of the Ultralytics package and verify that all dependencies are correctly updated. If the issue persists, consider checking the permissions and reviewing the logs for any additional errors. For further assistance, you can explore our documentation at https://docs.ultralytics.com. If you have more questions, feel free to ask!

Jaemani commented 1 day ago

@pderrenger Hi, thanks, could you tell me how to check all dependencies are correctly updated?

I did try this.

flutter pub deps at the root of project: Dart SDK 3.5.3 Flutter SDK 3.24.3 ultralytics_yolo 0.0.3 ├── flutter 0.0.0 │ ├── characters 1.3.0 │ ├── collection 1.18.0 │ ├── material_color_utilities 0.11.1 │ │ └── collection... │ ├── meta 1.15.0 │ ├── sky_engine 0.0.99 │ └── vector_math 2.1.4 ├── flutter_test 0.0.0 │ ├── async 2.11.0 │ │ ├── collection... │ │ └── meta... │ ├── boolean_selector 2.1.1 │ │ ├── source_span... │ │ └── string_scanner... │ ├── clock 1.1.1 │ ├── fake_async 1.3.1 │ │ ├── clock... │ │ └── collection... │ ├── leak_tracker 10.0.5 │ │ ├── clock... │ │ ├── collection... │ │ ├── meta... │ │ ├── path... │ │ └── vm_service... │ ├── leak_tracker_flutter_testing 3.0.5 │ │ ├── flutter... │ │ ├── leak_tracker... │ │ ├── leak_tracker_testing... │ │ ├── matcher... │ │ └── meta... │ ├── leak_tracker_testing 3.0.1 │ │ ├── leak_tracker... │ │ ├── matcher... │ │ └── meta... │ ├── matcher 0.12.16+1 │ │ ├── async... │ │ ├── meta... │ │ ├── stack_trace... │ │ ├── term_glyph... │ │ └── test_api... │ ├── path 1.9.0 │ ├── source_span 1.10.0 │ │ ├── collection... │ │ ├── path... │ │ └── term_glyph... │ ├── stack_trace 1.11.1 │ │ └── path... │ ├── stream_channel 2.1.2 │ │ └── async... │ ├── string_scanner 1.2.0 │ │ └── source_span... │ ├── term_glyph 1.2.1 │ ├── test_api 0.7.2 │ │ ├── async... │ │ ├── boolean_selector... │ │ ├── collection... │ │ ├── meta... │ │ ├── source_span... │ │ ├── stack_trace... │ │ ├── stream_channel... │ │ ├── string_scanner... │ │ └── term_glyph... │ ├── vm_service 14.2.5 │ ├── characters... │ ├── collection... │ ├── flutter... │ ├── material_color_utilities... │ ├── meta... │ └── vector_math... ├── plugin_platform_interface 2.1.8 │ └── meta... └── very_good_analysis 5.1.0

and flutter pub upgrade got this: No dependencies changed. 10 packages have newer versions incompatible with dependency constraints.

flutter pub deps at the /example of project: Dart SDK 3.5.3 Flutter SDK 3.24.3 ultralytics_yolo_example 0.0.0 ├── flutter 0.0.0 │ ├── characters 1.3.0 │ ├── collection 1.18.0 │ ├── material_color_utilities 0.11.1 │ │ └── collection... │ ├── meta 1.15.0 │ ├── sky_engine 0.0.99 │ └── vector_math 2.1.4 ├── flutter_lints 2.0.3 │ └── lints 2.1.1 ├── flutter_test 0.0.0 │ ├── async 2.11.0 │ │ ├── collection... │ │ └── meta... │ ├── boolean_selector 2.1.1 │ │ ├── source_span... │ │ └── string_scanner... │ ├── clock 1.1.1 │ ├── fake_async 1.3.1 │ │ ├── clock... │ │ └── collection... │ ├── leak_tracker 10.0.5 │ │ ├── clock... │ │ ├── collection... │ │ ├── meta... │ │ ├── path... │ │ └── vm_service... │ ├── leak_tracker_flutter_testing 3.0.5 │ │ ├── flutter... │ │ ├── leak_tracker... │ │ ├── leak_tracker_testing... │ │ ├── matcher... │ │ └── meta... │ ├── leak_tracker_testing 3.0.1 │ │ ├── leak_tracker... │ │ ├── matcher... │ │ └── meta... │ ├── matcher 0.12.16+1 │ │ ├── async... │ │ ├── meta... │ │ ├── stack_trace... │ │ ├── term_glyph... │ │ └── test_api... │ ├── source_span 1.10.0 │ │ ├── collection... │ │ ├── path... │ │ └── term_glyph... │ ├── stack_trace 1.11.1 │ │ └── path... │ ├── stream_channel 2.1.2 │ │ └── async... │ ├── string_scanner 1.2.0 │ │ └── source_span... │ ├── term_glyph 1.2.1 │ ├── test_api 0.7.2 │ │ ├── async... │ │ ├── boolean_selector... │ │ ├── collection... │ │ ├── meta... │ │ ├── source_span... │ │ ├── stack_trace... │ │ ├── stream_channel... │ │ ├── string_scanner... │ │ └── term_glyph... │ ├── vm_service 14.2.5 │ ├── characters... │ ├── collection... │ ├── flutter... │ ├── material_color_utilities... │ ├── meta... │ ├── path... │ └── vector_math... ├── path 1.9.0 ├── path_provider 2.1.4 │ ├── path_provider_android 2.2.12 │ │ ├── flutter... │ │ └── path_provider_platform_interface... │ ├── path_provider_foundation 2.4.0 │ │ ├── flutter... │ │ └── path_provider_platform_interface... │ ├── path_provider_linux 2.2.1 │ │ ├── xdg_directories 1.1.0 │ │ │ ├── meta... │ │ │ └── path... │ │ ├── ffi... │ │ ├── flutter... │ │ ├── path... │ │ └── path_provider_platform_interface... │ ├── path_provider_platform_interface 2.1.2 │ │ ├── platform 3.1.5 │ │ ├── flutter... │ │ └── plugin_platform_interface... │ ├── path_provider_windows 2.3.0 │ │ ├── ffi... │ │ ├── flutter... │ │ ├── path... │ │ └── path_provider_platform_interface... │ └── flutter... ├── permission_handler 10.4.5 │ ├── permission_handler_android 10.3.6 │ │ ├── flutter... │ │ └── permission_handler_platform_interface... │ ├── permission_handler_apple 9.1.4 │ │ ├── flutter... │ │ └── permission_handler_platform_interface... │ ├── permission_handler_platform_interface 3.12.0 │ │ ├── flutter... │ │ ├── meta... │ │ └── plugin_platform_interface... │ ├── permission_handler_windows 0.1.3 │ │ ├── flutter... │ │ └── permission_handler_platform_interface... │ ├── flutter... │ └── meta... ├── ultralytics_yolo 0.0.3 │ ├── plugin_platform_interface 2.1.8 │ │ └── meta... │ └── flutter... └── win32 5.6.0 └── ffi 2.1.3

got this when flutter pub upgrade No dependencies changed. 16 packages have newer versions incompatible with dependency constraints.

at first I couldn't get from flutter pub deps, so I tried sudo rm -Rf /Users/<username>/.pub-cache sudo rm -Rf .packages and flutter pub get

Jaemani commented 1 day ago

I'm just wondering that I don't know why I'm having problems even though I've clone from github and didn't touch anythinng

Jaemani commented 1 day ago

also tried on Windows OS, but got exactly same bugs, including this:

after changed to "ext.kotlin_version = '1.7.10'". got

.gradle/caches/transforms-3/0d01aa93113a93dc848bd76abf9dde3c/transformed/jetified-core-ktx-1.13.1-api.jar!/META-INF/core-ktx_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.5.1.

and then when changed back to "ext.kotlin_version = '1.5.10'" it suddenly compiled. but same black screen.

and flutter required 1.7.10 again. so fix again to "ext.kotlin_version = '1.7.10'"

all of the result and the flow are the same..

Jaemani commented 16 hours ago

Downgraded to flutter 3.22.0-stableand no 1~4 bug occurred ! but still same blank screen..

would you tell me if the SDK version was the problem, did I used correct flutter version?

pderrenger commented 13 hours ago

Please ensure you're using the latest version of the Ultralytics package and verify all dependencies are updated. If the issue persists, check the compatibility of your Flutter version with the package. For further guidance, visit our documentation at https://docs.ultralytics.com.