ZhengPeng7
commited on
Commit
Β·
d0e8e56
1
Parent(s):
8795865
Move all BiRefNet github codes to the first level directory.
Browse files- models/aspp.py +1 -1
- models/{modules/attentions.py β attentions.py} +0 -0
- birefnet.py β models/birefnet.py +6 -6
- models/{backbones/build_backbone.py β build_backbone.py} +2 -2
- models/{modules/decoder_blocks.py β decoder_blocks.py} +2 -2
- models/{modules/deform_conv.py β deform_conv.py} +0 -0
- models/{modules/ing.py β ing.py} +1 -1
- models/{modules/lateral_blocks.py β lateral_blocks.py} +0 -0
- models/{modules/mlp.py β mlp.py} +0 -0
- models/modules/refinement/refiner.py +5 -5
- models/modules/refinement/stem_layer.py +1 -1
- models/{modules/prompt_encoder.py β prompt_encoder.py} +0 -0
- models/{backbones/pvt_v2.py β pvt_v2.py} +0 -0
- models/{refinement/refiner.py β refiner.py} +5 -5
- models/{refinement/stem_layer.py β stem_layer.py} +1 -1
- models/{backbones/swin_v1.py β swin_v1.py} +0 -0
- models/{modules/utils.py β utils.py} +0 -0
models/aspp.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import torch
|
2 |
import torch.nn as nn
|
3 |
import torch.nn.functional as F
|
4 |
-
from models.
|
5 |
from config import Config
|
6 |
|
7 |
|
|
|
1 |
import torch
|
2 |
import torch.nn as nn
|
3 |
import torch.nn.functional as F
|
4 |
+
from models.deform_conv import DeformableConv2d
|
5 |
from config import Config
|
6 |
|
7 |
|
models/{modules/attentions.py β attentions.py}
RENAMED
File without changes
|
birefnet.py β models/birefnet.py
RENAMED
@@ -6,13 +6,13 @@ from huggingface_hub import PyTorchModelHubMixin
|
|
6 |
|
7 |
from config import Config
|
8 |
from dataset import class_labels_TR_sorted
|
9 |
-
from models.
|
10 |
-
from models.
|
11 |
-
from models.
|
12 |
from models.aspp import ASPP, ASPPDeformable
|
13 |
-
from models.
|
14 |
-
from models.
|
15 |
-
from models.
|
16 |
|
17 |
|
18 |
class BiRefNet(
|
|
|
6 |
|
7 |
from config import Config
|
8 |
from dataset import class_labels_TR_sorted
|
9 |
+
from models.build_backbone import build_backbone
|
10 |
+
from models.decoder_blocks import BasicDecBlk, ResBlk, HierarAttDecBlk
|
11 |
+
from models.lateral_blocks import BasicLatBlk
|
12 |
from models.aspp import ASPP, ASPPDeformable
|
13 |
+
from models.ing import *
|
14 |
+
from models.refiner import Refiner, RefinerPVTInChannels4, RefUNet
|
15 |
+
from models.stem_layer import StemLayer
|
16 |
|
17 |
|
18 |
class BiRefNet(
|
models/{backbones/build_backbone.py β build_backbone.py}
RENAMED
@@ -2,8 +2,8 @@ import torch
|
|
2 |
import torch.nn as nn
|
3 |
from collections import OrderedDict
|
4 |
from torchvision.models import vgg16, vgg16_bn, VGG16_Weights, VGG16_BN_Weights, resnet50, ResNet50_Weights
|
5 |
-
from models.
|
6 |
-
from models.
|
7 |
from config import Config
|
8 |
|
9 |
|
|
|
2 |
import torch.nn as nn
|
3 |
from collections import OrderedDict
|
4 |
from torchvision.models import vgg16, vgg16_bn, VGG16_Weights, VGG16_BN_Weights, resnet50, ResNet50_Weights
|
5 |
+
from models.pvt_v2 import pvt_v2_b0, pvt_v2_b1, pvt_v2_b2, pvt_v2_b5
|
6 |
+
from models.swin_v1 import swin_v1_t, swin_v1_s, swin_v1_b, swin_v1_l
|
7 |
from config import Config
|
8 |
|
9 |
|
models/{modules/decoder_blocks.py β decoder_blocks.py}
RENAMED
@@ -1,7 +1,7 @@
|
|
1 |
import torch
|
2 |
import torch.nn as nn
|
3 |
-
from models.
|
4 |
-
from models.
|
5 |
from config import Config
|
6 |
|
7 |
|
|
|
1 |
import torch
|
2 |
import torch.nn as nn
|
3 |
+
from models.aspp import ASPP, ASPPDeformable
|
4 |
+
from models.attentions import PSA, SGE
|
5 |
from config import Config
|
6 |
|
7 |
|
models/{modules/deform_conv.py β deform_conv.py}
RENAMED
File without changes
|
models/{modules/ing.py β ing.py}
RENAMED
@@ -1,5 +1,5 @@
|
|
1 |
import torch.nn as nn
|
2 |
-
from models.
|
3 |
|
4 |
|
5 |
class BlockA(nn.Module):
|
|
|
1 |
import torch.nn as nn
|
2 |
+
from models.mlp import MLPLayer
|
3 |
|
4 |
|
5 |
class BlockA(nn.Module):
|
models/{modules/lateral_blocks.py β lateral_blocks.py}
RENAMED
File without changes
|
models/{modules/mlp.py β mlp.py}
RENAMED
File without changes
|
models/modules/refinement/refiner.py
CHANGED
@@ -9,11 +9,11 @@ from torchvision.models import resnet50
|
|
9 |
|
10 |
from config import Config
|
11 |
from dataset import class_labels_TR_sorted
|
12 |
-
from models.
|
13 |
-
from models.
|
14 |
-
from models.
|
15 |
-
from models.
|
16 |
-
from models.
|
17 |
|
18 |
|
19 |
class RefinerPVTInChannels4(nn.Module):
|
|
|
9 |
|
10 |
from config import Config
|
11 |
from dataset import class_labels_TR_sorted
|
12 |
+
from models.build_backbone import build_backbone
|
13 |
+
from models.decoder_blocks import BasicDecBlk
|
14 |
+
from models.lateral_blocks import BasicLatBlk
|
15 |
+
from models.ing import *
|
16 |
+
from models.stem_layer import StemLayer
|
17 |
|
18 |
|
19 |
class RefinerPVTInChannels4(nn.Module):
|
models/modules/refinement/stem_layer.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import torch.nn as nn
|
2 |
-
from models.
|
3 |
|
4 |
|
5 |
class StemLayer(nn.Module):
|
|
|
1 |
import torch.nn as nn
|
2 |
+
from models.utils import build_act_layer, build_norm_layer
|
3 |
|
4 |
|
5 |
class StemLayer(nn.Module):
|
models/{modules/prompt_encoder.py β prompt_encoder.py}
RENAMED
File without changes
|
models/{backbones/pvt_v2.py β pvt_v2.py}
RENAMED
File without changes
|
models/{refinement/refiner.py β refiner.py}
RENAMED
@@ -9,11 +9,11 @@ from torchvision.models import resnet50
|
|
9 |
|
10 |
from config import Config
|
11 |
from dataset import class_labels_TR_sorted
|
12 |
-
from models.
|
13 |
-
from models.
|
14 |
-
from models.
|
15 |
-
from models.
|
16 |
-
from models.
|
17 |
|
18 |
|
19 |
class RefinerPVTInChannels4(nn.Module):
|
|
|
9 |
|
10 |
from config import Config
|
11 |
from dataset import class_labels_TR_sorted
|
12 |
+
from models.build_backbone import build_backbone
|
13 |
+
from models.decoder_blocks import BasicDecBlk
|
14 |
+
from models.lateral_blocks import BasicLatBlk
|
15 |
+
from models.ing import *
|
16 |
+
from models.stem_layer import StemLayer
|
17 |
|
18 |
|
19 |
class RefinerPVTInChannels4(nn.Module):
|
models/{refinement/stem_layer.py β stem_layer.py}
RENAMED
@@ -1,5 +1,5 @@
|
|
1 |
import torch.nn as nn
|
2 |
-
from models.
|
3 |
|
4 |
|
5 |
class StemLayer(nn.Module):
|
|
|
1 |
import torch.nn as nn
|
2 |
+
from models.utils import build_act_layer, build_norm_layer
|
3 |
|
4 |
|
5 |
class StemLayer(nn.Module):
|
models/{backbones/swin_v1.py β swin_v1.py}
RENAMED
File without changes
|
models/{modules/utils.py β utils.py}
RENAMED
File without changes
|