@@ -66,7 +66,6 @@ def __init__(
66
66
"loss_rpn_box_reg" ,
67
67
),
68
68
device_type : str = "gpu" ,
69
- is_yolov8 : bool = False ,
70
69
):
71
70
"""
72
71
Initialization.
@@ -94,7 +93,6 @@ def __init__(
94
93
'loss_objectness', and 'loss_rpn_box_reg'.
95
94
:param device_type: Type of device to be used for model and tensors, if `cpu` run on CPU, if `gpu` run on GPU
96
95
if available otherwise run on CPU.
97
- :param is_yolov8: The flag to be used for marking the YOLOv8 model.
98
96
"""
99
97
import torch
100
98
import torchvision
@@ -139,11 +137,7 @@ def __init__(
139
137
140
138
self ._model : torch .nn .Module
141
139
self ._model .to (self ._device )
142
- self .is_yolov8 = is_yolov8
143
- if self .is_yolov8 :
144
- self ._model .model .eval () # type: ignore
145
- else :
146
- self ._model .eval ()
140
+ self ._model .eval ()
147
141
148
142
@property
149
143
def native_label_is_pytorch_format (self ) -> bool :
@@ -412,10 +406,7 @@ def predict(self, x: np.ndarray, batch_size: int = 128, **kwargs) -> list[dict[s
412
406
from torch .utils .data import TensorDataset , DataLoader
413
407
414
408
# Set model to evaluation mode
415
- if self .is_yolov8 :
416
- self ._model .model .eval () # type: ignore
417
- else :
418
- self ._model .eval ()
409
+ self ._model .eval ()
419
410
420
411
# Apply preprocessing and convert to tensors
421
412
x_preprocessed , _ = self ._preprocess_and_convert_inputs (x = x , y = None , fit = False , no_grad = True )
0 commit comments