-
-
Notifications
You must be signed in to change notification settings - Fork 16.5k
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
is it valuable that add --cache-images option to detect.py? #2004
Comments
👋 Hello @kyshel, thank you for your interest in 🚀 YOLOv5! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution. If this is a 🐛 Bug Report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you. If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available. For business inquiries or professional support requests please visit https://www.ultralytics.com or email Glenn Jocher at glenn.jocher@ultralytics.com. RequirementsPython 3.8 or later with all requirements.txt dependencies installed, including $ pip install -r requirements.txt EnvironmentsYOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
StatusIf this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), testing (test.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit. |
@kyshel the purpose of caching images into RAM during training is that each image may be loaded hundreds or thousands of times during training. Inference loads each image once, therefore caching images is a meaningless concept in this setting. |
@kyshel I think what you're looking for is PyTorch HubTo run batched inference with YOLOv5 and PyTorch Hub: import torch
from PIL import Image
# Model
model = torch.hub.load('ultralytics/yolov5', 'yolov5s', pretrained=True)
# Images
img1 = Image.open('zidane.jpg')
img2 = Image.open('bus.jpg')
imgs = [img1, img2] # batched list of images
# Inference
result = model(imgs) |
@glenn-jocher Thanks a lot! |
🚀 Feature
Add --cache-images option to detect.py like train.py
Motivation
There R about 300k images in my--source directory, when i run detect.py, I noticed that it seems like load and test images one by one , and my pc sound "pew-pew-pew-pew..." like a rushing laser weapon, maybe the disk is trembling. And it consumes a long time.
Maybe cached option(read from disk, and test direct in RAM) can speedup ? Or yolov5 has integrated this featue and just not provide visible option for users?
Pitch
Add --cache-images option to detect.py like train.py
Alternatives
Maybe add a script that make a big cache file from --src imgs?
Additional context
None.
The text was updated successfully, but these errors were encountered: