Metadata-Version: 2.1
Name: brocolli
Version: 1.0.0
Summary: everything in pytorch
Home-page: https://github.com/inisis/brocolli
Author: desmond
Author-email: desmond.yao@buaa.edu.cn
License: UNKNOWN
Project-URL: Bug Tracker, https://github.com/inisis/brocolli/issues
Keywords: machine-learning,pytorch,caffe,torchfx
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: loguru
Requires-Dist: onnx (==1.9.0)
Requires-Dist: onnxruntime (==1.8.0)
Requires-Dist: tabulate

# brocolli

torch fx based pytorch model converter, including pytorch2caffe, pytorch2onnx.  
torch fx based pytorch model quantizier.

Pytorch version 1.9.0 and above are all supported  

# installation
```
pip install brocolli
```

# How to use
```
import torchvision.models as models
from brocolli.converter.pytorch_caffe_parser import PytorchCaffeParser

net = models.alexnet(pretrained=False)
pytorch_parser = PytorchCaffeParser(net, [(1, 3, 224, 223)])
pytorch_parser.convert()
pytorch_parser.save('alexnet.onnx')
```
user can run this script until you see "accuracy test passed" on screen, then you can get your caffe or trt model under tmp folder.

# Notice 
* ✔️ : support 
* ❔ : shall support
* ❌ : not support

Curently supported layers

|                    |Caffe|TensorRT|
|---                 |---|---|
|Conv                |✔️|✔️|
|PRelu               |✔️|❔|
|MaxPooling          |✔️|✔️|
|Sigmoid             |✔️|✔️|
|BatchNormalization  |✔️|✔️|
|Relu                |✔️|✔️|
|LeakyRelu           |✔️|✔️|
|Add                 |✔️|✔️|
|AvgPool             |✔️|✔️|
|Flatten             |✔️|✔️|
|FullyConnected      |✔️|✔️|
|Softmax             |✔️|✔️|
|Upsample            |✔️|✔️|
|Permute             |✔️|✔️|
|Concat              |✔️|✔️|
|Unsqueeze           |✔️|❔|
|Relu6               |✔️|✔️|
|Pad                 |✔️|✔️|
|HardSwish           |✔️|✔️|
|HardSigmoid         |✔️|✔️|
|Mul                 |✔️|✔️|
|Slice               |✔️|✔️|
|L2Normalization     |✔️|❔|
|Resize              |✔️|✔️|
|ReduceMean          |✔️|✔️|
|BilinearInterpolate |✔️|✔️|
|MaxUnPool           |✔️|❌|
|ConvTranspose       |✔️|✔️|
|Gather              |❌|✔️|
|PixelShufle         |✔️|❔|


Curently supported network

|          |Caffe|TensorRT|
|---       |---|---|
|SSD       |✔️|❔|
|AlexNet   |✔️|✔️|
|ResNet    |✔️|✔️|
|GoogleNet |✔️|✔️|
|SqueezeNet|✔️|✔️|
|MobileNet |✔️|✔️|
|DenseNet  |✔️|✔️|
|ShuffleNet|✔️|✔️|
|SCNN      |✔️|✔️|
|SegNet    |✔️|❌|
|YoloV5    |✔️|✔️|
|YoloV3    |✔️|✔️|
|Realcugan |✔️|❔|
|Yolo-Lite |✔️|❔|
|Resa      |❌|✔️|
|YoloX     |✔️|✔️|
|BiSeNet   |❌|✔️|
|fbnet     |✔️|❔|
|regnet    |✔️|❔|
|ghostnet  |✔️|❔|
|tinynet   |✔️|❔|
|YoloV7    |✔️|❔|

# TODO
RNN support

# Contact
 QQ Group: 597059928
 
 ![image](https://raw.githubusercontent.com/inisis/brocolli/master/imgs/QGRPOUP.png)


