ultralytics / yolov5

YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
49.73k stars 16.12k forks source link

Android uses YOLOv5 segmentation #13056

Closed fsamekl closed 2 months ago

fsamekl commented 3 months ago

Search before asking

Question

I would like to ask how to use YOLOv5 segmentation on Android. The segmentation model I trained, but I don't know how to use it. Can you please tell me how to use NCNN and how to use TFlite? It would be even better if there are sample project tutorials available, https://github.com/FeiGeChuanShu/yolov5-seg-ncnn The NCNN version of this project recognized it, but when I used my model, I encountered an error and crashed. I was trapped and had no idea.Please tell me, I love you

Additional

No response

glenn-jocher commented 3 months ago

@fsamekl hello!

Thanks for reaching out with your question about deploying YOLOv5 segmentation models on Android. It's great to see your enthusiasm for using YOLOv5! 🚀

For deploying your trained segmentation model on Android using NCNN or TFLite, here are a few steps and tips:

  1. NCNN:

    • Ensure your model is correctly converted to the NCNN format. The conversion process can sometimes introduce issues, so double-check this step.
    • For a crash with your custom model, it's often helpful to look at the log output for any specific error messages. This can provide clues about what might be going wrong.
    • You can refer to the NCNN GitHub repository for detailed instructions and examples on deploying models: NCNN GitHub
  2. TFLite:

    • Convert your PyTorch model to ONNX and then to TensorFlow's SavedModel before converting to TFLite format. Each step should be verified to ensure the model behaves as expected.
    • Google's TFLite guide provides a comprehensive tutorial on using TFLite models on Android: TensorFlow Lite guide

Unfortunately, we don't have specific sample projects for YOLOv5 segmentation on Android, but the general process for deploying inference models should be similar to what's described above.

If you continue to experience issues, please provide more detailed error logs or descriptions of the problem, and we'll do our best to assist you further.

Keep up the great work, and don't hesitate to reach out with more questions! 🌟

nihui commented 3 months ago

https://github.com/FeiGeChuanShu/yolov5-seg-ncnn

glenn-jocher commented 3 months ago

@nihui hello!

Thank you for sharing the link. If you're encountering issues with your model when using the project from the provided link, I recommend checking the model conversion steps and ensuring compatibility with NCNN. Also, reviewing the error logs can provide specific insights into what might be causing the crash.

If you need further assistance, please provide more details about the error you're encountering, and we'll be happy to help!

github-actions[bot] commented 2 months ago

👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.

For additional resources and information, please see the links below:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLO 🚀 and Vision AI ⭐