Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DWConvTranspose2d() module #7881

Merged
merged 12 commits into from
May 20, 2022
Merged

Add DWConvTranspose2d() module #7881

merged 12 commits into from
May 20, 2022

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented May 18, 2022

Add DWConvTranspose2d() module. @sergiossm

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Implementation of Depth-wise Transpose Convolutional layers in both PyTorch and TensorFlow for Ultralytics' YOLOv5.

πŸ“Š Key Changes

  • πŸ›  Added DWConvTranspose2d class in models/common.py which defines a new depth-wise transpose convolution operation in PyTorch.
  • ✨ Introduced TFDWConvTranspose2d class in models/tf.py, which is the TensorFlow equivalent of the new depth-wise transpose convolutional layer.
  • πŸ”§ Modified models/yolo.py and models/common.py to include depth-wise transpose convolutional layers in their respective model parsing methods.
  • πŸš€ Enhanced model architecture choices by allowing depth-wise transpose convolutions to be used in YOLO model definitions.

🎯 Purpose & Impact

  • πŸ“ˆ The new depth-wise transpose convolutional layers provide more architectural flexibility, potentially improving model performance for certain tasks.
  • 🐍 By supporting both PyTorch and TensorFlow, these changes enable a wider range of developers to experiment with and benefit from these layers.
  • πŸ” Users might expect better feature extraction capabilities and more efficient computation from models leveraging depth-wise transpose convolutions.

@glenn-jocher glenn-jocher changed the title Add DWConvTranspose2d() module Add DWConvTranspose2d() module May 18, 2022
@glenn-jocher glenn-jocher merged commit 5774a15 into master May 20, 2022
@glenn-jocher glenn-jocher deleted the update/ConvTranspose2d branch May 20, 2022 14:13
@glenn-jocher
Copy link
Member Author

glenn-jocher commented May 20, 2022

YOLOv5n v6.1 hyperplane CPU

benchmarks: weights=yolov5n.pt, imgsz=640, batch_size=1, data=/usr/src/app/data/coco128.yaml, device=cpu, half=False, test=False, pt_only=False
Checking setup...
YOLOv5 πŸš€ a9a92ae Python-3.8.10 torch-1.11.0+cpu CPU
Setup complete βœ… (96 CPUs, 1007.7 GB RAM, 1933.3/3519.3 GB disk)

Benchmarks complete (113.21s)
                   Format  mAP@0.5:0.95  Inference time (ms)
0                 PyTorch        0.3476                61.12
1             TorchScript        0.3476                52.30
2                    ONNX        0.3476                39.65
3                OpenVINO        0.3476                16.29
4                TensorRT           NaN                  NaN
5                  CoreML           NaN                  NaN
6   TensorFlow SavedModel        0.3476                61.50
7     TensorFlow GraphDef        0.3476                68.44
8         TensorFlow Lite        0.3470                95.77
9     TensorFlow Edge TPU           NaN                  NaN
10          TensorFlow.js           NaN                  NaN

YOLOv5n-7 hyperplane CPU

benchmarks: weights=yolov5n-7.pt, imgsz=640, batch_size=1, data=/usr/src/yolov5/data/coco128.yaml, device=cpu, half=False, test=False, pt_only=False
Checking setup...
YOLOv5 πŸš€ v6.1-207-g5774a15 Python-3.8.10 torch-1.11.0+cpu CPU
Setup complete βœ… (96 CPUs, 1007.7 GB RAM, 1933.3/3519.3 GB disk)

Benchmarks complete (188.59s)
                   Format  mAP@0.5:0.95  Inference time (ms)
0                 PyTorch        0.3376                56.29
1             TorchScript        0.3376                57.23
2                    ONNX        0.3376                49.70
3                OpenVINO        0.3376                16.61
4                TensorRT           NaN                  NaN
5                  CoreML           NaN                  NaN
6   TensorFlow SavedModel        0.3376                58.73
7     TensorFlow GraphDef        0.3376                75.64
8         TensorFlow Lite        0.3364                67.63
9     TensorFlow Edge TPU           NaN                  NaN
10          TensorFlow.js           NaN                  NaN

@glenn-jocher
Copy link
Member Author

YOLOv5x v6.1 hyperplane A100

benchmarks: weights=yolov5x.pt, imgsz=640, batch_size=1, data=data/coco.yaml, device=0, half=False, test=False, pt_only=False
Checking setup...
YOLOv5 πŸš€ v6.1-207-g5774a15 Python-3.8.13 torch-1.11.0+cu113 CUDA:0 (A100-SXM-80GB, 81251MiB)
Setup complete βœ… (96 CPUs, 1007.7 GB RAM, 1943.6/3519.3 GB disk)

Benchmarks complete (1519.56s)
                   Format  mAP@0.5:0.95  Inference time (ms)
0                 PyTorch        0.5006                14.21
1             TorchScript        0.5006                10.83
2                    ONNX        0.5006                16.84
3                OpenVINO           NaN                  NaN
4                TensorRT        0.5005                 3.33
5                  CoreML           NaN                  NaN
6   TensorFlow SavedModel        0.5006                28.31
7     TensorFlow GraphDef        0.5006                27.54
8         TensorFlow Lite           NaN                  NaN
9     TensorFlow Edge TPU           NaN                  NaN
10          TensorFlow.js           NaN                  NaN

YOLOv5x-7 v6.1 hyperplane A100

benchmarks: weights=yolov5x-7.pt, imgsz=640, batch_size=1, data=data/coco.yaml, device=1, half=False, test=False, pt_only=False
Checking setup...
YOLOv5 πŸš€ 5774a15 Python-3.8.13 torch-1.11.0+cu113 CUDA:0 (A100-SXM-80GB, 81251MiB)
Setup complete βœ… (96 CPUs, 1007.7 GB RAM, 1943.6/3519.3 GB disk)

Benchmarks complete (1754.20s)
                   Format  mAP@0.5:0.95  Inference time (ms)
0                 PyTorch        0.5046                13.90
1             TorchScript        0.5046                10.35
2                    ONNX        0.5046                16.45
3                OpenVINO           NaN                  NaN
4                TensorRT        0.5048                 2.95
5                  CoreML           NaN                  NaN
6   TensorFlow SavedModel        0.5046                55.90
7     TensorFlow GraphDef        0.5046                55.36
8         TensorFlow Lite           NaN                  NaN
9     TensorFlow Edge TPU           NaN                  NaN
10          TensorFlow.js           NaN                  NaN

tdhooghe pushed a commit to tdhooghe/yolov5 that referenced this pull request Jun 10, 2022
* Add DWConvTranspose2d() module

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add DWConvTranspose2d() module

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix

* Fix

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
* Add DWConvTranspose2d() module

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add DWConvTranspose2d() module

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix

* Fix

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants