Reference for ultralytics/models/fastsam/utils.py
Note
This file is available at https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/fastsam/utils.py. If you spot a problem please help fix it by contributing a Pull Request 🛠️. Thank you 🙏!
ultralytics.models.fastsam.utils.adjust_bboxes_to_image_border
Adjust bounding boxes to stick to image border if they are within a certain threshold.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
boxes
|
Tensor
|
(n, 4) |
required |
image_shape
|
tuple
|
(height, width) |
required |
threshold
|
int
|
pixel threshold |
20
|
Returns:
Name | Type | Description |
---|---|---|
adjusted_boxes |
Tensor
|
adjusted bounding boxes |
Source code in ultralytics/models/fastsam/utils.py
📅 Created 1 year ago
✏️ Updated 3 months ago