diff --git a/codes/ecg-image-generator/CreasesWrinkles/creases.py b/codes/ecg-image-generator/CreasesWrinkles/creases.py index cf03a95..efa5797 100644 --- a/codes/ecg-image-generator/CreasesWrinkles/creases.py +++ b/codes/ecg-image-generator/CreasesWrinkles/creases.py @@ -252,7 +252,7 @@ def get_creased(input_file,output_directory,ifWrinkles=False,ifCreases=False,cre if(ifWrinkles): #Seed with a different selection of a wrinkle image # read wrinkle image as grayscale and convert to float in range 0 to 1 - wrinkle_file_name = os.path.join(os.path.join('CreasesWrinkles','wrinkles-dataset') , str(random.choice(range(1,21))) + '.jpg') + wrinkle_file_name = os.path.join(os.path.join('CreasesWrinkles','wrinkles-dataset') , random.choice(os.listdir(os.path.join('CreasesWrinkles','wrinkles-dataset')))) wrinklesImg = quilt(wrinkle_file_name,250,(1,1),'Cut') wrinklesImg=cv2.cvtColor(wrinklesImg, cv2.COLOR_BGR2GRAY) wrinklesImg = wrinklesImg.astype("float32") / 255.0 diff --git a/codes/ecg-image-generator/ImageAugmentation/augment.py b/codes/ecg-image-generator/ImageAugmentation/augment.py index ee94222..196d71c 100644 --- a/codes/ecg-image-generator/ImageAugmentation/augment.py +++ b/codes/ecg-image-generator/ImageAugmentation/augment.py @@ -53,7 +53,7 @@ def get_augment(input_file,output_directory,rotate=25,noise=25,crop=0.01,tempera leadNames_bbs = BoundingBoxesOnImage(leadNames_bbs, shape=image.shape) - images = [image] + images = [image[:, :, :3]] rot = random.randint(-rotate, rotate) crop_sample = random.uniform(0, crop) #Augment in a sequential manner. Create an augmentation object diff --git a/codes/ecg-image-generator/gen_ecg_image_from_data.py b/codes/ecg-image-generator/gen_ecg_image_from_data.py index 0cae8b8..80f23f7 100644 --- a/codes/ecg-image-generator/gen_ecg_image_from_data.py +++ b/codes/ecg-image-generator/gen_ecg_image_from_data.py @@ -51,7 +51,7 @@ def get_parser(): parser.add_argument('--random_grid_present',type=float,default=1) parser.add_argument('--random_add_header',type=float,default=0) parser.add_argument('--random_bw',type=float,default=0) - parser.add_argument('--deterministic_lead',action="store_true",default=True) + parser.add_argument('--deterministic_lead',action="store_false",default=True) parser.add_argument('--store_text_bounding_box',action="store_true",default=False) parser.add_argument('--store_config',action="store_true",default=False) diff --git a/codes/ecg-image-generator/gen_ecg_images_from_data_batch.py b/codes/ecg-image-generator/gen_ecg_images_from_data_batch.py index 8c2ebbb..1519cb1 100644 --- a/codes/ecg-image-generator/gen_ecg_images_from_data_batch.py +++ b/codes/ecg-image-generator/gen_ecg_images_from_data_batch.py @@ -49,7 +49,7 @@ def get_parser(): parser.add_argument('--random_grid_present',type=float,default=1) parser.add_argument('--random_add_header',type=float,default=0) parser.add_argument('--random_bw',type=float,default=0) - parser.add_argument('--deterministic_lead',action="store_true",default=True) + parser.add_argument('--deterministic_lead',action="store_false",default=True) parser.add_argument('--store_text_bounding_box',action="store_true",default=False) parser.add_argument('--store_config',action="store_true",default=False)