-
-
Notifications
You must be signed in to change notification settings - Fork 16.7k
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
suggestions for integration? #910
Comments
Hi, I've definitely seen an attempt PR to do so here #465 (comment) and here #668 .
I think you just changed the line below, it should not save images anymore. You can pass "--save-txt" to get the predictions. Line 54 in 44cdcc7
I think you could write your custom Dataloader and simply replace here. Lines 47 to 55 in 44cdcc7
Lines 99 to 109 in 44cdcc7
|
@jinzishuai thanks for the suggestions! There is a PR for a pip package as mentioned. We paused work on that at the time but I think the repo is nearing a more mature state that we might look at that again soon, for the convenience perspective as you mentioned. Perhaps you could review the PR and submit any comments you have. The closest functionality now is torch hub, which only requires torch dependency: https://docs.ultralytics.com/yolov5 import torch
yolov5s = torch.hub.load('ultralytics/yolov5', 'yolov5s', pretrained=True)
detections = yolov5s(image) |
@glenn-jocher I'll have to look more into the torch hub idea. In the same time, I am more than happy to review and test the PR for the pip package. Do you know where it is? I didn't find it. Thanks a lot. |
@jinzishuai pip package PR is here: #465 Needs to be dusted off and updated. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
❔Question
I would like to start using yolov5 in my own project. So far, I haven't found a straight forward way and I had to copy and commit the yolov5 source into my own and start hacking it. I want to know if there is some best practices on how to use yolov5 in other projects.
I wonder if the following is possible
pip install yolov5
to get this module.Additional context
I am also looking for an API that might take an OpenCV image as input and output a list of detected objects. Right now, all I see from the detect.py is the detect() function that takes images/video files or webcam streams. In my application (I would imagine many others as well), we want to handle the video stream ourselves and do other operations and also don't want to save the images to temporary files. It would be super cool if there is an easy to use function to just do that. I am sure if I take the detect() function apart, I could isolate the a few steps output (which is kind of what I have done). But if this API is offered as part of the python package, then all we might have to do in the future might be
import yolov5
yolov5.detect(input_image)
Finally, I truly appreciate this open source effort and would love to contribute if there is some guidance.
The text was updated successfully, but these errors were encountered: