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

if i have hardware that support parallel ,Can i edit the network to run parallel #8767

Closed
1 task done
VYRION-Ai opened this issue Jul 28, 2022 · 6 comments
Closed
1 task done
Labels
question Further information is requested Stale

Comments

@VYRION-Ai
Copy link

VYRION-Ai commented Jul 28, 2022

Search before asking

Question

if i have hardware that support parallel like FPGA ,Can i edit the network to run parallel . any answer will help me allot

Additional

No response

@VYRION-Ai VYRION-Ai added the question Further information is requested label Jul 28, 2022
@glenn-jocher
Copy link
Member

glenn-jocher commented Jul 29, 2022

@totoadel see Multi-GPU Training tutorial below:

YOLOv5 Tutorials

Good luck 🍀 and let us know if you have any other questions!

@VYRION-Ai
Copy link
Author

@glenn-jocher I don't want to do training, I want to do detecting

@glenn-jocher
Copy link
Member

glenn-jocher commented Jul 29, 2022

@totoadel 👋 Hello! Thanks for asking about handling inference results. YOLOv5 🚀 PyTorch Hub models allow for simple model loading and inference in a pure python environment without using detect.py.

Simple Inference Example

This example loads a pretrained YOLOv5s model from PyTorch Hub as model and passes an image for inference. 'yolov5s' is the YOLOv5 'small' model. For details on all available models please see the README. Custom models can also be loaded, including custom trained PyTorch models and their exported variants, i.e. ONNX, TensorRT, TensorFlow, OpenVINO YOLOv5 models.

import torch

# Model
model = torch.hub.load('ultralytics/yolov5', 'yolov5s')  # yolov5n - yolov5x6 official model
#                                            'custom', 'path/to/best.pt')  # custom model

# Images
im = 'https://ultralytics.com/images/zidane.jpg'  # or file, Path, URL, PIL, OpenCV, numpy, list

# Inference
results = model(im)

# Results
results.print()  # or .show(), .save(), .crop(), .pandas(), etc.
results.xyxy[0]  # im predictions (tensor)

results.pandas().xyxy[0]  # im predictions (pandas)
#      xmin    ymin    xmax   ymax  confidence  class    name
# 0  749.50   43.50  1148.0  704.5    0.874023      0  person
# 2  114.75  195.75  1095.0  708.0    0.624512      0  person
# 3  986.00  304.00  1028.0  420.0    0.286865     27     tie

results.pandas().xyxy[0].value_counts('name')  # class counts (pandas)
# person    2
# tie       1

See YOLOv5 PyTorch Hub Tutorial for details.

Good luck 🍀 and let us know if you have any other questions!

@VYRION-Ai
Copy link
Author

@glenn-jocher i know this , what i mean is , i want to change the yolo layers to work parallel

@github-actions
Copy link
Contributor

github-actions bot commented Aug 31, 2022

👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.

Access additional YOLOv5 🚀 resources:

Access additional Ultralytics ⚡ resources:

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 YOLOv5 🚀 and Vision AI ⭐!

@glenn-jocher
Copy link
Member

@VYRION-Ai I understand, you are referring to parallel execution of YOLO layers. YOLOv5 already includes multi-scale prediction and weighted-bridge convolutional layers for efficient model parallelism during inference, benefiting from PyTorch's native parallel execution capabilities. Enabling further parallelism might require intricate modifications and careful testing to ensure accuracy and performance.

For comprehensive control over model parallelism and custom layer optimization, exploring PyTorch's native techniques for distributed and parallel computing would be beneficial. Additionally, PyTorch's documentation provides detailed guidance on achieving fine-grained control over parallelism and optimizing custom layers to suit specific hardware capabilities.

Feel free to refer to the Ultralytics Docs for further information, and let me know if you require assistance with any specific implementation.

Keep up the great work, and don't hesitate to reach out if you have any more questions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested Stale
Projects
None yet
Development

No branches or pull requests

2 participants