Skip to content

Commit

Permalink
Rename all arch directories to __arch (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment authored Jul 7, 2024
1 parent baff63e commit 64d3c2b
Show file tree
Hide file tree
Showing 180 changed files with 566 additions and 566 deletions.
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ Of course, the copy this code, we first have to find it! Unfortunately, project

In the case of DITN, the file is called [`models/DITN_Real.py`](https://github.com/yongliuy/DITN/blob/3438e429c0538ee5061a7cfca587df0c4097703f/models/DITN_Real.py#L197).

Once you have found the file, create a new directory `libs/spandrel/architectures/<arch name>/arch/` and copy the file into it. This directory will contain all code that we will copy. Since we respect the copy right of the original authors, we will also copy the `LICENSE` file of the repo into this directory.
Once you have found the file, create a new directory `libs/spandrel/architectures/<arch name>/__arch/` and copy the file into it. This directory will contain all code that we will copy. Since we respect the copy right of the original authors, we will also copy the `LICENSE` file of the repo into this directory.

In the case of DITN, we copy `models/DITN_Real.py` to `libs/spandrel/architectures/DITN/arch/DITN_Real.py` and add the `LICENSE` file of the repo.
In the case of DITN, we copy `models/DITN_Real.py` to `libs/spandrel/architectures/DITN/__arch/DITN_Real.py` and add the `LICENSE` file of the repo.

The main model file might also reference other files in the repo. You have to copy those files into your `arch/` directory as well.
The main model file might also reference other files in the repo. You have to copy those files into your `__arch/` directory as well.

In the case of DITN, the main model file doesn't reference any other files, so we are done.

Expand Down Expand Up @@ -160,7 +160,7 @@ Create a file `libs/spandrel/architectures/<arch name>/__init__.py` and add the

```python
from ...__helpers.model_descriptor import ImageModelDescriptor, StateDict
from .arch.ARCH_NAME import ARCH_NAME
from .__arch.ARCH_NAME import ARCH_NAME


def load(state_dict: StateDict) -> ImageModelDescriptor[ARCH_NAME]:
Expand Down Expand Up @@ -205,7 +205,7 @@ In the case of DITN, the filled in template looks like this:

```python
from ...__helpers.model_descriptor import ImageModelDescriptor, StateDict
from .arch.DITN_Real import DITN_Real as DITN
from .__arch.DITN_Real import DITN_Real as DITN


def load(state_dict: StateDict) -> ImageModelDescriptor[DITN]:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,4 @@ Here are some cool projects that use Spandrel:

## License

This repo is bounded by the MIT license. However, the code of implemented architectures (everything inside an `arch/` directory) is bound by their original respective licenses (which are included in their respective `arch/` directories).
This repo is bounded by the MIT license. However, the code of implemented architectures (everything inside an `__arch/` directory) is bound by their original respective licenses (which are included in their respective `__arch/` directories).
2 changes: 1 addition & 1 deletion libs/spandrel/spandrel/architectures/ATD/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
SizeRequirements,
StateDict,
)
from .arch.atd_arch import ATD
from .__arch.atd_arch import ATD


class ATDArch(Architecture[ATD]):
Expand Down
2 changes: 1 addition & 1 deletion libs/spandrel/spandrel/architectures/CRAFT/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
SizeRequirements,
StateDict,
)
from .arch.CRAFT import CRAFT
from .__arch.CRAFT import CRAFT


class CRAFTArch(Architecture[CRAFT]):
Expand Down
2 changes: 1 addition & 1 deletion libs/spandrel/spandrel/architectures/Compact/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from spandrel.util import KeyCondition, get_scale_and_output_channels, get_seq_len

from ...__helpers.model_descriptor import Architecture, ImageModelDescriptor, StateDict
from .arch.SRVGG import SRVGGNetCompact
from .__arch.SRVGG import SRVGGNetCompact


class CompactArch(Architecture[SRVGGNetCompact]):
Expand Down
2 changes: 1 addition & 1 deletion libs/spandrel/spandrel/architectures/DAT/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
SizeRequirements,
StateDict,
)
from .arch.DAT import DAT
from .__arch.DAT import DAT


class DATArch(Architecture[DAT]):
Expand Down
2 changes: 1 addition & 1 deletion libs/spandrel/spandrel/architectures/DCTLSA/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
SizeRequirements,
StateDict,
)
from .arch.dctlsa import DCTLSA
from .__arch.dctlsa import DCTLSA


class DCTLSAArch(Architecture[DCTLSA]):
Expand Down
2 changes: 1 addition & 1 deletion libs/spandrel/spandrel/architectures/DITN/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
SizeRequirements,
StateDict,
)
from .arch.DITN_Real import DITN_Real as DITN
from .__arch.DITN_Real import DITN_Real as DITN


class DITNArch(Architecture[DITN]):
Expand Down
2 changes: 1 addition & 1 deletion libs/spandrel/spandrel/architectures/DRCT/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
SizeRequirements,
StateDict,
)
from .arch.drct_arch import DRCT
from .__arch.drct_arch import DRCT


class DRCTArch(Architecture[DRCT]):
Expand Down
2 changes: 1 addition & 1 deletion libs/spandrel/spandrel/architectures/DRUNet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
SizeRequirements,
StateDict,
)
from .arch.network_unet import DRUNet
from .__arch.network_unet import DRUNet


