Package: deeplite-torch-zoo
🚀 Deeplite Torch Zoo 🚀 is a collection of state-of-the-art efficient
computer vision models for embedded applications inPyTorch.For information on YOLOBench, clickhere.The main features of this library are:High-level API to create models, dataloaders, and evaluation functionsSingle interface for SOTA classification models:timm models,pytorchcv models,other SOTA efficient models (EdgeViT, FasterNet, GhostNetV2, MobileOne)Single interface for SOTA YOLO detectors (compatible withUltralytics training):YOLOv3, v4, v5, v6-3.0, v7, v8YOLO with timm backbonesother experimental configs📋 Table of contentQuick startInstallationTraining scriptsContributingCredit⏳ Quick startCreate a classification modelfromdeeplite_torch_zooimportget_model,list_modelsmodel=get_model(model_name='edgevit_xs',# model names for imagenet available via `list_models('imagenet')`dataset_name='imagenet',# dataset name, since resnet18 is different for e.g. imagenet and cifar100pretrained=False,# if True, will try to load a pre-trained checkpoint)# creating a model with 42 classes for transfer learning:model=get_model(model_name='fasternet_t0',# model names for imagenet available via `list_models('imagenet')`num_classes=42,# number of classes for transfer learningdataset_name='imagenet',# take weights from checkpoint pre-trained on this datasetpretrained=False,# if True, will try to load all weights with matching tensor shapes)Create an object detection modelfromdeeplite_torch_zooimportget_modelmodel=get_model(model_name='yolo4n',# creates a YOLOv4n model on COCOdataset_name='coco',# (`n` corresponds to width factor 0.25, depth factor 0.33)pretrained=False,# if True, will try to load a pre-trained checkpoint)# one could create a YOLO model with timm backbone,# PAN neck and YOLOv8 decoupled anchor-free head like this:model=get_model(model_name='yolo_timm_fbnetv3_d',# creates a YOLO with FBNetV3-d backbone from timmdataset_name='coco',#pretrained=False,# if True, will try to load a pre-trained checkpointcustom_head='yolo8',# will replace default detection head# with YOLOv8 detection head)Create PyTorch dataloadersfromdeeplite_torch_zooimportget_dataloadersdataloaders=get_dataloaders(data_root='./',# folder with data, will be used for downloaddataset_name='imagewoof',# datasets to if applicable,num_workers=8,# number of dataloader workersbatch_size=64,# dataloader batch size (train and test))# dataloaders['train'] -> train dataloader# dataloaders['test'] -> test dataloader## see below for the list of supported datasetsThe list of supported datasets is available forclassificationandobject detection.Creating an evaluation functionfromdeeplite_torch_zooimportget_eval_functioneval_function=get_eval_function(model_name='yolo8s',dataset_name='voc',)# required arg signature is fixed for all eval functionsmetrics=eval_function(model,test_dataloader)(Experimental) Training with patched Ultralytics trainerfromdeeplite_torch_zoo.trainerimportDetectormodel=Detector(model_name='yolo7n')# will create a wrapper around YOLOv7n model# (YOLOv7n model with YOLOv8 detection head)model.train(data='VOC.yaml',epochs=100)# same arguments as Ultralytics trainer# alternatively:torch_model=get_model(model_name='yolo7n',dataset_name='coco',pretrained=False,custom_head='yolo8',)model=Detector(torch_model=torch_model)# either `model_name` or `torch_model`model.train(data='VOC.yaml',epochs=100)# should be provided🛠 InstallationPyPI version:$pipinstalldeeplite-torch-zooLatest version from source:$pipinstallgit+https://github.com/Deeplite/deeplite-torch-zoo.git💪 Training scriptsWe provide several training scripts as an example of howdeeplite-torch-zoocan be integrated into existing training pipelines:modified timm ImageNet scriptsupport for Knowledge Distillationtraining recipes provides (A1, A2, A3,USI, etc.)modfied Ultralytics classification fine-tuning scriptmodfied Ultralytics YOLOv5 object detector training script🤝 ContributingWe always welcome community contributions to expand the scope ofdeeplite-torch-zooand also to have additional new models and datasets. Please refer to thedocumentationfor the detailed steps on how to add a model and dataset. In general, we follow thefork-and-pullGit workflow.Forkthe repo on GitHubClonethe project to your own machineCommitchanges to your own branchPushyour work back up to your forkSubmit aPull requestso that we can review your changesNOTE: Be sure to merge the latest from "upstream" before making a pull request!🙏 CreditRepositories used to build Deeplite Torch ZooObject DetectionYOLOv3 implementation:ultralytics/yolov3YOLOv5 implementation:ultralytics/yolov5flexible-yolov5 implementation:Bobo-y/flexible-yolov5YOLOv8 implementation:ultralytics/ultralyticsYOLOv7 implementation:WongKinYiu/yolov7YOLOX implementation:iscyy/yoloairwesterndigitalcorporation/YOLOv3-in-PyTorchSegmentationThe implementation of deeplab:pytorch-deeplab-xceptionThe implementation of unet_scse:nyoki-mtl/pytorch-segmentationThe implementation of fcn:wkentaro/pytorch-fcnThe implementation of Unet:milesial/Pytorch-UNetClassificationThe implementation of models on CIFAR100 dataset:kuangliu/pytorch-cifarThe implementation of Mobilenetv1 model on VWW dataset:qfgaohao/pytorch-ssdThe implementation of Mobilenetv3 model on VWW dataset:d-li14/mobilenetv3.pytorchDNN building block implementationsd-li14/mobilenetv2.pytorchd-li14/efficientnetv2.pytorchapple/ml-mobileoneosmr/imgclsmobhuggingface/pytorch-image-modelsmoskomule/senet.pytorchDingXiaoH/RepLKNet-pytorchhuawei-noah/Efficient-AI-BackbonesMisctorchvision dataset implementations:pytorch/visionMLP implementation:aaron-xichen/pytorch-playgroundAutoAugment implementation:DeepVoltaire/AutoAugmentCutout implementation:uoguelph-mlrg/CutoutRobustness measurement image distortions:hendrycks/robustnessRegistry implementation:openvinotoolkit/openvino/tools/pot