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

Fix detect.py URL inference #5525

Merged
merged 2 commits into from
Nov 5, 2021
Merged

Fix detect.py URL inference #5525

merged 2 commits into from
Nov 5, 2021

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Nov 5, 2021

Allows detect.py to run inference on remote URL sources, i.e.:

!python detect.py --weights yolov5s.pt --source https://ultralytics.com/assets/zidane.jpg  # image URL
!python detect.py --weights yolov5s.pt --source https://ultralytics.com/assets/decelera_landscape.mov  # video URL

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Enhanced media source handling and format verification in the YOLOv5 detection script.

πŸ“Š Key Changes

  • Added image and video format lists to detection utilities.
  • Improved the clarity of the source type checking (webcam, file, or URL).
  • Implemented automatic download of files from URLs if necessary.

🎯 Purpose & Impact

  • 🎯 To streamline the process of identifying source types and handle them appropriately in the detection pipeline.
  • πŸ’‘ Users benefit from more robust handling of various input source formats and the convenience of automatic file downloads when URLs are provided that point to valid media files.
  • πŸš€ Potential impact includes greater ease of use and a more user-friendly experience, especially for non-expert users not accustomed to manually downloading files for object detection tasks.

Allows detect.py to run inference on remote URL sources, i.e.:

```python
!python detect.py --weights yolov5s.pt --source https://ultralytics.com/assets/zidane.jpg  # image URL
!python detect.py --weights yolov5s.pt --source https://ultralytics.com/assets/decelera_landscape.mov  # video URL
```
@glenn-jocher glenn-jocher self-assigned this Nov 5, 2021
@glenn-jocher glenn-jocher merged commit 5f603a9 into master Nov 5, 2021
@glenn-jocher glenn-jocher deleted the update/detect_url branch November 5, 2021 17:43
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
* Fix detect.py URL inference

Allows detect.py to run inference on remote URL sources, i.e.:

```python
!python detect.py --weights yolov5s.pt --source https://ultralytics.com/assets/zidane.jpg  # image URL
!python detect.py --weights yolov5s.pt --source https://ultralytics.com/assets/decelera_landscape.mov  # video URL
```

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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.

None yet

1 participant