MCPcopy
hub / github.com/ultralytics/ultralytics / test_model_methods

Function test_model_methods

tests/test_python.py:76–93  ·  view source on GitHub ↗

Test various methods and properties of the YOLO model to ensure correct functionality.

()

Source from the content-addressed store, hash-verified

74
75
76def test_model_methods():
77 """Test various methods and properties of the YOLO model to ensure correct functionality."""
78 model = YOLO(MODEL)
79
80 # Model methods
81 model.info(verbose=True, detailed=True)
82 model = model.reset_weights()
83 model = model.load(MODEL)
84 model.to("cpu")
85 model.fuse()
86 model.clear_callback("on_train_start")
87 model.reset_callbacks()
88
89 # Model properties
90 _ = model.names
91 _ = model.device
92 _ = model.transforms
93 _ = model.task_map
94
95
96def test_model_profile():

Callers

nothing calls this directly

Calls 8

YOLOClass · 0.90
reset_weightsMethod · 0.80
clear_callbackMethod · 0.80
reset_callbacksMethod · 0.80
infoMethod · 0.45
loadMethod · 0.45
toMethod · 0.45
fuseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…