Ruff format docstring Python code (#15792)
Signed-off-by: UltralyticsAssistant <web@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
c1882a4327
commit
d27664216b
63 changed files with 370 additions and 374 deletions
|
|
@ -16,8 +16,8 @@ class FastSAM(Model):
|
|||
```python
|
||||
from ultralytics import FastSAM
|
||||
|
||||
model = FastSAM('last.pt')
|
||||
results = model.predict('ultralytics/assets/bus.jpg')
|
||||
model = FastSAM("last.pt")
|
||||
results = model.predict("ultralytics/assets/bus.jpg")
|
||||
```
|
||||
"""
|
||||
|
||||
|
|
|
|||
|
|
@ -92,8 +92,8 @@ class FastSAMPredictor(SegmentationPredictor):
|
|||
if labels.sum() == 0 # all negative points
|
||||
else torch.zeros(len(result), dtype=torch.bool, device=self.device)
|
||||
)
|
||||
for p, l in zip(points, labels):
|
||||
point_idx[torch.nonzero(masks[:, p[1], p[0]], as_tuple=True)[0]] = True if l else False
|
||||
for point, label in zip(points, labels):
|
||||
point_idx[torch.nonzero(masks[:, point[1], point[0]], as_tuple=True)[0]] = True if label else False
|
||||
idx |= point_idx
|
||||
if texts is not None:
|
||||
if isinstance(texts, str):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue