Add docstrings and improve comments (#11229)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
ccfc1cf925
commit
d5458f27cd
16 changed files with 34 additions and 17 deletions
|
|
@ -345,12 +345,12 @@ def test_labels_and_crops():
|
|||
labels = save_path / f"labels/{im_name}.txt"
|
||||
assert labels.exists()
|
||||
# Check detections match label count
|
||||
assert len(r.boxes.data) == len([l for l in labels.read_text().splitlines() if l])
|
||||
assert len(r.boxes.data) == len([line for line in labels.read_text().splitlines() if line])
|
||||
# Check crops path and files
|
||||
crop_dirs = [p for p in (save_path / "crops").iterdir()]
|
||||
crop_dirs = list((save_path / "crops").iterdir())
|
||||
crop_files = [f for p in crop_dirs for f in p.glob("*")]
|
||||
# Crop directories match detections
|
||||
assert all([r.names.get(c) in {d.name for d in crop_dirs} for c in cls_idxs])
|
||||
assert all(r.names.get(c) in {d.name for d in crop_dirs} for c in cls_idxs)
|
||||
# Same number of crops as detections
|
||||
assert len([f for f in crop_files if im_name in f.name]) == len(r.boxes.data)
|
||||
|
||||
|
|
@ -643,8 +643,8 @@ def test_yolo_world():
|
|||
model(ASSETS / "bus.jpg", conf=0.01)
|
||||
|
||||
model = YOLO("yolov8s-worldv2.pt") # no YOLOv8n-world model yet
|
||||
# Training from pretrain, evaluation process is included at the final stage of training.
|
||||
# Use dota8.yaml which has less categories to reduce the inference time of CLIP model
|
||||
# Training from a pretrained model. Eval is included at the final stage of training.
|
||||
# Use dota8.yaml which has fewer categories to reduce the inference time of CLIP model
|
||||
model.train(
|
||||
data="dota8.yaml",
|
||||
epochs=1,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue