Open MyriamIhab opened 5 months ago
hello! Thank you for using my plugin.
This problem occurs because the plug-in was created to be used as in the example video.
To solve this problem
It must be quite a cumbersome task. sorry. It's my fault.
We will add an orientation option as time allows.
I don't understand how to implement the solution as you suggested. However, I managed to resolve the issue by adjusting some parameters in the "YoloRealTimeView" widget class (in the "yolo_realtime_view.dart" file), and it now works correctly in landscape orientation. Here are the updated parameters:
final rectX = x * screenWidth;
final rectY = screenHeight - ((y + height) * screenHeight);
final rectWidth = width * screenWidth;
final rectHeight = height * screenHeight;
You may consider incorporating these changes into future versions of the package to support landscape orientation effectively. I appreciate the package's functionality; it has been incredibly helpful. Thank you.
I'm really glad it helped.
I will use the code you suggested in the next modification. thank you!!
@spring98 I found your wonderful plugin in the early hours of today, cloned the example app, tested and it works fine. I have been struggling to get a decent package like yours that support both ios and android. tflite_flutter simply doesn't work for me and everything around model ingestion is a pain in the butt. Though, I have not yet tested this awesome implementation of yours on my custom model, I want to simply send out my thank you note and good wishes for taking time to work on this. You a gem!
@MyriamIhab thanks for sharing your improvement, with a little conditional statements and the magic of mediaQuery.of.(context).orientatation. We can correctly draw the boxes based on the orientation of the devices. I have not yet tested your implementation, but I know for sure, its going to be a good one. Thanks for sharing friend :-)
When portrait orientation is used the boxes are drawn correctly around the detceted object (of cource while holding the mobile horizontally like the example's video), but when I enforce lanescape orientation to the page boxes are drawn beside the objects (not around them) and their length and width are inverted. How can this be adjusted?![cupdetection](https://github.com/spring98/flutter-yolo-realtime-plugin/assets/127784725/37aff410-10c3-453e-8245-3d34295b1a7f)