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:
Glenn Jocher 2024-08-25 01:08:07 +08:00 committed by GitHub
parent c1882a4327
commit d27664216b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
63 changed files with 370 additions and 374 deletions

View file

@ -82,7 +82,7 @@ Without further ado, let's dive in!
```python
import pandas as pd
indx = [l.stem for l in labels] # uses base filename as ID (no extension)
indx = [label.stem for label in labels] # uses base filename as ID (no extension)
labels_df = pd.DataFrame([], columns=cls_idx, index=indx)
```
@ -97,9 +97,9 @@ Without further ado, let's dive in!
with open(label, "r") as lf:
lines = lf.readlines()
for l in lines:
for line in lines:
# classes for YOLO label uses integer at first position of each line
lbl_counter[int(l.split(" ")[0])] += 1
lbl_counter[int(line.split(" ")[0])] += 1
labels_df.loc[label.stem] = lbl_counter

View file

@ -248,9 +248,9 @@ Learn more about the [benefits of sliced inference](#benefits-of-sliced-inferenc
Yes, you can visualize prediction results when using YOLOv8 with SAHI. Here's how you can export and visualize the results:
```python
result.export_visuals(export_dir="demo_data/")
from IPython.display import Image
result.export_visuals(export_dir="demo_data/")
Image("demo_data/prediction_visual.png")
```