Skip to content

Commit

Permalink
fix: image size in int not float needed for resize
Browse files Browse the repository at this point in the history
  • Loading branch information
danellecline committed May 16, 2024
1 parent 18fc005 commit cf3ebd3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sdcat/cluster/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,10 @@ def run_cluster_roi(roi_dir, save_dir, device, config_ini, alpha, cluster_select
# Add the image_width and image_height columns to the dataframe
for index, row in df.iterrows():
im_size = Image.open(row['image_path']).size
df.at[index, 'image_width'] = int(im_size[0])
df.at[index, 'image_height'] = int(im_size[1])
df.at[index, 'image_width'] = im_size[0]
df.at[index, 'image_height'] = im_size[1]
df['image_width'] = df['image_width'].astype(int)
df['image_height'] = df['image_height'].astype(int)

# Create a unique crop name for each detection with a unique id
crop_path = save_dir / 'crops'
Expand Down

0 comments on commit cf3ebd3

Please sign in to comment.