Larger obejcts detection boxes being cropped

I have noticed that larger objects seem to be truncated at aroudn 950 pixels in both widhth and heght, no matter what resolution I run the inference at. Is that intentional or there is soem paramaeters that can be changed to avoid this behaviour? It works fine for smaller obejcts but for larger objects its an issue. It exists for both obb and segmentation tasks. For segmentation masks, as the output masks are cropped by bbox sizes, the output masks are also truncated. I got rid of that by basically saying if mask height or width > 950, dont crop, but its not perfect.

Is that 950 pixels on a single axis or both? Are your objects very long and thin or closer to square?

on both. The objects are mostly long and thin(not too thin) - thye shoudl be around (10-15:1 aspect ratio), but some are close to square as well. And I am trainign with image size 1920 and runngn inference with same size as arg to model.predict.

Yes, large objects get cropped. One reason for this is the receptive field limitation, another reason is the fixed reg_max size in the head, which is hardcoded but can be modified by editing the source code. It needs to be increased to a larger value:

The cropping issue occurs if you use a large imgsz with large objects. The easier workaround is to use a smaller imgsz.

If I am training with imgsz=1920, with a larger bounding box (larger than 950) does the cropping occur during training too? so is the model able to learn larger object or is it just during the inference that it cuts if off? Also does it make sense to train and infer with a larger image size (with an idea of getting more pixels per box) or can I just use a smaller image size in the first place if its downsampling before making it to the model?

Cropping doesn’t occur during training. It’s a model limitation caused by large imgsz

Unless you have a need for such large imgsz (usually that’s the case when you want to detect small objects, not large), you should lower the imgsz. If you’re setting imgsz to 1920 because your images are 1080p, then that’s wrong understanding of what imgsz is. It’s not meant to be equal to or close to your original resolution. It’s the input resolution to model, and a small imgsz like 640 is sufficient for most use cases.

The easiest way to fix the cropping issue is to lower the imgsz.