Get Started

High Resolution Tiling with Ultralytics YOLO

Open High Resolution Tiling In Colab

Use tile=True to process high-resolution images in overlapping windows before resizing them to the model input. This can preserve small-object detail that would be lost by resizing the whole image. No additional package is required, and tile replaces the deprecated SAHI integration for Ultralytics models.

Whole image, imgsz=640: 35 detectionstile=640: 161 detections
YOLO26s whole-image prediction on a drone view of a city intersection, with 35 detectionsYOLO26s tiled prediction on the same intersection, with 161 detections, including distant pedestrians, cyclists, and cars

YOLO26s on a 1920 × 1080 VisDrone frame at the default confidence threshold. With tile=640, the model runs eight overlapping 640-pixel windows at native resolution instead of one pass over the frame shrunk to 640 pixels.

Tiling uses the normal training, validation, and prediction pipelines. Prediction returns one Results object per original image. Validation merges predictions before evaluating them against the original annotations; training loss is computed on the tiles.

Choose Between imgsz and tile#

Raising imgsz and tiling both give small objects more pixels. A larger imgsz keeps the whole image in one model pass, while tile=True keeps every pass at imgsz, which matches the training resolution when imgsz is the size the model was trained at. The benchmarks below cover two workloads, and their best settings are candidates to validate on your own data:

Workload testedSettingMeasured with YOLO26s and YOLO26s-obb
VisDrone drone images, COCO weights not trained on tilesA larger imgsz, without tileimgsz=1920 reached 23.7 mAP against 21.7 mAP with tile=640, at 5.8 ms against 13.5 ms per 1920 × 1080 frame
DOTAv1 aerial images, weights trained on 1024-pixel cropstile equal to the training imgsztile=1024 reached 64.4 mAP in 40.8 ms and 2.2 GB, against 61.1 mAP in 60.9 ms and 9.0 GB with imgsz=4096

Usage#

Pass tile to train, val, predict, or track:

Train, validate, and predict with tiling
from ultralytics import YOLO

model = YOLO("yolo26n.pt")
model.train(data="aerial.yaml", tile=True, imgsz=640)
metrics = model.val(data="aerial.yaml", tile=True, imgsz=640)
results = model.predict("large-image.tif", tile=640, imgsz=640, batch=8)
yolo predict model=yolo26n.pt source=large-image.tif tile=640 imgsz=640 batch=8

tile=True uses imgsz as the window size. A positive integer, such as tile=1024, sets the window size independently of imgsz, and tile=[768, 1280] sets a rectangular [h, w] window. tile=False is the default. Neighboring windows share the tile_overlap fraction of the tile, 20% by default, and the last row and column are aligned to the image boundary, so they can overlap more. A 1920 × 1080 image at tile=640 uses a 4 × 2 grid of windows. Smaller images use a single full-image window.

batch controls how many tiles the model processes together during prediction. The existing backend handles fixed export batch sizes, including the last partial batch. Exported models retain their normal input graph; tiling runs in the Python prediction pipeline.

For video, stream results to keep memory bounded and use the existing prediction options to save or display them:

Predict on video with tiling
from ultralytics import YOLO

model = YOLO("yolo26n.pt")
for result in model.predict("video.mp4", tile=640, stream=True, save=True):
    print(result.boxes)
yolo predict model=yolo26n.pt source=video.mp4 tile=640 save=True

Tasks and Models#

TaskFull-image output
DetectRestore boxes to source coordinates and suppress duplicates with iou, agnostic_nms, and max_det.
SegmentApply the same box selection and place the selected masks in the source image.
SemanticStitch class maps, choosing the most central tile in overlapping regions.
DepthBlend overlapping depth maps with weights increasing toward each tile's center.
ClassifyAverage tile probabilities.
PoseApply box selection and restore the corresponding keypoints.
OBBRestore rotated boxes and use rotated NMS.

The shared pipeline supports YOLO task models, YOLO-World, YOLOE, RT-DETR, and FastSAM prediction. YOLOE visual prompts are embedded from the full source image and reused by its tiles. FastSAM selects prompted masks after merging them into source coordinates. SAM predictors retain their own prompt and crop-generation pipeline; they do not accept tile.

During training, boxes and polygons are cropped to their windows, OBB clipping preserves orientation, and out-of-window keypoints lose visibility. Instances with less than 10% of their original bounding-box area remaining are removed. Empty windows remain as negative examples. Semantic and depth targets use the same windows as their images. Each window is one training sample, so batch and the epoch length count tiles: the 4 training images of COCO8 become 24 samples at tile=320.

Performance and Quality#

  • Tiling processes more windows than whole-image inference. Choose the largest tile and batch sizes that preserve the detail you need within available memory. The number of windows per image grows quickly as the tile shrinks, here at the default tile_overlap=0.2:

    Image sizetile=320tile=640tile=1024tile=1280
    1280 × 72015621
    1920 × 108032862
    2560 × 1440601566
    3840 × 216013532158
    8000 × 60007441928048
  • Prediction runs one window at a time unless you set batch. On 1920 × 1080 frames with tile=640, batch=16 cut the time per frame from 26.6 ms to 10.6 ms for YOLO26n and from 56.0 ms to 35.5 ms for YOLO26x, and raised peak GPU memory for YOLO26x from 0.44 GB to 1.57 GB.

  • Consecutive tiles reuse the decoded source. With cache="ram", training stores source images once; cache="disk" uses the existing image cache. Training shuffles tiles, so caching is especially useful for large compressed source images.

  • Source-sized masks and dense maps still require memory proportional to the original image. max_det limits the number of retained instance masks.

  • Tiling removes global context. Validate accuracy on your own data, especially for classification and depth, whose tile outputs may not agree globally.

  • A box cut by an interior window edge is dropped when another window sees the object clear of its edges and a kept box covers it, so seams keep the more complete prediction. A cut box returns to the final NMS pass when no kept box of the same class, or of any class with agnostic_nms=True, covers more than half of it. Objects larger than the overlap can still be split, because no window sees them whole, and merging does not join separate fragments. An object smaller than the overlap always fits whole in some window, so raise tile_overlap or the tile size for objects you need whole.

  • max_det caps each window and then the merged image, so a tiled image never returns more than max_det detections. Raise it above the default of 300 for dense scenes.

  • Tensor sources, embed, and visualize are unsupported. Tracking runs on the merged predictions once per source frame, including ReID features.

Benchmarks#

Both benchmarks ran Ultralytics 8.4.216 in PyTorch FP32 on one NVIDIA RTX PRO 6000 Blackwell Server Edition GPU. Accuracy is mAPval 50-95 from model.val(), and latency is the full model.predict() call for one already decoded image, with tiles batched 16 at a time unless noted.

Large Aerial Images#

The pretrained YOLO26 OBB models, trained at imgsz=1024, were validated on the 458 original images of the DOTAv1 val split without cropping them first. Their long side has a median of about 2140 pixels and a maximum of 13,383 pixels. Every tile column uses imgsz=1024.

mAPval 50-95, higher is better. The best value for each model is in bold.

Modelimgsz=1024imgsz=2048imgsz=4096tile=2048tile=1024tile=768
YOLO26n-obb46.557.360.058.462.763.1
YOLO26s-obb50.660.261.161.064.464.1
YOLO26m-obb53.862.762.263.764.964.8
YOLO26l-obb54.262.662.163.665.464.7
YOLO26x-obb55.863.562.764.765.564.9

Mean milliseconds per image, lower is better, on every twelfth image of the split: 39 images with a long side of 567 to 5441 pixels. tile=2048 ran 3.7 windows per image on average, tile=1024 ran 11.7, and tile=768 ran 20.9.

Modelimgsz=1024imgsz=2048imgsz=4096tile=2048tile=1024tile=768
YOLO26n-obb6.19.437.512.625.758.6
YOLO26s-obb5.913.260.916.640.886.4
YOLO26m-obb7.820.997.126.474.6145.8
YOLO26l-obb9.025.3120.830.787.8169.0
YOLO26x-obb12.541.7203.646.4144.2273.9

Peak GPU memory in GB during prediction on the same 39 images, lower is better. Tiled values are for batch=16; with batch=1, tile=1024 peaked at 0.10 to 0.79 GB.

Modelimgsz=1024imgsz=2048imgsz=4096tile=2048tile=1024tile=768
YOLO26n-obb0.090.404.560.541.111.11
YOLO26s-obb0.170.768.951.072.152.15
YOLO26m-obb0.331.069.572.104.134.13
YOLO26l-obb0.421.279.582.735.245.24
YOLO26x-obb0.752.3314.364.979.329.32
  • tile=1024 was the most accurate setting for four of the five models and within 0.4 mAP of the best for YOLO26n-obb. Against imgsz=4096 it scored 2.7 to 3.3 mAP higher, ran 1.3 to 1.5 times faster, and used 1.5 to 4.2 times less GPU memory.
  • imgsz=4096 took 4.0 to 4.9 times longer than imgsz=2048 and scored lower on YOLO26m-obb, YOLO26l-obb, and YOLO26x-obb.
  • tile=2048 with imgsz=1024 scored 0.8 to 1.2 mAP higher than imgsz=2048 and ran 1.1 to 1.3 times slower.
  • tile=768, a window smaller than the training size, scored 0.4 mAP higher than tile=1024 on YOLO26n-obb and 0.1 to 0.7 lower on the other four models, and took 1.9 to 2.3 times longer.

Drone Images#

The COCO-pretrained YOLO26 detection models, trained at imgsz=640, were validated on the 548 images of the VisDrone val split without fine-tuning. Scoring uses the six classes VisDrone shares with COCO: person, bicycle, car, motorcycle, bus, and truck, with the VisDrone pedestrian and people labels counted as person, van as car, and motor as motorcycle. Every tile column uses imgsz=640.

mAPval 50-95, higher is better. The best value for each model is in bold.

Modelimgsz=640imgsz=1280imgsz=1920tile=640tile=480tile=320
YOLO26n8.815.617.315.016.515.9
YOLO26s13.521.923.721.722.521.3
YOLO26m17.625.726.925.325.923.8
YOLO26l19.027.227.526.527.525.5
YOLO26x20.930.230.829.129.927.3

Median milliseconds per image, lower is better, on the 19 val images that are exactly 1920 × 1080. tile=640 runs 8 windows per frame, tile=480 runs 15, and tile=320 runs 32 with batch=32. YOLO26n measured faster at imgsz=1920 than at imgsz=1280 in two separate runs.

Modelimgsz=640imgsz=1280imgsz=1920tile=640tile=480tile=320
YOLO26n3.74.73.910.622.744.3
YOLO26s3.95.05.813.528.858.5
YOLO26m4.36.910.122.143.693.9
YOLO26l5.58.412.426.149.1108.6
YOLO26x6.412.022.535.567.7157.6
  • tile=640 scored 6.2 to 8.2 mAP higher than imgsz=640, the gain that tiling gives over shrinking the frame to the model input.
  • imgsz=1280 scored 0.2 to 1.1 mAP higher than tile=640 and ran 2.3 to 3.2 times faster. imgsz=1920 matched or beat every tiled setting on all five models.
  • tile=480 scored 0.6 to 1.5 mAP higher than tile=640 on all five models and took 1.9 to 2.1 times longer.
  • tile=320 raised recall over tile=640 by 2.6 to 6.0 points on all five models, lowered mAP on four of them, and took 4.2 to 4.4 times longer, so compare window sizes on your own validation set.

Migrate from SAHI#

SAHI argumenttile equivalent
slice_height, slice_widthtile=[h, w], tile=<int> for a square window, or tile=True to use imgsz
overlap_height_ratio, overlap_width_ratiotile_overlap, one fraction for both axes
postprocess_match_thresholdiou: IoU-based NMS that suppresses boxes instead of merging them, prediction default 0.5 for YOLO models
postprocess_class_agnosticagnostic_nms
confidence_threshold, image_sizeconf, imgsz
perform_standard_predNo equivalent: tile does not add a full-image pass
Sliced dataset exportNot needed: tile crops images and labels on the fly during training

FAQ#

  • tile splits each image into overlapping windows, runs the model on every window, and merges the outputs back into one result per original image. It works in training, validation, prediction, and tracking. With tile=True, windows match imgsz, so small objects keep the pixels they would lose if the whole image were resized to imgsz.

  • Start with a tile equal to the imgsz the model was trained at: tile=True uses imgsz as the window size, and an integer such as tile=1024 sets it independently. On DOTAv1 aerial images, tile=1024 was the most accurate setting for four of the five YOLO26 OBB models, which were trained on 1024-pixel crops. On VisDrone with COCO weights, tile=480 scored 0.6 to 1.5 mAP higher than tile=640. At the default tile_overlap=0.2, a 1920 × 1080 image at tile=640 runs eight windows and a 3840 × 2160 image at tile=1280 also runs eight. A window smaller than imgsz, such as tile=400 with imgsz=640, is enlarged to the model input, which helps when objects are only a few pixels wide even at native resolution. Smaller windows keep more detail but add windows to process, remove more global context, and can enlarge background clutter into false positives, so compare a few sizes on your own validation set.

  • It depends on the workload, so validate both. In the benchmarks, COCO-pretrained YOLO26 models on VisDrone drone images scored highest with imgsz=1920 and no tiling, while YOLO26 OBB models trained on 1024-pixel crops scored higher on DOTAv1 aerial images with tile=1024 than with imgsz=4096, in less time and GPU memory. See Choose Between imgsz and tile.

  • No. The tile argument handles sliced inference without an extra package, and it also tiles training and validation. Prediction returns standard Results objects, and validation scores the merged predictions against the original annotations. The SAHI guide is deprecated, and Migrate from SAHI maps its arguments to tile.

  • Use the same tile setting for training and prediction when your images are much larger than imgsz. Training on tiles shows the model objects at the scale it sees during tiled prediction, clips labels to each window, and keeps empty windows as negative examples. Validate with tile too, since validation merges tile predictions before computing metrics on the full images.

  • Yes. Tiling runs in the Python prediction pipeline, so exported models keep their normal input graph. Load the exported file with YOLO("yolo26n.onnx") and pass tile to predict as usual. batch sets how many tiles run together, and fixed export batch sizes are handled, including the last partial batch.

  • Detection, segmentation, semantic segmentation, depth, classification, pose, and OBB all support tile, as do YOLO-World, YOLOE, RT-DETR, and FastSAM prediction. SAM keeps its own prompt and crop pipeline and does not accept tile. See Tasks and Models for how each task merges tile outputs.

Comments

Ask a question, share your results, or help someone else.