Guides

Training a model

Pick a model backbone, configure callbacks, and run model.fit() — DeepPoseKit follows a familiar Keras workflow.

Choose a backbone

DeepPoseKit ships with two complementary architectures:

  • StackedDenseNet — the toolkit’s novel multi-scale backbone. Recommended default for most use cases.
  • StackedHourglass — a well-established baseline included for comparison and reproducibility.

Set up callbacks

from deepposekit.callbacks import Logger, ModelCheckpoint
from tensorflow.keras.callbacks import EarlyStopping, ReduceLROnPlateau

callbacks = [
    Logger(validation_batch_size=10, filepath='/path/to/log.h5'),
    ModelCheckpoint('/path/to/best_model.h5', monitor='val_loss', save_best_only=True),
    EarlyStopping(patience=20, restore_best_weights=True),
    ReduceLROnPlateau(patience=10, factor=0.2, min_delta=1e-3),
]

Fit the model

model.fit(
    batch_size=16,
    n_workers=8,
    validation_batch_size=10,
    callbacks=callbacks,
    epochs=200,
)

Reproducibility

Pass random_seed to TrainingGenerator to make the train / validation split deterministic, and pin your CUDA / cuDNN versions for repeatable timing benchmarks.