|
|
@ -4,7 +4,7 @@ from copy import copy
|
|
|
|
|
|
|
|
|
|
|
|
from ultralytics.models import yolo
|
|
|
|
from ultralytics.models import yolo
|
|
|
|
from ultralytics.nn.tasks import PoseModel
|
|
|
|
from ultralytics.nn.tasks import PoseModel
|
|
|
|
from ultralytics.utils import DEFAULT_CFG
|
|
|
|
from ultralytics.utils import DEFAULT_CFG, LOGGER
|
|
|
|
from ultralytics.utils.plotting import plot_images, plot_results
|
|
|
|
from ultralytics.utils.plotting import plot_images, plot_results
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -18,6 +18,10 @@ class PoseTrainer(yolo.detect.DetectionTrainer):
|
|
|
|
overrides['task'] = 'pose'
|
|
|
|
overrides['task'] = 'pose'
|
|
|
|
super().__init__(cfg, overrides, _callbacks)
|
|
|
|
super().__init__(cfg, overrides, _callbacks)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if isinstance(self.args.device, str) and self.args.device.lower() == 'mps':
|
|
|
|
|
|
|
|
LOGGER.warning("WARNING ⚠️ Apple MPS known Pose bug. Recommend 'device=cpu' for Pose models. "
|
|
|
|
|
|
|
|
'See https://github.com/ultralytics/ultralytics/issues/4031.')
|
|
|
|
|
|
|
|
|
|
|
|
def get_model(self, cfg=None, weights=None, verbose=True):
|
|
|
|
def get_model(self, cfg=None, weights=None, verbose=True):
|
|
|
|
"""Get pose estimation model with specified configuration and weights."""
|
|
|
|
"""Get pose estimation model with specified configuration and weights."""
|
|
|
|
model = PoseModel(cfg, ch=3, nc=self.data['nc'], data_kpt_shape=self.data['kpt_shape'], verbose=verbose)
|
|
|
|
model = PoseModel(cfg, ch=3, nc=self.data['nc'], data_kpt_shape=self.data['kpt_shape'], verbose=verbose)
|
|
|
|