Commit 6f2b0c1c authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

New training scripts

parent d2626448
Pipeline #58740 failed with stages
in 4 minutes and 13 seconds
from bob.bio.face.pytorch.datasets import MedsTorchDataset
# https://pytorch.org/docs/stable/data.html
from bob.extension import rc
import torch
from functools import partial
import torchvision.transforms as transforms
from bob.bio.face.pytorch.preprocessing import get_standard_data_augmentation
import os
PROTOCOL = "verification_fold1"
DATABASE_PATH = os.path.join(
rc.get("bob.bio.demographics.directory"), "meds", "samplewrapper"
)
DATABASE_EXTENSION = ".h5"
import logging
logger = logging.getLogger(__name__)
logger.info(f"Loading protocol {PROTOCOL} from {DATABASE_PATH}")
transform = get_standard_data_augmentation()
train_dataset = MedsTorchDataset(
protocol=PROTOCOL,
database_path=DATABASE_PATH,
database_extension=DATABASE_EXTENSION,
transform=transform,
take_from_znorm=False,
group="dev",
)
validation_dataset = MedsTorchDataset(
protocol=PROTOCOL,
database_path=DATABASE_PATH,
database_extension=DATABASE_EXTENSION,
transform=transform,
take_from_znorm=False,
group="eval",
)
from bob.bio.face.pytorch.datasets import MorphTorchDataset
# https://pytorch.org/docs/stable/data.html
from bob.extension import rc
import torch
from functools import partial
import torchvision.transforms as transforms
from bob.bio.face.pytorch.preprocessing import get_standard_data_augmentation
import os
PROTOCOL = "verification_fold1"
DATABASE_PATH = os.path.join(
rc.get("bob.bio.demographics.directory"), "morph", "samplewrapper"
)
DATABASE_EXTENSION = ".h5"
import logging
logger = logging.getLogger(__name__)
logger.info(f"Loading protocol {PROTOCOL} from {DATABASE_PATH}")
transform = get_standard_data_augmentation()
train_dataset = MorphTorchDataset(
protocol=PROTOCOL,
database_path=DATABASE_PATH,
database_extension=DATABASE_EXTENSION,
transform=transform,
take_from_znorm=False,
group="dev",
)
validation_dataset = MorphTorchDataset(
protocol=PROTOCOL,
database_path=DATABASE_PATH,
database_extension=DATABASE_EXTENSION,
transform=transform,
take_from_znorm=False,
group="eval",
)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment