File size: 1,586 Bytes
f6228f9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---

description: Explore the detailed API reference for Ultralytics SAM and SAM 2 models.
keywords: Ultralytics, SAM, SAM 2, API Reference, models, window partition, data processing, YOLO
---


# Reference for `ultralytics/models/sam/modules/utils.py`

!!! note

    This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/modules/utils.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/modules/utils.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/sam/modules/utils.py) 🛠️. Thank you 🙏!


<br>

## ::: ultralytics.models.sam.modules.utils.select_closest_cond_frames



<br><br><hr><br>



## ::: ultralytics.models.sam.modules.utils.get_1d_sine_pe

<br><br><hr><br>

## ::: ultralytics.models.sam.modules.utils.init_t_xy

<br><br><hr><br>

## ::: ultralytics.models.sam.modules.utils.compute_axial_cis

<br><br><hr><br>

## ::: ultralytics.models.sam.modules.utils.reshape_for_broadcast

<br><br><hr><br>

## ::: ultralytics.models.sam.modules.utils.apply_rotary_enc

<br><br><hr><br>

## ::: ultralytics.models.sam.modules.utils.window_partition



<br><br><hr><br>



## ::: ultralytics.models.sam.modules.utils.window_unpartition

<br><br><hr><br>

## ::: ultralytics.models.sam.modules.utils.get_rel_pos

<br><br><hr><br>

## ::: ultralytics.models.sam.modules.utils.add_decomposed_rel_pos



<br><br>