def main_custom_vgg(start_from_best_model=True, with_data_aug=True):
    model = Custom_vgg(1, len(config["catslist"]), DEVICE)
    if start_from_best_model:
        print("Loading model from current best model")
        model.load_state_dict(
            torch.load(config["current_best_model"], map_location=DEVICE))
    return main(
        model, lambda pixelstring_batch, emotions_batch, DEVICE:
        preprocess_batch_custom_vgg(pixelstring_batch, emotions_batch, DEVICE,
                                    with_data_aug, config["loss_mode"]))
 def preprocess_batch(pixelstring_batch, emotions_batch, DEVICE):
     if model_type == "CustomVGG":
         return preprocess_batch_custom_vgg(pixelstring_batch,
                                            emotions_batch, DEVICE, False,
                                            config["loss_mode"])
     elif model_type == "DenseSIFTHybrid":
         return preprocess_batch_dense_sift_hybrid(pixelstring_batch,
                                                   emotions_batch, DEVICE,
                                                   False,
                                                   config["loss_mode"])
     elif model_type == "SIFTHybrid":
         return preprocess_batch_sift_hybrid(pixelstring_batch,
                                             emotions_batch, DEVICE, False,
                                             config["loss_mode"])
 def preprocess_batch(pixelstring_batch, emotions_batch, DEVICE):
     return preprocess_batch_custom_vgg(pixelstring_batch, emotions_batch,
                                        DEVICE, False, config["loss_mode"])