Skip to content
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

Object Detection different results in Flutter App and Python #92

Open
umar12Fa opened this issue Feb 3, 2025 · 2 comments
Open

Object Detection different results in Flutter App and Python #92

umar12Fa opened this issue Feb 3, 2025 · 2 comments
Labels
detect Object Detection issues, PR's question Further information is requested

Comments

@umar12Fa
Copy link

umar12Fa commented Feb 3, 2025

I'm getting 30 objects in flutter mobile app where in python for same image and model I'm getting 198 objects. What could be the reason of it?

Image

Image

@UltralyticsAssistant UltralyticsAssistant added detect Object Detection issues, PR's question Further information is requested labels Feb 3, 2025
@UltralyticsAssistant
Copy link
Member

👋 Hello @umar12Fa, thank you for submitting a ultralytics/yolo-flutter-app 🚀 Issue. To help us address your concern efficiently, please ensure you've provided the following information:

  1. For bug reports:

    • A detailed and clear description of the issue you're facing (you've already shared a great start—thank you!)
    • A minimum reproducible example MRE that demonstrates the discrepancy between the Flutter app and Python results
    • Your environment details (Flutter/Dart version, Python version, OS, package versions, model type and version, etc.)
    • Expected behavior vs. actual behavior
    • Any additional error messages, logs, or specific details that might help us debug this issue
  2. For feature requests:

    • A clear and concise description of the proposed feature
    • The problem this feature would solve
    • Any alternative solutions you've considered
  3. For questions:

    • Provide as much context as possible about your question
    • Include any research you've already done on the topic
    • Specify which parts of the documentation, if any, you've already consulted

In this case, I suggest checking the version of the YOLO model running in your Python code vs. the Flutter app, as well as any potential differences in confidence thresholds, non-maximal suppression (NMS) parameters, or other inference settings.

Please ensure you've searched existing issues to avoid duplicates. If you need to add any additional information, feel free to comment below. An Ultralytics engineer will assist you soon! 🔍

Thank you for your contribution to improving our project! 🌟

@pderrenger
Copy link
Member

@umar12Fa thank you for reporting this discrepancy. The difference in detection counts between environments could stem from several factors:

  1. Preprocessing differences: Verify that both implementations use identical image resizing, normalization, and padding (check imgsz parameter)
  2. Postprocessing thresholds: Ensure matching confidence (conf) and IoU (iou) thresholds in both environments
  3. Runtime environment: Confirm consistent inference settings (FP32/FP16 precision, etc.)

We recommend first comparing your threshold values and preprocessing steps against the Python implementation shown in our Inference API documentation. If the issue persists, please share:

  • YOLO version (ultralytics.__version__)
  • Exact inference code used in both environments
  • Complete reproduction steps

This will help us investigate further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
detect Object Detection issues, PR's question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants