Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@john-
Copy link

@john- john- commented Jun 22, 2025

This is a component to load an Ultralytics YOLO model and perform object detection with it.

The component browser entry should explain the usage. That said, I have not yet found a rendered version of the updated documentation.

There have been changes since the review branch was made. Most recently the exception error messages are now more descriptive. Also, if the component fails to load or there is a fatal error with yolo prediction the yolo objection detection is disabled.

@netlify
Copy link

netlify bot commented Jun 22, 2025

Deploy Preview for viseron canceled.

Name Link
🔨 Latest commit ebaf845
🔍 Latest deploy log https://app.netlify.com/projects/viseron/deploys/68629f5dec7e650008eb0afc

Copy link
Owner

@roflcoopter roflcoopter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments on the error handling that i think should be changed.

Otherwise everything looks good!

@roflcoopter
Copy link
Owner

If you want to check out the docs you can either use the Preview link created by Netlify or you can run the docs locally

@john-
Copy link
Author

john- commented Jun 23, 2025

Thanks for the comments I will update the PR.

@roflcoopter
Copy link
Owner

CI is failing due to the hosted agent running out of space when installing ultralytics and all the deps. Investigating

@john-
Copy link
Author

john- commented Jun 23, 2025

If you want to check out the docs you can either use the Preview link created by Netlify or you can run the docs locally

Thanks.

Where do I place the image for the component browser entry? I have /img/Ultralytics_YOLO_Logomark_Original.svg as the link but could not determine where to put it,

Ultralytics_YOLO_Logomark_Original

@john-
Copy link
Author

john- commented Jun 23, 2025

I forgot to mention that the version of the Ultralytics library I referenced doesn't have type hints. This is probably a the cause of failure of the mypy pre-commit check. For my workflow I need to use a couple of machines and the one I submit code doesn't have the pre-commit checks enabled so that is how it got submitted without passing.

I see in the last week there was an update that has type annotations in the library. I have not tested yet but can hold off on PR until that has been verified.

error:

viseron/components/yolo/object_detector.py:7: error: Skipping analyzing "ultralytics": module is installed, but missing library stubs or py.typed marker  [import-untyped]
viseron/components/yolo/object_detector.py:7: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 1 source file)

@roflcoopter
Copy link
Owner

If you want to check out the docs you can either use the Preview link created by Netlify or you can run the docs locally

Thanks.

Where do I place the image for the component browser entry? I have /img/Ultralytics_YOLO_Logomark_Original.svg as the link but could not determine where to put it,

Ultralytics_YOLO_Logomark_Original

Where did you find it? One option is to find a link to a hosted version and use that instead of commiting it to the repo

@roflcoopter
Copy link
Owner

I forgot to mention that the version of the Ultralytics library I referenced doesn't have type hints. This is probably a the cause of failure of the mypy pre-commit check. For my workflow I need to use a couple of machines and the one I submit code doesn't have the pre-commit checks enabled so that is how it got submitted without passing.

I see in the last week there was an update that has type annotations in the library. I have not tested yet but can hold off on PR until that has been verified.

error:

viseron/components/yolo/object_detector.py:7: error: Skipping analyzing "ultralytics": module is installed, but missing library stubs or py.typed marker  [import-untyped]
viseron/components/yolo/object_detector.py:7: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 1 source file)

I made some changes which should increase disk space available on the agent.
Can you rebase off of dev and push again?

@john-
Copy link
Author

john- commented Jun 23, 2025

Where did you find it? One option is to find a link to a hosted version and use that instead of commiting it to the repo

It was in a zip file I downloaded from here. However, on that page there is a preview image with a link to a svg on CDN. I will change to that.

@john- john- force-pushed the yolo_component_squashed branch from 8201443 to 75c2cf7 Compare June 23, 2025 14:58
@john-
Copy link
Author

john- commented Jun 23, 2025

I made some changes which should increase disk space available on the agent.
Can you rebase off of dev and push again?

I should re-squash into a new branch? Or should I leave the commits in existing branch?

@roflcoopter
Copy link
Owner

roflcoopter commented Jun 23, 2025

I made some changes which should increase disk space available on the agent.
Can you rebase off of dev and push again?

I should re-squash into a new branch? Or should I leave the commits in existing branch?

That is up to you! You either merge dev into your branch or rebase and force push.
You don't need to make a new branch.

Edit: ah I see you did that already. Will start the CI

@roflcoopter
Copy link
Owner

Hmm i cant get the CI to work. Need some more time to investigate

@roflcoopter
Copy link
Owner

Now its working again, two small issues tho, would you mind trying to fix them?

Pylint error should be easy.

And i think the mypy error can be fixed by adding this to .mypy.ini:

[mypy-ultralytics.*]
ignore_missing_imports = True

@john-
Copy link
Author

john- commented Jun 30, 2025

I will make that changes

@john-
Copy link
Author

john- commented Jun 30, 2025

Done and pushed.

@roflcoopter
Copy link
Owner

Pylint is still complaining, but i can fix that for you if you like. I have pestered you enough already 😄

@john-
Copy link
Author

john- commented Jun 30, 2025

I will fix that. It is in an additional file that is not part of this change but it looks pretty benign. Should take a minute or two.

@john-
Copy link
Author

john- commented Jun 30, 2025

Also note that that the tests I added will take 10 seconds each or so to run and are not quick like other tests. They wait for the concatenate thread to finish in order to validate the timing aspects of the change. If this is a concern maybe these can be conditionally in some way (e.g. do not run locally).

@roflcoopter roflcoopter self-requested a review June 30, 2025 18:56
@roflcoopter
Copy link
Owner

Awesome, great job! And thanks for sticking with it all the way :)

@roflcoopter roflcoopter merged commit ce9c781 into roflcoopter:dev Jun 30, 2025
18 checks passed
@john-
Copy link
Author

john- commented Jun 30, 2025

No problem and thanks for this great application. I could not have done any of this without all the hooks and interfaces you put in place.

@john-
Copy link
Author

john- commented Jun 30, 2025

Oh...I just updated to this version and so far it works as expected :)

@roflcoopter
Copy link
Owner

Great! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants