-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
additional SR and IC models, checkpoint storage, and more.
- Loading branch information
Showing
23 changed files
with
666 additions
and
428 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Clarisolve | ||
|
||
> A DL-based super-resolution and colorization tool. | ||
## Requirements | ||
|
||
To install the required packages, you can run: | ||
|
||
```shell | ||
pip install -r requirements.txt | ||
``` | ||
|
||
## Usage | ||
|
||
### Evaluation | ||
|
||
A GUI tool is provided to super-resolve and colorize images. To run, use: | ||
|
||
```shell | ||
python main.py | ||
``` | ||
|
||
CLI options are also present, see the `super-resolve.py` and `colorize.py` files for | ||
details. | ||
|
||
### Training | ||
|
||
You can train any model yourself using `train.py` as follows: | ||
|
||
```shell | ||
python train.py --model { "srcnn", "srcnnc", "srres", "iccnn", "icres" } \ | ||
--train-data TRAIN_DATA \ | ||
--eval-data EVAL_DATA \ | ||
--output-dir OUTPUT_DIR \ | ||
[--checkpoint-path CHECKPOINT_PATH] \ | ||
[--learn-rate LEARN_RATE] \ | ||
[--end-epoch END_EPOCH] \ | ||
[--num-workers NUM_WORKERS] \ | ||
[--seed SEED] | ||
``` | ||
Note that for SR models, a `.h5` file is required for both datasets, and for IC, a | ||
directory is required. | ||
### Datasets | ||
A utility script `util/make.py` is provided for `.h5` file creation. |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from .iccnn import ICCNN | ||
from .icres import ICRes | ||
from .srcnn import SRCNN | ||
from .srcnnc import SRCNNC | ||
from .srres import SRRes | ||
|
||
SR_MODELS = { | ||
"srcnn": SRCNN, | ||
"srcnnc": SRCNNC, | ||
"srres": SRRes, | ||
} | ||
|
||
IC_MODELS = { | ||
"iccnn": ICCNN, | ||
"icres": ICRes, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import torch | ||
|
||
|
||
class ICCNN(torch.nn.Module): | ||
def __init__(self): | ||
super(ICCNN, self).__init__() | ||
|
||
self.features = torch.nn.Sequential( | ||
torch.nn.Conv2d(1, 32, kernel_size=3, padding=1, stride=2), | ||
torch.nn.BatchNorm2d(32), | ||
torch.nn.ReLU(inplace=True), | ||
torch.nn.Conv2d(32, 64, kernel_size=3, padding=1, stride=2), | ||
torch.nn.BatchNorm2d(64), | ||
torch.nn.ReLU(inplace=True), | ||
torch.nn.Conv2d(64, 128, kernel_size=3, padding=1, stride=2), | ||
) | ||
|
||
self.upsample = torch.nn.Sequential( | ||
torch.nn.Upsample(scale_factor=2), | ||
torch.nn.Conv2d(128, 64, kernel_size=3, padding=1, stride=1), | ||
torch.nn.BatchNorm2d(64), | ||
torch.nn.ReLU(inplace=True), | ||
torch.nn.Upsample(scale_factor=2), | ||
torch.nn.Conv2d(64, 32, kernel_size=3, padding=1, stride=1), | ||
torch.nn.BatchNorm2d(32), | ||
torch.nn.ReLU(inplace=True), | ||
torch.nn.Upsample(scale_factor=2), | ||
torch.nn.Conv2d(32, 2, kernel_size=3, padding=1, stride=1), | ||
) | ||
|
||
def forward(self, output): | ||
output = self.features(output) | ||
output = self.upsample(output) | ||
|
||
return output | ||
|
||
def __str__(self): | ||
return "iccnn" |
Oops, something went wrong.