Training Models Using MMDetection
How to Train Deep Learning models using Deep Lake's integration with MMDetection
How to Train Deep Learning models using Deep Lake and MMDetection
Integration Interface
import os
from mmcv import Config
import mmcv
from deeplake.integrations import mmdet as mmdet_deeplake
import argparse
def parse_args():
parser = argparse.ArgumentParser(description="Deep Lake Training Using MMDET")
parser.add_argument(
"--cfg_file",
type=str,
required=True,
help="Path for loading the config file",
)
parser.add_argument(
"--validate",
action="store_true",
default=True,
help="Whether to run dataset validation",
)
parser.add_argument(
"--distributed",
action="store_true",
default=False,
help="Whether to run distributed training",
)
parser.add_argument(
"--num_classes",
type=int,
default=None,
help="Number of classes in the model",
)
args = parser.parse_args()
return args
if __name__ == "__main__":
args = parse_args()
# Read the config file
cfg = Config.fromfile(args.cfg_file)
cfg.model.bbox_head.num_classes = args.num_classes
# Build the detector
model = mmdet_deeplake.build_detector(cfg.model)
# Create work_dir
mmcv.mkdir_or_exist(os.path.abspath(cfg.work_dir))
# Run the training
mmdet_deeplake.train_detector(model, cfg, distributed=args.distributed, validate=args.validate)Inputs to train_detector
Modifications to the cfg file
Passing Deep Lake dataset objects to the train_detector (Optional)
train_detector (Optional)What is MMDetection?
MMDetection Features
Custom Object Detection and Segmentation Pipelines
Comprehensive Training & Inference Support
Extensive Model Zoo & Configurations
Primary Components of MMDetection
MMDetection Backbone
MMDetection Head
MMDetection ROI Extractor
Loss
PreviousTraining an Image Classification Model in PyTorchNextTraining Models Using PyTorch Lightning
Was this helpful?