Skip to content

Instantly share code, notes, and snippets.

@eddyxu
Last active May 5, 2022 18:55
Show Gist options
  • Save eddyxu/882f6e72bcfe87dd4053d1eafc823a00 to your computer and use it in GitHub Desktop.
Save eddyxu/882f6e72bcfe87dd4053d1eafc823a00 to your computer and use it in GitHub Desktop.
Train on hardhat dataset
from rikai.pytorch.data import Dataset
def train(
name: str,
uri: Dataset,
model_type: str,
epochs: int = 150,
batch_size: int = 4,
num_workers: int = 4,
lr: float = 0.02,
weight_decay: float = 1e-4,
):
# Training loop
train(
"hardhat",
data=Dataset(
"datasets/hardhat",
columns=["image", "annotations"],
filters=("split = 'train'"),
)
model_type="ssd",
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment