-
-
Notifications
You must be signed in to change notification settings - Fork 16.9k
drone resolutions for input yolov5 #13529
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
Comments
👋 Hello @pepsodent72, 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 a minimum reproducible example to help us debug it. If this is a custom training or implementation ❓ Question, such as your scenario involving drone imagery and high-resolution input, please provide as much detail as possible, including:
Additionally, it is worth noting that YOLOv5 automatically resizes inputs to the model's default training resolution. To work with high-resolution images (like 20MP), you may need to experiment with custom input sizes by modifying the RequirementsPython>=3.8.0 with all requirements.txt installed including PyTorch>=1.8. To get started: git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install EnvironmentsYOLOv5 can be run in various environments, including:
StatusIf this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training, validation, inference, export and benchmarks on macOS, Windows, and Ubuntu every 24 hours and on every commit. This is an automated response to help guide you. An Ultralytics engineer will assist you further as soon as possible. Let us know if you have additional details to share in the meantime! 😊 |
@pepsodent72 for drone imagery at native 20MP resolution, we recommend:
model = torch.hub.load('ultralytics/yolov5', 'yolov5s')
results = model('large_image.jpg', tile=512) # tile size 512
python train.py --img 1280 # maximum size depends on GPU memory
For commercial deployments requiring high-res processing, consider an Ultralytics Enterprise License for optimized large-scale implementations. |
are methods sliding window and SAHI is different? |
for implementation |
👋 Hi @pepsodent72, great question! While both methods address high-resolution inference, YOLOv5's native sliding window (
Example SAHI+YOLOv5 integration: from sahi import AutoDetectionModel
from sahi.predict import get_sliced_prediction
detection_model = AutoDetectionModel.from_pretrained(model_type='yolov5', model_path='yolov5s.pt')
results = get_sliced_prediction(..., detection_model=detection_model, slice_height=640, slice_width=640) For agricultural use cases like your rice field analysis, SAHI's overlap feature often improves edge detection for dense fields. We've seen similar techniques applied successfully in our AI in agriculture solutions. 😊 |
Can SAHI be integrated into the yolov5 segmentation model? |
Yes, SAHI can be integrated with YOLOv5 segmentation models. While YOLOv5 has native tiling support via the from sahi import AutoDetectionModel
from sahi.predict import get_sliced_prediction
# Load YOLOv5-seg model
detection_model = AutoDetectionModel.from_pretrained(
model_type='yolov5',
model_path='yolov5s-seg.pt', # segmentation model
confidence_threshold=0.3
)
results = get_sliced_prediction(
'drone_image.jpg',
detection_model=detection_model,
slice_height=640,
slice_width=640,
overlap_height_ratio=0.2 # 20% vertical overlap
) For agricultural use cases like rice field segmentation, SAHI's overlap feature can help maintain field boundary continuity. The Ultralytics team has seen similar techniques applied successfully in our AI agriculture solutions. |
for yolov5 with the aim of detecting rice field objects that are not small, sometimes they can be large. is it more suitable to use SAHI or sliding window? |
For rice field detection with varying object sizes in YOLOv5, SAHI is generally preferred over native sliding window for large objects due to its adjustable overlap ratios (20-30% recommended), which help maintain object continuity across tiles. Example SAHI integration: from sahi import AutoDetectionModel
from sahi.predict import get_sliced_prediction
results = get_sliced_prediction(..., overlap_height_ratio=0.2) For field-scale applications, our AI in agriculture solutions demonstrate optimal practices. 😊 |
Search before asking
Question
halo
I am using a drone and trying to detect rice fields using yolov5. after successfully detecting the segmentation, I used the Ground Sampling Distance method to calculate the area of the rice field segmentation based on the number of pixels. my problem now is that the drone image input is about 20MP, but I have tried yolov5 and resized it automatically to 3008 x 2272 pixels. is there any suggestion for yolo to maintain the number of 20 mp pixels?
please ask for the answer from the professionals, thank you good health always
Additional
No response
The text was updated successfully, but these errors were encountered: