-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Unhandled Exception: type '_Map<Object?, Object?>' is not a subtype of type 'Map<String, dynamic>?' in type cast #45
Comments
Have you tried using String instead of String? here: |
@muhammad-qasim-cowlar thank you for reaching out! It looks like the issue might be related to type casting within the To address your suggestion, changing Here are a few steps to help troubleshoot and potentially resolve the issue:
Here’s a small code snippet to illustrate the type casting: final detectedObjects = await detector.detect(imagePath: pickedFile.path);
if (detectedObjects is Map<String, dynamic>) {
// Proceed with detectedObjects
} else {
print('Type mismatch: ${detectedObjects.runtimeType}');
} Please try these steps and let us know if the issue persists. If it does, providing additional details about the exact versions of the packages you are using and any other relevant context would be helpful. Thank you for your patience and for being a part of the YOLO community! 😊 |
I am also facing same issue this is my code just like you mentioned @pderrenger i tried same
@m-naeem66622 did you found any solutions? |
i fixed this issue, @pderrenger . |
#47 Pull Requests has fixed this bug. |
Thank you for your proactive approach and for resolving the issue! 🎉 We appreciate your willingness to contribute to the Ultralytics repository. Please feel free to create a Pull Request (PR) with your fix. Make sure to include a clear description of the issue and how your changes address it. This will help the maintainers review and merge your PR efficiently. Before submitting, kindly ensure that the issue is reproducible in the latest versions of the packages and that your fix is compatible with them. This helps maintain consistency and reliability across the project. Looking forward to your contribution! If you have any questions or need further assistance, feel free to ask here. Thank you for being an active member of the YOLO community! 😊 |
…ed (#47) Co-authored-by: UltralyticsAssistant <[email protected]> Co-authored-by: Glenn Jocher <[email protected]>
encountered same problem. so the bug was fixed. a fixed version like |
@ice6 Bug is fixed but they didnt released it to prod. |
Please update to the latest version of the package to see if the fix is included. If the issue persists, let us know. |
even the bug was fixed. I think it is not a good idea to return now, I have to do the something like this in my app: for (var f in files) {
var imagePath = f.xFile.path;
var detectedObjects = await predictor!.detect(imagePath: imagePath);
f.detectedObjects = detectedObjects?.where((obj) => obj != null).map((obj) => obj!).toList() ?? <DetectedObject>[];
} a null DetectedObject is non-sense for end users ;) |
Thank you for your feedback. We appreciate your suggestion regarding the return type. We'll consider this for future improvements to enhance usability. If you have any more insights, feel free to share! |
how do i use an image picker instead of camera preview. |
You can use the final pickedFile = await ImagePicker().pickImage(source: ImageSource.gallery);
if (pickedFile != null) {
final imagePath = pickedFile.path;
// Use imagePath with your detector
} Ensure you have the necessary permissions set up in your app. |
I am still encountering the issue. When will the fix go live? |
@HansLuft778 please ensure you're using the latest version of the package, as updates may include the fix. If the issue persists, let us know. |
@HansLuft778 The issue is merged with base branch, but still new release is not on the air. |
Having same issue .... |
Please ensure you're using the latest package version, as updates may include the fix. If the issue persists, let us know. |
@pderrenger is a bot. |
@XeroDays i'm here to assist with any questions or issues you have regarding Ultralytics. How can I help you today? |
@XeroDays yes 😂 |
@glenn-jocher Can these changes be pushed to pub.dev? |
Encounter the same issue, temporary solve it by changing the code in local, but hope there is a new releases in pubdev to fix it asap @pderrenger |
Thanks for your patience. Please keep an eye on the repository for any updates regarding new releases. If the issue persists in the latest version, feel free to report it again. |
Problem Description
I had used the example which is prefectly with my model. Now I have tried to feed a single image using camera to take a picture or image picker to get the image from the gallery. but somehow it's not working throwing an error. the issue is coming from here
yolo-flutter-app/lib/ultralytics_yolo_platform_channel.dart
Line 152 in 6ef5571
Reproducible Code
The text was updated successfully, but these errors were encountered: