{"id":14958158,"url":"https://github.com/deeplite/deeplite-torch-zoo","last_synced_at":"2025-04-04T10:09:05.246Z","repository":{"id":39012225,"uuid":"354935720","full_name":"Deeplite/deeplite-torch-zoo","owner":"Deeplite","description":"Collection of SOTA efficient computer vision models for embedded applications, with pre-trained weights and training recipes","archived":false,"fork":false,"pushed_at":"2025-03-19T10:24:07.000Z","size":41393,"stargazers_count":88,"open_issues_count":18,"forks_count":10,"subscribers_count":5,"default_branch":"develop","last_synced_at":"2025-03-19T11:31:00.289Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Deeplite.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-05T18:40:01.000Z","updated_at":"2025-01-27T17:12:58.000Z","dependencies_parsed_at":"2022-07-13T06:50:47.564Z","dependency_job_id":"34994bf4-6b7e-4713-bc1e-3033f9107f9c","html_url":"https://github.com/Deeplite/deeplite-torch-zoo","commit_stats":{"total_commits":487,"total_committers":25,"mean_commits":19.48,"dds":0.7823408624229979,"last_synced_commit":"5e2203686ec1ee0bc7078457c883aa5405e104d1"},"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Deeplite%2Fdeeplite-torch-zoo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Deeplite%2Fdeeplite-torch-zoo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Deeplite%2Fdeeplite-torch-zoo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Deeplite%2Fdeeplite-torch-zoo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Deeplite","download_url":"https://codeload.github.com/Deeplite/deeplite-torch-zoo/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244759955,"owners_count":20505716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T13:16:23.255Z","updated_at":"2025-03-21T08:08:02.544Z","avatar_url":"https://github.com/Deeplite.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n  ![logo](https://docs.deeplite.ai/neutrino/_static/content/deeplite-logo-color.png)\n\n  **🚀 Deeplite Torch Zoo 🚀 is a collection of state-of-the-art efficient\n  computer vision models for embedded applications in [PyTorch](https://pytorch.org/).**\n\n  [![Build Status](https://travis-ci.com/Deeplite/deeplite-torch-zoo.svg?token=kodd5rKMpjxQDqRCxwiV\u0026branch=master)](https://travis-ci.com/Deeplite/deeplite-torch-zoo) [![codecov](https://codecov.io/gh/Deeplite/deeplite-torch-zoo/branch/master/graph/badge.svg?token=AVTp3PW5UP)](https://codecov.io/gh/Deeplite/deeplite-torch-zoo)\n\n\u003c/div\u003e\n\n**For information on YOLOBench, click [here](results/yolobench).**\n\nThe main features of this library are:\n\n - High-level API to create models, dataloaders, and evaluation functions\n - Single interface for SOTA classification models:\n    - [timm models](https://github.com/huggingface/pytorch-image-models/),\n    - [pytorchcv models](https://github.com/osmr/imgclsmob/tree/master/pytorch),\n    - other SOTA efficient models (EdgeViT, FasterNet, GhostNetV2, MobileOne)\n - Single interface for SOTA YOLO detectors (compatible with [Ultralytics training](https://github.com/ultralytics/ultralytics)):\n    - YOLOv3, v4, v5, v6-3.0, v7, v8\n    - YOLO with timm backbones\n    - [other experimental configs](https://github.com/Deeplite/deeplite-torch-zoo/tree/develop/deeplite_torch_zoo/src/object_detection/yolov5/configs)\n\n### 📋 Table of content\n 1. [Quick start](#start)\n 2. [Installation](#installation)\n 3. [Training scripts](#training-scripts)\n 7. [Contributing](#contributing)\n 9. [Credit](#credit)\n\n\n### ⏳ Quick start \u003ca name=\"start\"\u003e\u003c/a\u003e\n\n#### Create a classification model\n\n```python\nfrom deeplite_torch_zoo import get_model, list_models\n\nmodel = get_model(\n    model_name='edgevit_xs',        # model names for imagenet available via `list_models('imagenet')`\n    dataset_name='imagenet',        # dataset name, since resnet18 is different for e.g. imagenet and cifar100\n    pretrained=False,               # if True, will try to load a pre-trained checkpoint\n)\n\n# creating a model with 42 classes for transfer learning:\n\nmodel = get_model(\n    model_name='fasternet_t0',        # model names for imagenet available via `list_models('imagenet')`\n    num_classes=42,                   # number of classes for transfer learning\n    dataset_name='imagenet',   # take weights from checkpoint pre-trained on this dataset\n    pretrained=False,                 # if True, will try to load all weights with matching tensor shapes\n)\n```\n\n#### Create an object detection model\n\n```python\nfrom deeplite_torch_zoo import get_model\n\nmodel = get_model(\n    model_name='yolo4n',        # creates a YOLOv4n model on COCO\n    dataset_name='coco',        # (`n` corresponds to width factor 0.25, depth factor 0.33)\n    pretrained=False,           # if True, will try to load a pre-trained checkpoint\n)\n\n# one could create a YOLO model with timm backbone,\n# PAN neck and YOLOv8 decoupled anchor-free head like this:\n\nmodel = get_model(\n    model_name='yolo_timm_fbnetv3_d',    # creates a YOLO with FBNetV3-d backbone from timm\n    dataset_name='coco',                 #\n    pretrained=False,                    # if True, will try to load a pre-trained checkpoint\n    custom_head='yolo8',                 # will replace default detection head\n                                         # with YOLOv8 detection head\n)\n```\n\n#### Create PyTorch dataloaders\n\n```python\nfrom deeplite_torch_zoo import get_dataloaders\n\ndataloaders = get_dataloaders(\n    data_root='./',                      # folder with data, will be used for download\n    dataset_name='imagewoof',            # datasets to if applicable,\n    num_workers=8,                       # number of dataloader workers\n    batch_size=64,                       # dataloader batch size (train and test)\n)\n\n# dataloaders['train'] -\u003e train dataloader\n# dataloaders['test'] -\u003e test dataloader\n#\n# see below for the list of supported datasets\n```\n\nThe list of supported datasets is available for [classification](https://github.com/Deeplite/deeplite-torch-zoo/blob/develop/docs/CLASSIFICATION.md) and [object detection](https://github.com/Deeplite/deeplite-torch-zoo/blob/develop/docs/OBJECT_DETECTION.md).\n\n#### Creating an evaluation function\n\n```python\nfrom deeplite_torch_zoo import get_eval_function\n\neval_function = get_eval_function(\n    model_name='yolo8s',\n    dataset_name='voc',\n)\n\n# required arg signature is fixed for all eval functions\nmetrics = eval_function(model, test_dataloader)\n```\n\n#### (Experimental) Training with patched Ultralytics trainer\n\n```python\nfrom deeplite_torch_zoo.trainer import Detector\n\nmodel = Detector(model_name='yolo7n')        # will create a wrapper around YOLOv7n model\n                                             # (YOLOv7n model with YOLOv8 detection head)\nmodel.train(data='VOC.yaml', epochs=100)     # same arguments as Ultralytics trainer\n\n# alternatively:\n\ntorch_model = get_model(\n    model_name='yolo7n',\n    dataset_name='coco',\n    pretrained=False,\n    custom_head='yolo8',\n)\nmodel = Detector(torch_model=torch_model)    # either `model_name` or `torch_model`\nmodel.train(data='VOC.yaml', epochs=100)     # should be provided\n\n```\n\n### 🛠 Installation \u003ca name=\"installation\"\u003e\u003c/a\u003e\nPyPI version:\n```bash\n$ pip install deeplite-torch-zoo\n````\nLatest version from source:\n```bash\n$ pip install git+https://github.com/Deeplite/deeplite-torch-zoo.git\n````\n\n### 💪 Training scripts \u003ca name=\"training-scripts\"\u003e\u003c/a\u003e\n\nWe provide several training scripts as an example of how `deeplite-torch-zoo` can be integrated into existing training pipelines:\n\n\n- [modified timm ImageNet script](https://github.com/Deeplite/deeplite-torch-zoo/tree/develop/training_scripts/classification/imagenet)\n\n  - support for Knowledge Distillation\n  - training recipes provides (A1, A2, A3, [USI](https://github.com/Alibaba-MIIL/Solving_ImageNet), etc.)\n- [modfied Ultralytics classification fine-tuning script](https://github.com/Deeplite/deeplite-torch-zoo/tree/develop/training_scripts/classification/ultralytics)\n- [modfied Ultralytics YOLOv5 object detector training script](https://github.com/Deeplite/deeplite-torch-zoo/tree/develop/training_scripts/object_detection)\n\n\n### 🤝 Contributing \u003ca name=\"contributing\"\u003e\u003c/a\u003e\n\nWe always welcome community contributions to expand the scope of `deeplite-torch-zoo` and also to have additional new models and datasets. Please refer to the [documentation](https://docs.deeplite.ai/neutrino/zoo.html#contribute-a-model-dataset-to-the-zoo) for the detailed steps on how to add a model and dataset. In general, we follow the `fork-and-pull` Git workflow.\n\n 1. **Fork** the repo on GitHub\n 2. **Clone** the project to your own machine\n 3. **Commit** changes to your own branch\n 4. **Push** your work back up to your fork\n 5. Submit a **Pull request** so that we can review your changes\n\nNOTE: Be sure to merge the latest from \"upstream\" before making a pull request!\n\n## 🙏 Credit \u003ca name=\"credit\"\u003e\u003c/a\u003e\n\n\u003cdetails\u003e\n\n  \u003csummary\u003eRepositories used to build Deeplite Torch Zoo\u003c/summary\u003e\n\n### Object Detection\n- YOLOv3 implementation: [ultralytics/yolov3](https://github.com/ultralytics/yolov3)\n- YOLOv5 implementation: [ultralytics/yolov5](https://github.com/ultralytics/yolov5)\n- flexible-yolov5 implementation: [Bobo-y/flexible-yolov5](https://github.com/Bobo-y/flexible-yolov5)\n- YOLOv8 implementation: [ultralytics/ultralytics](https://github.com/ultralytics/ultralytics)\n- YOLOv7 implementation: [WongKinYiu/yolov7](https://github.com/WongKinYiu/yolov7)\n- YOLOX implementation: [iscyy/yoloair](https://github.com/iscyy/yoloair)\n- [westerndigitalcorporation/YOLOv3-in-PyTorch](https://github.com/westerndigitalcorporation/YOLOv3-in-PyTorch)\n\n### Segmentation\n- The implementation of deeplab: [pytorch-deeplab-xception](https://github.com/jfzhang95/pytorch-deeplab-xception)\n- The implementation of unet_scse: [nyoki-mtl/pytorch-segmentation](https://github.com/nyoki-mtl/pytorch-segmentation)\n- The implementation of fcn: [wkentaro/pytorch-fcn](https://github.com/wkentaro/pytorch-fcn)\n- The implementation of Unet: [milesial/Pytorch-UNet](https://github.com/milesial/Pytorch-UNet)\n\n### Classification\n- The implementation of models on CIFAR100 dataset: [kuangliu/pytorch-cifar](https://github.com/kuangliu/pytorch-cifar)\n- The implementation of Mobilenetv1 model on VWW dataset: [qfgaohao/pytorch-ssd](https://github.com/qfgaohao/pytorch-ssd)\n- The implementation of Mobilenetv3 model on VWW dataset: [d-li14/mobilenetv3.pytorch](https://github.com/d-li14/mobilenetv3.pytorch)\n\n### DNN building block implementations\n- [d-li14/mobilenetv2.pytorch](https://github.com/d-li14/mobilenetv2.pytorch)\n- [d-li14/efficientnetv2.pytorch](https://github.com/d-li14/efficientnetv2.pytorch)\n- [apple/ml-mobileone](https://github.com/apple/ml-mobileone)\n- [osmr/imgclsmob](https://github.com/osmr/imgclsmob)\n- [huggingface/pytorch-image-models](https://github1s.com/huggingface/pytorch-image-models)\n- [moskomule/senet.pytorch](https://github.com/moskomule/senet.pytorch)\n- [DingXiaoH/RepLKNet-pytorch](https://github.com/DingXiaoH/RepLKNet-pytorch)\n- [huawei-noah/Efficient-AI-Backbones](https://github.com/huawei-noah/Efficient-AI-Backbones)\n\n\n### Misc\n- torchvision dataset implementations: [pytorch/vision](https://github.com/pytorch/vision)\n- MLP implementation: [aaron-xichen/pytorch-playground](https://github.com/aaron-xichen/pytorch-playground)\n- AutoAugment implementation: [DeepVoltaire/AutoAugment](https://github.com/DeepVoltaire/AutoAugment)\n- Cutout implementation: [uoguelph-mlrg/Cutout](https://github.com/uoguelph-mlrg/Cutout)\n- Robustness measurement image distortions: [hendrycks/robustness](https://github.com/hendrycks/robustness)\n- Registry implementation: [openvinotoolkit/openvino/tools/pot](https://github.com/openvinotoolkit/openvino/blob/master/tools/pot)\n- Torch profiler implementation: [zhijian-liu/torchprofile](https://github.com/zhijian-liu/torchprofile)\n\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeeplite%2Fdeeplite-torch-zoo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeeplite%2Fdeeplite-torch-zoo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeeplite%2Fdeeplite-torch-zoo/lists"}