-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Use exported .onnx model on QGIS "Deepness" plugin #350
Comments
👋 Hello @fredrikbacke92, thank you for raising an issue about Ultralytics HUB 🚀! Please visit our HUB Docs to learn more:
If this is a 🐛 Bug Report, please provide screenshots and steps to reproduce your problem to help us get started working on a fix. If this is a ❓ Question, please provide as much information as possible, including dataset, model, environment details etc. so that we might provide the most helpful response. We try to respond to all issues as promptly as possible. Thank you for your patience! |
@fredrikbacke92 hello, and thank you for bringing this to our attention! From what you've described, it appears you're experiencing an issue with the exported ONNX model when using it with the QGIS "Deepness" plugin. The problem arises when the generated polygon layers or 'channels' become too numerous, leading to a memory overflow and consequently making QGIS crash. In comparing the .onnx models, it sounds like the key difference is the number of classes they are trained to recognize. The model included in the plugin, which is working as expected, is trained to detect only a single class - 'car'. This means it exclusively creates polygon layers for this one class, hence only one channel is generated. On the other hand, when exporting models with the Ultralytics HUB, they will by default be trained to detect numerous classes based on the COCO dataset. This expanded class detection is likely leading to the creation of many polygon layers, or 'channels', thereby exceeding the memory on QGIS and causing it to crash. To resolve this, one possible solution would be to re-train your model to detect only the specific classes you are interested in. This would reduce the number of channels, and we expect it would prevent the memory overload for QGIS. You could perform your training with a dataset that contains only your desired classes to ensure the model will only generate the corresponding channels. I hope this helps guide you in investigating and addressing this issue. If you have any further queries or need further clarification, please do not hesitate to reach out! We're here to help, and appreciate you being part of the Ultralytics and YOLO community. |
Thanks you for the answer! I should mention i use roboflow for annotation then use the API to train model on ultralytics. So far i've tried instance segmentation and object detection project (you choose before annotating), so i've tried 2 datasets. Both of these i've only annotated one class, "tree". I've used magic select in roboflow, but when seeing the preview is converts to bounding boxes so i dont know i that would be a problem. I tried training a new model without COCO pretraining. Used the object detection dataset and YOLOv8m. The only difference when trying this in QGIS was that it didn't visually generate layers in the layers tab. But it still crashes and you can see all channels still remain in the plugin options. |
Solved! There was some compatible issue that was solved by the creator of deepness. See link. PUTvision/qgis-plugin-deepness#101 (reply in thread) This workflow now works if you install fixed version of deepness provided in the linked thread. |
Hello @fredrikbacke92, I'm really glad to hear that you were able to resolve the issue with the help of deepness' creator! Updates and patches like the one you've applied are crucial in maintaining compatibility and performance across different software and plugins. They enable us to continue our work smoothly and effectively. Now, the workflow with the updated version of the deepness plugin is performing as expected on your end, which is fantastic news. Thank you for sharing this resolution back to the Ultralytics and YOLO community. It might help others who are facing a similar issue. Also, I'd like to extend our gratitude towards the creator of the deepness plugin for their fast response and solution. This is a great example of the open-source community working together to solve problems and improve the ecosystem. Feel free to reach out if you have any more questions or need further assistance. We're always here to help! |
Search before asking
Question
When running the plugin with exported model it generates a massive amount of 'channels' (polygon layers) causing QGIS to crash, due to running out of memory. I've tried a included .onnx model which only generate 1 channel which is the class 'car' and that works without problems. I've uploaded to models to netron.app, hopefully that helps.
Exported ultralytics model .onnx (Full graph)
![model properties](https://private-user-images.githubusercontent.com/141426274/258593825-30355857-e6a1-4f40-9641-963eb24305e3.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAyNDQ1NDcsIm5iZiI6MTcyMDI0NDI0NywicGF0aCI6Ii8xNDE0MjYyNzQvMjU4NTkzODI1LTMwMzU1ODU3LWU2YTEtNGY0MC05NjQxLTk2M2ViMjQzMDVlMy5qcGc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzA2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwNlQwNTM3MjdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT05Njc0MDNmOTU2NWQyY2JjMmU1YzQ1Y2Y0Mzc1NDE1MjdlMzAxOWMzNDE0MzEwMThjZWUwMmJiZWViYzFiMDQyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.4tBqFNzBx0Lqy79NALcShsv4Zz4HAfY-gAeDJUqsFXM)
Included model in plugin .onnx (Full graph)
![model2 properties](https://private-user-images.githubusercontent.com/141426274/258593888-a2517c23-fd0e-4951-9d32-f09c4e468be5.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAyNDQ1NDcsIm5iZiI6MTcyMDI0NDI0NywicGF0aCI6Ii8xNDE0MjYyNzQvMjU4NTkzODg4LWEyNTE3YzIzLWZkMGUtNDk1MS05ZDMyLWYwOWM0ZTQ2OGJlNS5qcGc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzA2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwNlQwNTM3MjdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yMTU2OWY2MWJjYTg3ZTdiZDRmNzkxODIwM2YzNjEwMGQ2NzIzMWJiYzJiZGQwZGY3MWRlODM0NWIyODgzMWI5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.-X1JLg9vX52UkHYffuJXPK-ryYAvDxsjo2k483FNBWY)
Cheers!
Additional
No response
The text was updated successfully, but these errors were encountered: