Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rahulremanan/5242e1477fc04550310dd2156a3cfa0b to your computer and use it in GitHub Desktop.
Save rahulremanan/5242e1477fc04550310dd2156a3cfa0b to your computer and use it in GitHub Desktop.
Crop an image generated using combination of images
img_id1 = str(img_labels.iloc[img_idx1].file).split('/')[-1].replace('.jpg','')
img_race1 = str(img_labels.iloc[img_idx1].race)
img_gender1 = str(img_labels.iloc[img_idx1].gender)
img_id2 = str(img_labels.iloc[img_idx2].file).split('/')[-1].replace('.jpg','')
img_race2 = str(img_labels.iloc[img_idx2].race)
img_gender2 = str(img_labels.iloc[img_idx2].gender)
file_id = f'{img_id1}_{img_race1}_{img_gender1}--{img_id2}_{img_race2}_{img_gender2}'
output_dir = './'
padding = 0
instance_id = randomID_generator()
filename = f'{instance_id}_{file_id}_p{padding}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment