Skip to content

Commit

Permalink
ecg gen: creases and augment bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
deepanshi-s committed Jan 24, 2024
1 parent 2f8282a commit dfe0edc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion codes/ecg-image-generator/CreasesWrinkles/creases.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion codes/ecg-image-generator/ImageAugmentation/augment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion codes/ecg-image-generator/gen_ecg_image_from_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit dfe0edc

Please sign in to comment.