Enable model.eval() usage for YOLO class (#17754)
This commit is contained in:
parent
65c797a898
commit
6a762564c8
1 changed files with 17 additions and 0 deletions
|
|
@ -1126,3 +1126,20 @@ class Model(nn.Module):
|
|||
description of the expected behavior and structure.
|
||||
"""
|
||||
raise NotImplementedError("Please provide task map for your model!")
|
||||
|
||||
def eval(self):
|
||||
"""
|
||||
Sets the model to evaluation mode.
|
||||
|
||||
This method changes the model's mode to evaluation, which affects layers like dropout and batch normalization
|
||||
that behave differently during training and evaluation.
|
||||
|
||||
Returns:
|
||||
(Model): The model instance with evaluation mode set.
|
||||
|
||||
Examples:
|
||||
>> model = YOLO("yolo11n.pt")
|
||||
>> model.eval()
|
||||
"""
|
||||
self.model.eval()
|
||||
return self
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue