From 2c2d319955995415eba7395eafbb56f4112f2bb1 Mon Sep 17 00:00:00 2001 From: Captain272 <“www.abhijeeeth@gmail.com”> Date: Tue, 6 Jun 2023 19:06:01 +0530 Subject: [PATCH 1/4] add custom dataset training --- guided_diffusion/custom_dataset_loader.py | 61 +++++++++++++++++++++++ scripts/segmentation_train.py | 12 ++++- 2 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 guided_diffusion/custom_dataset_loader.py diff --git a/guided_diffusion/custom_dataset_loader.py b/guided_diffusion/custom_dataset_loader.py new file mode 100644 index 00000000..12e6f60f --- /dev/null +++ b/guided_diffusion/custom_dataset_loader.py @@ -0,0 +1,61 @@ +import os +import sys +import pickle +import cv2 +from skimage import io +import matplotlib.pyplot as plt +import numpy as np +import torch +from torch.utils.data import Dataset +from PIL import Image +import torchvision.transforms.functional as F +import torchvision.transforms as transforms +import pandas as pd +from skimage.transform import rotate +from glob import glob +from sklearn.model_selection import train_test_split + +class CustomDataset(Dataset): + def __init__(self, args, data_path , transform = None, mode = 'Training',plane = False): + + print("loading data from the directory :",data_path) + path=data_path + images = sorted(glob(os.path.join(path, "densitymap_png/*.png"))) + masks = sorted(glob(os.path.join(path, "subtomogram_png/*.png"))) + + self.name_list = images[:2] + self.label_list = masks[:2] + self.data_path = path + self.mode = mode + + self.transform = transform + + def __len__(self): + return len(self.name_list) + + def __getitem__(self, index): + """Get the images""" + name = self.name_list[index] + img_path = os.path.join(name) + + mask_name = self.label_list[index] + msk_path = os.path.join(mask_name) + + img = Image.open(img_path).convert('RGB') + mask = Image.open(msk_path).convert('L') + + if self.mode == 'Training': + label = 0 if self.label_list[index] == 'benign' else 1 + else: + label = int(self.label_list[index]) + + if self.transform: + state = torch.get_rng_state() + img = self.transform(img) + torch.set_rng_state(state) + mask = self.transform(mask) + + if self.mode == 'Training': + return (img, mask, name) + else: + return (img, mask, name) \ No newline at end of file diff --git a/scripts/segmentation_train.py b/scripts/segmentation_train.py index 7fc6391a..bd5a17ab 100644 --- a/scripts/segmentation_train.py +++ b/scripts/segmentation_train.py @@ -1,12 +1,13 @@ import sys import argparse -sys.path.append("..") -sys.path.append(".") +sys.path.append("../") +sys.path.append("./") from guided_diffusion import dist_util, logger from guided_diffusion.resample import create_named_schedule_sampler from guided_diffusion.bratsloader import BRATSDataset, BRATSDataset3D from guided_diffusion.isicloader import ISICDataset +from guided_diffusion.custom_dataset_loader import CustomDataset from guided_diffusion.script_util import ( model_and_diffusion_defaults, create_model_and_diffusion, @@ -39,6 +40,13 @@ def main(): ds = BRATSDataset3D(args.data_dir, transform_train, test_flag=False) args.in_ch = 5 + else : + tran_list = [transforms.Resize((args.image_size,args.image_size)), transforms.ToTensor(),] + transform_train = transforms.Compose(tran_list) + print("Your current directory : ",args.data_dir) + ds = CustomDataset(args, args.data_dir, transform_train) + args.in_ch = 4 + datal= th.utils.data.DataLoader( ds, batch_size=args.batch_size, From 9f611f8f4a36e925025ebcd8db8ba1c2aba7a99f Mon Sep 17 00:00:00 2001 From: Captain272 <“www.abhijeeeth@gmail.com”> Date: Tue, 6 Jun 2023 19:18:29 +0530 Subject: [PATCH 2/4] import issue --- .../guided_diffusion}/__init__.py | 0 .../__pycache__/__init__.cpython-38.pyc | Bin .../__pycache__/bratsloader.cpython-38.pyc | Bin .../__pycache__/dist_util.cpython-38.pyc | Bin .../__pycache__/dpm_solver.cpython-38.pyc | Bin .../__pycache__/fp16_util.cpython-38.pyc | Bin .../__pycache__/gaussian_diffusion.cpython-38.pyc | Bin .../__pycache__/isicloader.cpython-38.pyc | Bin .../__pycache__/logger.cpython-38.pyc | Bin .../__pycache__/losses.cpython-38.pyc | Bin .../guided_diffusion}/__pycache__/nn.cpython-38.pyc | Bin .../__pycache__/resample.cpython-38.pyc | Bin .../__pycache__/respace.cpython-38.pyc | Bin .../__pycache__/script_util.cpython-38.pyc | Bin .../__pycache__/train_util.cpython-38.pyc | Bin .../__pycache__/unet.cpython-38.pyc | Bin .../__pycache__/utils.cpython-38.pyc | Bin .../guided_diffusion}/bratsloader.py | 0 .../guided_diffusion}/btcvloader.py | 0 .../guided_diffusion}/custom_dataset_loader.py | 0 .../guided_diffusion}/dist_util.py | 0 .../guided_diffusion}/dpm_solver.py | 0 .../guided_diffusion}/fp16_util.py | 0 .../guided_diffusion}/gaussian_diffusion.py | 0 .../guided_diffusion}/isicloader.py | 0 .../guided_diffusion}/logger.py | 0 .../guided_diffusion}/losses.py | 0 .../guided_diffusion}/nn.py | 0 .../guided_diffusion}/resample.py | 0 .../guided_diffusion}/respace.py | 0 .../guided_diffusion}/script_util.py | 0 .../guided_diffusion}/train_util.py | 0 .../guided_diffusion}/unet.py | 0 .../guided_diffusion}/utils.py | 0 34 files changed, 0 insertions(+), 0 deletions(-) rename {guided_diffusion => scripts/guided_diffusion}/__init__.py (100%) rename {guided_diffusion => scripts/guided_diffusion}/__pycache__/__init__.cpython-38.pyc (100%) rename {guided_diffusion => scripts/guided_diffusion}/__pycache__/bratsloader.cpython-38.pyc (100%) rename {guided_diffusion => scripts/guided_diffusion}/__pycache__/dist_util.cpython-38.pyc (100%) rename {guided_diffusion => scripts/guided_diffusion}/__pycache__/dpm_solver.cpython-38.pyc (100%) rename {guided_diffusion => scripts/guided_diffusion}/__pycache__/fp16_util.cpython-38.pyc (100%) rename {guided_diffusion => scripts/guided_diffusion}/__pycache__/gaussian_diffusion.cpython-38.pyc (100%) rename {guided_diffusion => scripts/guided_diffusion}/__pycache__/isicloader.cpython-38.pyc (100%) rename {guided_diffusion => scripts/guided_diffusion}/__pycache__/logger.cpython-38.pyc (100%) rename {guided_diffusion => scripts/guided_diffusion}/__pycache__/losses.cpython-38.pyc (100%) rename {guided_diffusion => scripts/guided_diffusion}/__pycache__/nn.cpython-38.pyc (100%) rename {guided_diffusion => scripts/guided_diffusion}/__pycache__/resample.cpython-38.pyc (100%) rename {guided_diffusion => scripts/guided_diffusion}/__pycache__/respace.cpython-38.pyc (100%) rename {guided_diffusion => scripts/guided_diffusion}/__pycache__/script_util.cpython-38.pyc (100%) rename {guided_diffusion => scripts/guided_diffusion}/__pycache__/train_util.cpython-38.pyc (100%) rename {guided_diffusion => scripts/guided_diffusion}/__pycache__/unet.cpython-38.pyc (100%) rename {guided_diffusion => scripts/guided_diffusion}/__pycache__/utils.cpython-38.pyc (100%) rename {guided_diffusion => scripts/guided_diffusion}/bratsloader.py (100%) rename {guided_diffusion => scripts/guided_diffusion}/btcvloader.py (100%) rename {guided_diffusion => scripts/guided_diffusion}/custom_dataset_loader.py (100%) rename {guided_diffusion => scripts/guided_diffusion}/dist_util.py (100%) rename {guided_diffusion => scripts/guided_diffusion}/dpm_solver.py (100%) rename {guided_diffusion => scripts/guided_diffusion}/fp16_util.py (100%) rename {guided_diffusion => scripts/guided_diffusion}/gaussian_diffusion.py (100%) rename {guided_diffusion => scripts/guided_diffusion}/isicloader.py (100%) rename {guided_diffusion => scripts/guided_diffusion}/logger.py (100%) rename {guided_diffusion => scripts/guided_diffusion}/losses.py (100%) rename {guided_diffusion => scripts/guided_diffusion}/nn.py (100%) rename {guided_diffusion => scripts/guided_diffusion}/resample.py (100%) rename {guided_diffusion => scripts/guided_diffusion}/respace.py (100%) rename {guided_diffusion => scripts/guided_diffusion}/script_util.py (100%) rename {guided_diffusion => scripts/guided_diffusion}/train_util.py (100%) rename {guided_diffusion => scripts/guided_diffusion}/unet.py (100%) rename {guided_diffusion => scripts/guided_diffusion}/utils.py (100%) diff --git a/guided_diffusion/__init__.py b/scripts/guided_diffusion/__init__.py similarity index 100% rename from guided_diffusion/__init__.py rename to scripts/guided_diffusion/__init__.py diff --git a/guided_diffusion/__pycache__/__init__.cpython-38.pyc b/scripts/guided_diffusion/__pycache__/__init__.cpython-38.pyc similarity index 100% rename from guided_diffusion/__pycache__/__init__.cpython-38.pyc rename to scripts/guided_diffusion/__pycache__/__init__.cpython-38.pyc diff --git a/guided_diffusion/__pycache__/bratsloader.cpython-38.pyc b/scripts/guided_diffusion/__pycache__/bratsloader.cpython-38.pyc similarity index 100% rename from guided_diffusion/__pycache__/bratsloader.cpython-38.pyc rename to scripts/guided_diffusion/__pycache__/bratsloader.cpython-38.pyc diff --git a/guided_diffusion/__pycache__/dist_util.cpython-38.pyc b/scripts/guided_diffusion/__pycache__/dist_util.cpython-38.pyc similarity index 100% rename from guided_diffusion/__pycache__/dist_util.cpython-38.pyc rename to scripts/guided_diffusion/__pycache__/dist_util.cpython-38.pyc diff --git a/guided_diffusion/__pycache__/dpm_solver.cpython-38.pyc b/scripts/guided_diffusion/__pycache__/dpm_solver.cpython-38.pyc similarity index 100% rename from guided_diffusion/__pycache__/dpm_solver.cpython-38.pyc rename to scripts/guided_diffusion/__pycache__/dpm_solver.cpython-38.pyc diff --git a/guided_diffusion/__pycache__/fp16_util.cpython-38.pyc b/scripts/guided_diffusion/__pycache__/fp16_util.cpython-38.pyc similarity index 100% rename from guided_diffusion/__pycache__/fp16_util.cpython-38.pyc rename to scripts/guided_diffusion/__pycache__/fp16_util.cpython-38.pyc diff --git a/guided_diffusion/__pycache__/gaussian_diffusion.cpython-38.pyc b/scripts/guided_diffusion/__pycache__/gaussian_diffusion.cpython-38.pyc similarity index 100% rename from guided_diffusion/__pycache__/gaussian_diffusion.cpython-38.pyc rename to scripts/guided_diffusion/__pycache__/gaussian_diffusion.cpython-38.pyc diff --git a/guided_diffusion/__pycache__/isicloader.cpython-38.pyc b/scripts/guided_diffusion/__pycache__/isicloader.cpython-38.pyc similarity index 100% rename from guided_diffusion/__pycache__/isicloader.cpython-38.pyc rename to scripts/guided_diffusion/__pycache__/isicloader.cpython-38.pyc diff --git a/guided_diffusion/__pycache__/logger.cpython-38.pyc b/scripts/guided_diffusion/__pycache__/logger.cpython-38.pyc similarity index 100% rename from guided_diffusion/__pycache__/logger.cpython-38.pyc rename to scripts/guided_diffusion/__pycache__/logger.cpython-38.pyc diff --git a/guided_diffusion/__pycache__/losses.cpython-38.pyc b/scripts/guided_diffusion/__pycache__/losses.cpython-38.pyc similarity index 100% rename from guided_diffusion/__pycache__/losses.cpython-38.pyc rename to scripts/guided_diffusion/__pycache__/losses.cpython-38.pyc diff --git a/guided_diffusion/__pycache__/nn.cpython-38.pyc b/scripts/guided_diffusion/__pycache__/nn.cpython-38.pyc similarity index 100% rename from guided_diffusion/__pycache__/nn.cpython-38.pyc rename to scripts/guided_diffusion/__pycache__/nn.cpython-38.pyc diff --git a/guided_diffusion/__pycache__/resample.cpython-38.pyc b/scripts/guided_diffusion/__pycache__/resample.cpython-38.pyc similarity index 100% rename from guided_diffusion/__pycache__/resample.cpython-38.pyc rename to scripts/guided_diffusion/__pycache__/resample.cpython-38.pyc diff --git a/guided_diffusion/__pycache__/respace.cpython-38.pyc b/scripts/guided_diffusion/__pycache__/respace.cpython-38.pyc similarity index 100% rename from guided_diffusion/__pycache__/respace.cpython-38.pyc rename to scripts/guided_diffusion/__pycache__/respace.cpython-38.pyc diff --git a/guided_diffusion/__pycache__/script_util.cpython-38.pyc b/scripts/guided_diffusion/__pycache__/script_util.cpython-38.pyc similarity index 100% rename from guided_diffusion/__pycache__/script_util.cpython-38.pyc rename to scripts/guided_diffusion/__pycache__/script_util.cpython-38.pyc diff --git a/guided_diffusion/__pycache__/train_util.cpython-38.pyc b/scripts/guided_diffusion/__pycache__/train_util.cpython-38.pyc similarity index 100% rename from guided_diffusion/__pycache__/train_util.cpython-38.pyc rename to scripts/guided_diffusion/__pycache__/train_util.cpython-38.pyc diff --git a/guided_diffusion/__pycache__/unet.cpython-38.pyc b/scripts/guided_diffusion/__pycache__/unet.cpython-38.pyc similarity index 100% rename from guided_diffusion/__pycache__/unet.cpython-38.pyc rename to scripts/guided_diffusion/__pycache__/unet.cpython-38.pyc diff --git a/guided_diffusion/__pycache__/utils.cpython-38.pyc b/scripts/guided_diffusion/__pycache__/utils.cpython-38.pyc similarity index 100% rename from guided_diffusion/__pycache__/utils.cpython-38.pyc rename to scripts/guided_diffusion/__pycache__/utils.cpython-38.pyc diff --git a/guided_diffusion/bratsloader.py b/scripts/guided_diffusion/bratsloader.py similarity index 100% rename from guided_diffusion/bratsloader.py rename to scripts/guided_diffusion/bratsloader.py diff --git a/guided_diffusion/btcvloader.py b/scripts/guided_diffusion/btcvloader.py similarity index 100% rename from guided_diffusion/btcvloader.py rename to scripts/guided_diffusion/btcvloader.py diff --git a/guided_diffusion/custom_dataset_loader.py b/scripts/guided_diffusion/custom_dataset_loader.py similarity index 100% rename from guided_diffusion/custom_dataset_loader.py rename to scripts/guided_diffusion/custom_dataset_loader.py diff --git a/guided_diffusion/dist_util.py b/scripts/guided_diffusion/dist_util.py similarity index 100% rename from guided_diffusion/dist_util.py rename to scripts/guided_diffusion/dist_util.py diff --git a/guided_diffusion/dpm_solver.py b/scripts/guided_diffusion/dpm_solver.py similarity index 100% rename from guided_diffusion/dpm_solver.py rename to scripts/guided_diffusion/dpm_solver.py diff --git a/guided_diffusion/fp16_util.py b/scripts/guided_diffusion/fp16_util.py similarity index 100% rename from guided_diffusion/fp16_util.py rename to scripts/guided_diffusion/fp16_util.py diff --git a/guided_diffusion/gaussian_diffusion.py b/scripts/guided_diffusion/gaussian_diffusion.py similarity index 100% rename from guided_diffusion/gaussian_diffusion.py rename to scripts/guided_diffusion/gaussian_diffusion.py diff --git a/guided_diffusion/isicloader.py b/scripts/guided_diffusion/isicloader.py similarity index 100% rename from guided_diffusion/isicloader.py rename to scripts/guided_diffusion/isicloader.py diff --git a/guided_diffusion/logger.py b/scripts/guided_diffusion/logger.py similarity index 100% rename from guided_diffusion/logger.py rename to scripts/guided_diffusion/logger.py diff --git a/guided_diffusion/losses.py b/scripts/guided_diffusion/losses.py similarity index 100% rename from guided_diffusion/losses.py rename to scripts/guided_diffusion/losses.py diff --git a/guided_diffusion/nn.py b/scripts/guided_diffusion/nn.py similarity index 100% rename from guided_diffusion/nn.py rename to scripts/guided_diffusion/nn.py diff --git a/guided_diffusion/resample.py b/scripts/guided_diffusion/resample.py similarity index 100% rename from guided_diffusion/resample.py rename to scripts/guided_diffusion/resample.py diff --git a/guided_diffusion/respace.py b/scripts/guided_diffusion/respace.py similarity index 100% rename from guided_diffusion/respace.py rename to scripts/guided_diffusion/respace.py diff --git a/guided_diffusion/script_util.py b/scripts/guided_diffusion/script_util.py similarity index 100% rename from guided_diffusion/script_util.py rename to scripts/guided_diffusion/script_util.py diff --git a/guided_diffusion/train_util.py b/scripts/guided_diffusion/train_util.py similarity index 100% rename from guided_diffusion/train_util.py rename to scripts/guided_diffusion/train_util.py diff --git a/guided_diffusion/unet.py b/scripts/guided_diffusion/unet.py similarity index 100% rename from guided_diffusion/unet.py rename to scripts/guided_diffusion/unet.py diff --git a/guided_diffusion/utils.py b/scripts/guided_diffusion/utils.py similarity index 100% rename from guided_diffusion/utils.py rename to scripts/guided_diffusion/utils.py From 443029b555f455307f5a22563d1794f9079d63d9 Mon Sep 17 00:00:00 2001 From: Captain272 <“www.abhijeeeth@gmail.com”> Date: Wed, 7 Jun 2023 13:27:11 +0530 Subject: [PATCH 3/4] import_issue_revert --- .../__init__.py | 0 .../__pycache__/__init__.cpython-38.pyc | Bin .../__pycache__/bratsloader.cpython-38.pyc | Bin .../__pycache__/dist_util.cpython-38.pyc | Bin .../__pycache__/dpm_solver.cpython-38.pyc | Bin .../__pycache__/fp16_util.cpython-38.pyc | Bin .../__pycache__/gaussian_diffusion.cpython-38.pyc | Bin .../__pycache__/isicloader.cpython-38.pyc | Bin .../__pycache__/logger.cpython-38.pyc | Bin .../__pycache__/losses.cpython-38.pyc | Bin .../__pycache__/nn.cpython-38.pyc | Bin .../__pycache__/resample.cpython-38.pyc | Bin .../__pycache__/respace.cpython-38.pyc | Bin .../__pycache__/script_util.cpython-38.pyc | Bin .../__pycache__/train_util.cpython-38.pyc | Bin .../__pycache__/unet.cpython-38.pyc | Bin .../__pycache__/utils.cpython-38.pyc | Bin .../bratsloader.py | 0 .../btcvloader.py | 0 .../custom_dataset_loader.py | 0 .../dist_util.py | 0 .../dpm_solver.py | 0 .../fp16_util.py | 0 .../gaussian_diffusion.py | 0 .../isicloader.py | 0 .../guided_diffusion => guided_diffusion}/logger.py | 0 .../guided_diffusion => guided_diffusion}/losses.py | 0 .../guided_diffusion => guided_diffusion}/nn.py | 0 .../resample.py | 0 .../respace.py | 0 .../script_util.py | 0 .../train_util.py | 0 .../guided_diffusion => guided_diffusion}/unet.py | 0 .../guided_diffusion => guided_diffusion}/utils.py | 0 34 files changed, 0 insertions(+), 0 deletions(-) rename {scripts/guided_diffusion => guided_diffusion}/__init__.py (100%) rename {scripts/guided_diffusion => guided_diffusion}/__pycache__/__init__.cpython-38.pyc (100%) rename {scripts/guided_diffusion => guided_diffusion}/__pycache__/bratsloader.cpython-38.pyc (100%) rename {scripts/guided_diffusion => guided_diffusion}/__pycache__/dist_util.cpython-38.pyc (100%) rename {scripts/guided_diffusion => guided_diffusion}/__pycache__/dpm_solver.cpython-38.pyc (100%) rename {scripts/guided_diffusion => guided_diffusion}/__pycache__/fp16_util.cpython-38.pyc (100%) rename {scripts/guided_diffusion => guided_diffusion}/__pycache__/gaussian_diffusion.cpython-38.pyc (100%) rename {scripts/guided_diffusion => guided_diffusion}/__pycache__/isicloader.cpython-38.pyc (100%) rename {scripts/guided_diffusion => guided_diffusion}/__pycache__/logger.cpython-38.pyc (100%) rename {scripts/guided_diffusion => guided_diffusion}/__pycache__/losses.cpython-38.pyc (100%) rename {scripts/guided_diffusion => guided_diffusion}/__pycache__/nn.cpython-38.pyc (100%) rename {scripts/guided_diffusion => guided_diffusion}/__pycache__/resample.cpython-38.pyc (100%) rename {scripts/guided_diffusion => guided_diffusion}/__pycache__/respace.cpython-38.pyc (100%) rename {scripts/guided_diffusion => guided_diffusion}/__pycache__/script_util.cpython-38.pyc (100%) rename {scripts/guided_diffusion => guided_diffusion}/__pycache__/train_util.cpython-38.pyc (100%) rename {scripts/guided_diffusion => guided_diffusion}/__pycache__/unet.cpython-38.pyc (100%) rename {scripts/guided_diffusion => guided_diffusion}/__pycache__/utils.cpython-38.pyc (100%) rename {scripts/guided_diffusion => guided_diffusion}/bratsloader.py (100%) rename {scripts/guided_diffusion => guided_diffusion}/btcvloader.py (100%) rename {scripts/guided_diffusion => guided_diffusion}/custom_dataset_loader.py (100%) rename {scripts/guided_diffusion => guided_diffusion}/dist_util.py (100%) rename {scripts/guided_diffusion => guided_diffusion}/dpm_solver.py (100%) rename {scripts/guided_diffusion => guided_diffusion}/fp16_util.py (100%) rename {scripts/guided_diffusion => guided_diffusion}/gaussian_diffusion.py (100%) rename {scripts/guided_diffusion => guided_diffusion}/isicloader.py (100%) rename {scripts/guided_diffusion => guided_diffusion}/logger.py (100%) rename {scripts/guided_diffusion => guided_diffusion}/losses.py (100%) rename {scripts/guided_diffusion => guided_diffusion}/nn.py (100%) rename {scripts/guided_diffusion => guided_diffusion}/resample.py (100%) rename {scripts/guided_diffusion => guided_diffusion}/respace.py (100%) rename {scripts/guided_diffusion => guided_diffusion}/script_util.py (100%) rename {scripts/guided_diffusion => guided_diffusion}/train_util.py (100%) rename {scripts/guided_diffusion => guided_diffusion}/unet.py (100%) rename {scripts/guided_diffusion => guided_diffusion}/utils.py (100%) diff --git a/scripts/guided_diffusion/__init__.py b/guided_diffusion/__init__.py similarity index 100% rename from scripts/guided_diffusion/__init__.py rename to guided_diffusion/__init__.py diff --git a/scripts/guided_diffusion/__pycache__/__init__.cpython-38.pyc b/guided_diffusion/__pycache__/__init__.cpython-38.pyc similarity index 100% rename from scripts/guided_diffusion/__pycache__/__init__.cpython-38.pyc rename to guided_diffusion/__pycache__/__init__.cpython-38.pyc diff --git a/scripts/guided_diffusion/__pycache__/bratsloader.cpython-38.pyc b/guided_diffusion/__pycache__/bratsloader.cpython-38.pyc similarity index 100% rename from scripts/guided_diffusion/__pycache__/bratsloader.cpython-38.pyc rename to guided_diffusion/__pycache__/bratsloader.cpython-38.pyc diff --git a/scripts/guided_diffusion/__pycache__/dist_util.cpython-38.pyc b/guided_diffusion/__pycache__/dist_util.cpython-38.pyc similarity index 100% rename from scripts/guided_diffusion/__pycache__/dist_util.cpython-38.pyc rename to guided_diffusion/__pycache__/dist_util.cpython-38.pyc diff --git a/scripts/guided_diffusion/__pycache__/dpm_solver.cpython-38.pyc b/guided_diffusion/__pycache__/dpm_solver.cpython-38.pyc similarity index 100% rename from scripts/guided_diffusion/__pycache__/dpm_solver.cpython-38.pyc rename to guided_diffusion/__pycache__/dpm_solver.cpython-38.pyc diff --git a/scripts/guided_diffusion/__pycache__/fp16_util.cpython-38.pyc b/guided_diffusion/__pycache__/fp16_util.cpython-38.pyc similarity index 100% rename from scripts/guided_diffusion/__pycache__/fp16_util.cpython-38.pyc rename to guided_diffusion/__pycache__/fp16_util.cpython-38.pyc diff --git a/scripts/guided_diffusion/__pycache__/gaussian_diffusion.cpython-38.pyc b/guided_diffusion/__pycache__/gaussian_diffusion.cpython-38.pyc similarity index 100% rename from scripts/guided_diffusion/__pycache__/gaussian_diffusion.cpython-38.pyc rename to guided_diffusion/__pycache__/gaussian_diffusion.cpython-38.pyc diff --git a/scripts/guided_diffusion/__pycache__/isicloader.cpython-38.pyc b/guided_diffusion/__pycache__/isicloader.cpython-38.pyc similarity index 100% rename from scripts/guided_diffusion/__pycache__/isicloader.cpython-38.pyc rename to guided_diffusion/__pycache__/isicloader.cpython-38.pyc diff --git a/scripts/guided_diffusion/__pycache__/logger.cpython-38.pyc b/guided_diffusion/__pycache__/logger.cpython-38.pyc similarity index 100% rename from scripts/guided_diffusion/__pycache__/logger.cpython-38.pyc rename to guided_diffusion/__pycache__/logger.cpython-38.pyc diff --git a/scripts/guided_diffusion/__pycache__/losses.cpython-38.pyc b/guided_diffusion/__pycache__/losses.cpython-38.pyc similarity index 100% rename from scripts/guided_diffusion/__pycache__/losses.cpython-38.pyc rename to guided_diffusion/__pycache__/losses.cpython-38.pyc diff --git a/scripts/guided_diffusion/__pycache__/nn.cpython-38.pyc b/guided_diffusion/__pycache__/nn.cpython-38.pyc similarity index 100% rename from scripts/guided_diffusion/__pycache__/nn.cpython-38.pyc rename to guided_diffusion/__pycache__/nn.cpython-38.pyc diff --git a/scripts/guided_diffusion/__pycache__/resample.cpython-38.pyc b/guided_diffusion/__pycache__/resample.cpython-38.pyc similarity index 100% rename from scripts/guided_diffusion/__pycache__/resample.cpython-38.pyc rename to guided_diffusion/__pycache__/resample.cpython-38.pyc diff --git a/scripts/guided_diffusion/__pycache__/respace.cpython-38.pyc b/guided_diffusion/__pycache__/respace.cpython-38.pyc similarity index 100% rename from scripts/guided_diffusion/__pycache__/respace.cpython-38.pyc rename to guided_diffusion/__pycache__/respace.cpython-38.pyc diff --git a/scripts/guided_diffusion/__pycache__/script_util.cpython-38.pyc b/guided_diffusion/__pycache__/script_util.cpython-38.pyc similarity index 100% rename from scripts/guided_diffusion/__pycache__/script_util.cpython-38.pyc rename to guided_diffusion/__pycache__/script_util.cpython-38.pyc diff --git a/scripts/guided_diffusion/__pycache__/train_util.cpython-38.pyc b/guided_diffusion/__pycache__/train_util.cpython-38.pyc similarity index 100% rename from scripts/guided_diffusion/__pycache__/train_util.cpython-38.pyc rename to guided_diffusion/__pycache__/train_util.cpython-38.pyc diff --git a/scripts/guided_diffusion/__pycache__/unet.cpython-38.pyc b/guided_diffusion/__pycache__/unet.cpython-38.pyc similarity index 100% rename from scripts/guided_diffusion/__pycache__/unet.cpython-38.pyc rename to guided_diffusion/__pycache__/unet.cpython-38.pyc diff --git a/scripts/guided_diffusion/__pycache__/utils.cpython-38.pyc b/guided_diffusion/__pycache__/utils.cpython-38.pyc similarity index 100% rename from scripts/guided_diffusion/__pycache__/utils.cpython-38.pyc rename to guided_diffusion/__pycache__/utils.cpython-38.pyc diff --git a/scripts/guided_diffusion/bratsloader.py b/guided_diffusion/bratsloader.py similarity index 100% rename from scripts/guided_diffusion/bratsloader.py rename to guided_diffusion/bratsloader.py diff --git a/scripts/guided_diffusion/btcvloader.py b/guided_diffusion/btcvloader.py similarity index 100% rename from scripts/guided_diffusion/btcvloader.py rename to guided_diffusion/btcvloader.py diff --git a/scripts/guided_diffusion/custom_dataset_loader.py b/guided_diffusion/custom_dataset_loader.py similarity index 100% rename from scripts/guided_diffusion/custom_dataset_loader.py rename to guided_diffusion/custom_dataset_loader.py diff --git a/scripts/guided_diffusion/dist_util.py b/guided_diffusion/dist_util.py similarity index 100% rename from scripts/guided_diffusion/dist_util.py rename to guided_diffusion/dist_util.py diff --git a/scripts/guided_diffusion/dpm_solver.py b/guided_diffusion/dpm_solver.py similarity index 100% rename from scripts/guided_diffusion/dpm_solver.py rename to guided_diffusion/dpm_solver.py diff --git a/scripts/guided_diffusion/fp16_util.py b/guided_diffusion/fp16_util.py similarity index 100% rename from scripts/guided_diffusion/fp16_util.py rename to guided_diffusion/fp16_util.py diff --git a/scripts/guided_diffusion/gaussian_diffusion.py b/guided_diffusion/gaussian_diffusion.py similarity index 100% rename from scripts/guided_diffusion/gaussian_diffusion.py rename to guided_diffusion/gaussian_diffusion.py diff --git a/scripts/guided_diffusion/isicloader.py b/guided_diffusion/isicloader.py similarity index 100% rename from scripts/guided_diffusion/isicloader.py rename to guided_diffusion/isicloader.py diff --git a/scripts/guided_diffusion/logger.py b/guided_diffusion/logger.py similarity index 100% rename from scripts/guided_diffusion/logger.py rename to guided_diffusion/logger.py diff --git a/scripts/guided_diffusion/losses.py b/guided_diffusion/losses.py similarity index 100% rename from scripts/guided_diffusion/losses.py rename to guided_diffusion/losses.py diff --git a/scripts/guided_diffusion/nn.py b/guided_diffusion/nn.py similarity index 100% rename from scripts/guided_diffusion/nn.py rename to guided_diffusion/nn.py diff --git a/scripts/guided_diffusion/resample.py b/guided_diffusion/resample.py similarity index 100% rename from scripts/guided_diffusion/resample.py rename to guided_diffusion/resample.py diff --git a/scripts/guided_diffusion/respace.py b/guided_diffusion/respace.py similarity index 100% rename from scripts/guided_diffusion/respace.py rename to guided_diffusion/respace.py diff --git a/scripts/guided_diffusion/script_util.py b/guided_diffusion/script_util.py similarity index 100% rename from scripts/guided_diffusion/script_util.py rename to guided_diffusion/script_util.py diff --git a/scripts/guided_diffusion/train_util.py b/guided_diffusion/train_util.py similarity index 100% rename from scripts/guided_diffusion/train_util.py rename to guided_diffusion/train_util.py diff --git a/scripts/guided_diffusion/unet.py b/guided_diffusion/unet.py similarity index 100% rename from scripts/guided_diffusion/unet.py rename to guided_diffusion/unet.py diff --git a/scripts/guided_diffusion/utils.py b/guided_diffusion/utils.py similarity index 100% rename from scripts/guided_diffusion/utils.py rename to guided_diffusion/utils.py From 03a671349ef69c795b326f55c138dd9d9d59cd34 Mon Sep 17 00:00:00 2001 From: Captain272 <“www.abhijeeeth@gmail.com”> Date: Wed, 7 Jun 2023 13:30:43 +0530 Subject: [PATCH 4/4] file name fix --- guided_diffusion/custom_dataset_loader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guided_diffusion/custom_dataset_loader.py b/guided_diffusion/custom_dataset_loader.py index 12e6f60f..f497aa73 100644 --- a/guided_diffusion/custom_dataset_loader.py +++ b/guided_diffusion/custom_dataset_loader.py @@ -20,8 +20,8 @@ def __init__(self, args, data_path , transform = None, mode = 'Training',plane = print("loading data from the directory :",data_path) path=data_path - images = sorted(glob(os.path.join(path, "densitymap_png/*.png"))) - masks = sorted(glob(os.path.join(path, "subtomogram_png/*.png"))) + images = sorted(glob(os.path.join(path, "images/*.png"))) + masks = sorted(glob(os.path.join(path, "masks/*.png"))) self.name_list = images[:2] self.label_list = masks[:2]