class DRUNetArch(Architecture[DRUNet]):
Expand Down
2 changes: 1 addition & 1 deletion libs/spandrel/spandrel/architectures/DnCNN/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
SizeRequirements,
StateDict,
)
from .arch.network_dncnn import DnCNN
from .__arch.network_dncnn import DnCNN


class DnCNNArch(Architecture[DnCNN]):
Expand Down
2 changes: 1 addition & 1 deletion libs/spandrel/spandrel/architectures/ESRGAN/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
SizeRequirements,
StateDict,
)
from .arch.RRDB import RRDBNet
from .__arch.RRDB import RRDBNet


def _new_to_old_arch(state: StateDict, state_map: dict, num_blocks: int):
Expand Down
2 changes: 1 addition & 1 deletion libs/spandrel/spandrel/architectures/FBCNN/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from spandrel.util import KeyCondition, get_seq_len

from ...__helpers.model_descriptor import Architecture, ImageModelDescriptor, StateDict
from .arch.FBCNN import FBCNN
from .__arch.FBCNN import FBCNN


class FBCNNArch(Architecture[FBCNN]):
Expand Down
2 changes: 1 addition & 1 deletion libs/spandrel/spandrel/architectures/FFTformer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
SizeRequirements,
StateDict,
)
from .arch.fftformer_arch import FFTformer
from .__arch.fftformer_arch import FFTformer


class FFTformerArch(Architecture[FFTformer]):
Expand Down
2 changes: 1 addition & 1 deletion libs/spandrel/spandrel/architectures/GFPGAN/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
SizeRequirements,
StateDict,
)
from .arch.gfpganv1_clean_arch import GFPGANv1Clean
from .__arch.gfpganv1_clean_arch import GFPGANv1Clean


class GFPGANArch(Architecture[GFPGANv1Clean]):
Expand Down
2 changes: 1 addition & 1 deletion libs/spandrel/spandrel/architectures/GRL/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from ...__helpers.canonicalize import remove_common_prefix
from ...__helpers.model_descriptor import Architecture, ImageModelDescriptor, StateDict
from .arch.grl import GRL
from .__arch.grl import GRL

_NON_PERSISTENT_BUFFERS = [
"table_w",
Expand Down
2 changes: 1 addition & 1 deletion libs/spandrel/spandrel/architectures/HAT/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
SizeRequirements,
StateDict,
)
from .arch.HAT import HAT
from .__arch.HAT import HAT


def _get_overlap_ratio(window_size: int, with_overlap: int) -> float:
Expand Down
2 changes: 1 addition & 1 deletion libs/spandrel/spandrel/architectures/HVICIDNet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
SizeRequirements,
StateDict,
)
from .arch.cidnet import CIDNet as HVICIDNet
from .__arch.cidnet import CIDNet as HVICIDNet


class HVICIDNetArch(Architecture[HVICIDNet]):
Expand Down
4 changes: 2 additions & 2 deletions libs/spandrel/spandrel/architectures/IPT/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
SizeRequirements,
StateDict,
)
from .arch.ipt import IPT
from .arch.model import Model
from .__arch.ipt import IPT
from .__arch.model import Model


class IPTArch(Architecture[IPT]):
Expand Down
4 changes: 2 additions & 2 deletions libs/spandrel/spandrel/architectures/KBNet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
SizeRequirements,
StateDict,
)
from .arch.kbnet_l import KBNet_l
from .arch.kbnet_s import KBNet_s
from .__arch.kbnet_l import KBNet_l
from .__arch.kbnet_s import KBNet_s

# KBCNN is essentially 2 similar but different architectures: KBNet_l and KBNet_s.
_KBNet = Union[KBNet_l, KBNet_s]
Expand Down
2 changes: 1 addition & 1 deletion libs/spandrel/spandrel/architectures/LaMa/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
SizeRequirements,
StateDict,
)
from .arch.LaMa import LaMa
from .__arch.LaMa import LaMa


class LaMaArch(Architecture[LaMa]):
Expand Down
2 changes: 1 addition & 1 deletion libs/spandrel/spandrel/architectures/MMRealSR/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
SizeRequirements,
StateDict,
)
from .arch.mmrealsr_arch import MMRRDBNet_test as MMRealSR
from .__arch.mmrealsr_arch import MMRRDBNet_test as MMRealSR


def _get_in_ch_and_scale(combined: int, num_out_ch: int) -> tuple[int, int]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
SizeRequirements,
StateDict,
)
from .arch.MixDehazeNet import MixDehazeNet
from .__arch.MixDehazeNet import MixDehazeNet


class MixDehazeNetArch(Architecture[MixDehazeNet]):
Expand Down
2 changes: 1 addition & 1 deletion libs/spandrel/spandrel/architectures/NAFNet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from spandrel.util import KeyCondition, get_seq_len

from ...__helpers.model_descriptor import Architecture, ImageModelDescriptor, StateDict
from .arch.NAFNet_arch import NAFNet
from .__arch.NAFNet_arch import NAFNet


class NAFNetArch(Architecture[NAFNet]):
Expand Down
2 changes: 1 addition & 1 deletion libs/spandrel/spandrel/architectures/OmniSR/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
SizeRequirements,
StateDict,
)
from .arch.OmniSR import OmniSR
from .__arch.OmniSR import OmniSR


class OmniSRArch(Architecture[OmniSR]):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
MIT License
Copyright (c) 2024 Dongheon Lee
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
MIT License

Copyright (c) 2024 Dongheon Lee

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 64d3c2b

Please sign in to comment.