Skip to content

Commit 0ab17e2

Browse files
committed
updated and cleaned repo, added readme
1 parent 9110403 commit 0ab17e2

16 files changed

+275
-4029
lines changed

README.md

Lines changed: 218 additions & 1 deletion
Large diffs are not rendered by default.

assets/network_architecture.png

1.02 MB
Loading

assets/sample_hr_input.png

700 KB
Loading

assets/sample_lr_input.png

47.7 KB
Loading

assets/sample_sr_output.png

421 KB
Loading
File renamed without changes.
File renamed without changes.

notebooks/data_split.ipynb

Lines changed: 9 additions & 1020 deletions
Large diffs are not rendered by default.

notebooks/model_infer.ipynb

Lines changed: 26 additions & 1449 deletions
Large diffs are not rendered by default.

notebooks/model_train.ipynb

Lines changed: 2 additions & 1533 deletions
Large diffs are not rendered by default.

requirements.txt

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
1-
Flask
2-
matplotlib
3-
monai
4-
networkx
5-
opencv_python
6-
pandas
7-
Pillow
8-
pydicom
9-
requests
10-
scikit_learn
11-
seaborn
12-
streamlit
13-
torch
14-
torchsummary
15-
torchtext
16-
torchvision
17-
tqdm
18-
numpy
1+
pandas==1.5.3
2+
numpy==1.23.5
3+
opendatasets==0.1.22
4+
Pillow==9.4.0
5+
torch==2.0.0
6+
torchsummary==1.5.1
7+
torchvision==0.15.1
8+
tqdm==4.65.0

scripts/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
## Placeholder to make this directory a package

scripts/make_dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ def download_dataset(dataset_url):
1515
if __name__ == "__main__":
1616

1717
## Download the dataset
18-
dataset_url = 'https://www.kaggle.com/andrewmvd/heart-failure-clinical-data'
18+
dataset_url = 'https://www.kaggle.com/datasets/nih-chest-xrays/data'
1919
download_dataset(dataset_url)

scripts/model_metrics.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## SSIM implementation sourced from the original author's GitHub repository of the SRGAN paper
2+
# https://github.com/goldhuang/SRGAN-PyTorch/blob/master/pytorch_ssim/__init__.py
3+
14
## Library Imports
25
import math
36
import torch

scripts/split_data.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def split_data():
1515
None
1616
"""
1717
## Get list of all images in full dataset
18-
all_images_list = glob.glob(f"./dataset/*/*/*.png", recursive=False)
18+
all_images_list = glob.glob(f"./data/*/*/*.png", recursive=False)
1919

2020
## Shuffle the data
2121
random.shuffle(all_images_list)
@@ -25,9 +25,9 @@ def split_data():
2525
test_images = all_images_list[90000:]
2626

2727
## Save the train and test split
28-
with open("./dataset/train_images.pkl", "wb") as fp:
28+
with open("./data/train_images.pkl", "wb") as fp:
2929
pickle.dump(train_images, fp)
30-
with open("./dataset/val_images.pkl", "wb") as fp:
30+
with open("./data/val_images.pkl", "wb") as fp:
3131
pickle.dump(test_images, fp)
3232

3333

scripts/train_model.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def run_pipeline(arguments):
3131

3232
## Create directories to store results if they don't exist
3333
print("[INFO] Creating directories")
34-
os.makedirs("./checkpoints", exist_ok=True)
34+
os.makedirs("./models", exist_ok=True)
3535
os.makedirs("./logs", exist_ok=True)
3636

3737
## Initialize parameters from arguments
@@ -41,9 +41,9 @@ def run_pipeline(arguments):
4141
DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
4242

4343
## Load Train and Val data splits
44-
with open('./dataset/train_images.pkl', 'rb') as f:
44+
with open('./data/train_images.pkl', 'rb') as f:
4545
train_data_list = pickle.load(f)
46-
with open('./dataset/val_images.pkl', 'rb') as f:
46+
with open('./data/val_images.pkl', 'rb') as f:
4747
val_data_list = pickle.load(f)
4848

4949
## Load the train dataset
@@ -276,7 +276,7 @@ def run_pipeline(arguments):
276276

277277
## Save the results to the disk
278278
data_frame.to_csv(
279-
out_path + "ssrgan_" + str(epoch) + "_train_results.csv",
279+
out_path + "metrics_" + str(epoch) + "_train_results.csv",
280280
index_label="Epoch",
281281
)
282282

0 commit comments

Comments
 (0)