Skip to content

Commit 64ac16d

Browse files
Kwon Tae WanKwon Tae Wan
authored andcommitted
Migrate from hotcouscous1
0 parents  commit 64ac16d

92 files changed

Lines changed: 8393 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.DS_Store

8 KB
Binary file not shown.

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 46 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/tensorbricks.iml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2022, Kwon Taewan
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
1. Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
2. Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
3. Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
# TensorBricks : Toward Structuralism in Deep-Learning
2+
PyTorch-based framework for high-level development of image models
3+
4+
TensorBricks builds models up by various combinations of compatible modules, beyond a collection of implementations.
5+
6+
7+
## Customize Your Own Models
8+
### Object-Oriented-Structuring
9+
We don't build Legos by adding just one brick at a time. Instead, we build a bundle of **substructures** and combine them.
10+
11+
Likewise, convolution models for the same performance are usually built in the homogeneous structure. We can have **compatibility** among them, 1) if the start and end of the algorithm are consistent in every models, 2) consistent in each set of substructures that occupy equivalent position in the model, 3) and if any substructure's end and the following substructure's start are not occluded or departed.
12+
13+
OOS is TensorBricks code-style to provide compatibility of convolution models and their sub-modules. OOS proposes explicit seperation between modules, and build their structural hierarchy in bottom-up manner. And this is very necessary for our main purposes, **combinational building** and **flexible replacement**.
14+
15+
16+
### 1. Backbone
17+
Every backbones of OOS consist of stages, stages consist of blocks, and blocks consist of layers. You can access any stage, block or layer of the backbone implemented in OOS, to get features.
18+
19+
```python
20+
from backbone.efficientnet import *
21+
from backbone.feature_extractor import FeatureExtractor
22+
23+
backbone = efficientnet_b3_backbone(pretrained=True)
24+
25+
del backbone.conv_last.layer[:]
26+
del backbone.widths[-1]
27+
28+
backbone = FeatureExtractor(backbone, ['stage3', 'stage5', 'stage7'])
29+
```
30+
31+
### 2. FPN
32+
OOS proposes dynamic implementations of FPN. They are free from the number of pyramid levels and strides on the size of input image, while strictly following papers and reference codes.
33+
34+
```python
35+
from fpn.pan import PAN
36+
37+
fpn = PAN(3, backbone.widths[3: 8: 2], 256)
38+
```
39+
40+
### 3. Head
41+
Every heads of OOS are consistent in the form of prediction. Classifiers in any performance do not contain possibilities, and dense predictions of detection models are arranged from bottom to top at the pyramid level and from left-top to bottom-right on a feature.
42+
43+
OOS provides an efficient anchor-maker, synchronized with any detection prediction. It supports the anchor-priors and the box format of every series. And it is fast, since it can generate anchor boxes before forward, given the size of input image.
44+
45+
```python
46+
from head.detection.yolo import Yolo_V4_Head
47+
48+
head = Yolo_V4_Head(3, [256, 256, 256], [4, 4, 4], 80, [8, 16, 32], Act=nn.SiLU())
49+
```
50+
51+
### 4. Frame
52+
No model is created from nothing. It is derived from previous works and share some conventions along the series of developments. OOS implements the most basic attributes among models in the series as Frame. Therefore, to combine them all, you only need to put the substructures above into the frame.
53+
54+
```python
55+
from model.detection.yolo import Yolo_Frame
56+
57+
frame = Yolo_Frame
58+
59+
frame.anchor_sizes = [
60+
[(13, 17), (31, 25), (24, 51), (61, 45)],
61+
[(48, 102), (119, 96), (97, 189), (217, 184)],
62+
[(171, 384), (324, 451), (616, 618), (800, 800)]
63+
]
64+
frame.strides = [8, 16, 32]
65+
66+
model = frame(896)
67+
68+
model.backbone = backbone
69+
model.fpn = fpn
70+
model.head = head
71+
```
72+
73+
*Wow! You now have a new model, EfficientNet-PAN-YoloV4.*
74+
75+
### 5. Upgrade your model through replacement
76+
Also, you can upgrade the model by replacing one of the substructures, instead of building from scratch, within the series.
77+
78+
```python
79+
from fpn.bifpn import BiFPN
80+
81+
fpn = BiFPN(3, 6, backbone.widths[3: 8: 2], 256)
82+
model.fpn = fpn
83+
```
84+
85+
*Holy cow! Now you get EfficientNet-BiFPN-YoloV4.*
86+
87+
(This is not Efficient-Yolo)
88+
89+
## Now We Are Supporting
90+
Now, we are supporting clasification models and one-stage detection models using anchors.
91+
92+
### Classification
93+
* ResNet - https://arxiv.org/abs/1512.03385
94+
* Wide-ResNet - https://arxiv.org/abs/1605.07146
95+
* ResNeXt - https://arxiv.org/abs/1611.05431
96+
* Res2Net - https://arxiv.org/abs/1904.01169
97+
* Res2NeXt
98+
* Res2Net-v1b
99+
* VGG - https://arxiv.org/abs/1409.1556
100+
* MobileNetV1 - https://arxiv.org/abs/1704.04861
101+
* MobileNetV2 - https://arxiv.org/abs/1801.04381
102+
* MNASNet - https://arxiv.org/abs/1807.11626
103+
* MobileNetV3 - https://arxiv.org/abs/1905.02244
104+
* MobileNetV3-Large
105+
* MobileNetV3-Small
106+
* EfficientNet - https://arxiv.org/abs/1905.11946
107+
* ReXNet - https://arxiv.org/abs/2007.00992
108+
109+
### Detection
110+
* YoloV3 - https://arxiv.org/abs/1804.02767
111+
* YoloV3-SPP
112+
* YoloV3-Tiny
113+
* YoloV4 - https://arxiv.org/abs/2004.10934
114+
* Scaled-YoloV4 - https://arxiv.org/abs/2011.08036
115+
* YoloV4-CSP
116+
* YoloV4-Large-P5/P6/P7
117+
* YoloV4-Tiny
118+
* SSD - https://arxiv.org/abs/1512.02325
119+
* SSD300/512
120+
* SSD FPN
121+
* DSSD - https://arxiv.org/abs/1701.06659
122+
* SSD321/513
123+
* DSSD321/513
124+
* SSDLite - https://arxiv.org/abs/1801.04381
125+
* MobileNetV2
126+
* MobileNetV3-Large
127+
* MobileNetV3-Small
128+
* RetinaNet - https://arxiv.org/abs/1708.02002
129+
* EfficientDet -https://arxiv.org/abs/1911.09070
130+
131+
### New Model
132+
* Efficient-Yolo
133+
* RetinaNet-Res2Net-PAN
134+
* SSDLite-ReXNet-BiFPN
135+
136+
We are developing training and inference frameworks applicable to every models.
137+
138+
More image models such as vision transformers, two-stage detection models and non-anchor detection models, segmentation models, will be updated.
139+
140+
### Checkpoints
141+
The clasification models are provided with checkpoints trained on the ImageNet. For detection, only YOLO and SSD models are provided with checkpoints trained in COCO dataset.
142+
143+
The checkpoints are borrowed from the official or famously forked repositories with permissive licenses (Apache, BSD, MIT), annotated in each class, and they are fully tested.
144+
145+
TensorBricks' own-trained checkpoints will be released in the near future.
146+
147+
148+
## What's New
149+
### Ver. 1.0
150+
* Mar 7, 2022
151+
* Start Uploading
152+
153+
### Ver. 1.1
154+
* Mar 23, 2022
155+
* Upload Efficient-Yolo / RetinaNet-Res2Net-PAN / SSDLite-ReXNet-BiFPN
156+
157+
158+
## License
159+
This TensorBricks distribution contains no code licensed under GPL or other kinds of CopyLeft license. It is licensed under BSD-3-Clause which is permissive.

0 commit comments

Comments
 (0)