YongchengYAO commited on
Commit
324cb5f
·
verified ·
1 Parent(s): e55753f

Update get_dataset.py

Browse files
Files changed (1) hide show
  1. get_dataset.py +5 -5
get_dataset.py CHANGED
@@ -119,6 +119,7 @@ def convert_bmp_to_niigz(
119
  return img_size_dim0, img_size_dim1
120
 
121
 
 
122
  def process_landmarks_data(
123
  landmarks_txt_dir: str,
124
  landmarks_json_dir: str,
@@ -158,15 +159,14 @@ def process_landmarks_data(
158
  line = f.readline().strip()
159
  if not line:
160
  break
161
- # Note: this is definitely correct, DO NOT SWAP idx_dim1 and idx_dim2
162
  # Assuming an image with height and width:
163
- # - The data array read from bmp file is of size (height, width) -- dim1 is height, dim2 is width
164
- # - The landmark coordinates are defined as the indices in width (coordinate 1) and height (coordinate 2) directions
165
  idx_dim1, idx_dim0 = map(int, line.split(","))
166
 
167
  # Apply transformations
168
- # Note: this is definitely correct
169
- # This "mismatch" indices in "idx_dim1 = img_sizes[0] - idx_dim1" is due to the way the manual landmarks are defined
170
  # DO NOT SWAP the order of transformations
171
  if flip_dim0:
172
  idx_dim0 = img_sizes[0] - idx_dim0
 
119
  return img_size_dim0, img_size_dim1
120
 
121
 
122
+
123
  def process_landmarks_data(
124
  landmarks_txt_dir: str,
125
  landmarks_json_dir: str,
 
159
  line = f.readline().strip()
160
  if not line:
161
  break
162
+ # Note: this is correct, DO NOT SWAP idx_dim0 and idx_dim1
163
  # Assuming an image with height and width:
164
+ # - The data array read from bmp file is of size (height, width) -- dim0 is height, dim1 is width
165
+ # - The landmark coordinates are defined as the indices in width (dim1) and height (dim0) directions
166
  idx_dim1, idx_dim0 = map(int, line.split(","))
167
 
168
  # Apply transformations
169
+ # Note: this is correct
 
170
  # DO NOT SWAP the order of transformations
171
  if flip_dim0:
172
  idx_dim0 = img_sizes[0] - idx_dim0