fix sorting
This commit is contained in:
@@ -333,28 +333,16 @@ class ImageViewer:
|
||||
|
||||
try:
|
||||
current_data = read_json(self.current_json_path)
|
||||
nb_pages = self.current_meta["schema"]["columns_per_file"][
|
||||
self.current_meta["part"] - 1
|
||||
]
|
||||
original_items = current_data["list"]
|
||||
ordered_items = sort_bounding_boxes(original_items, nb_pages)
|
||||
|
||||
if ordered_items != original_items:
|
||||
current_data["list"] = ordered_items
|
||||
atomic_write_json(self.current_json_path, current_data)
|
||||
print(
|
||||
f"Reordered labels by column in "
|
||||
f"{self.current_json_path.name}."
|
||||
)
|
||||
items = current_data["list"]
|
||||
|
||||
# Perform the conversion now, post-edit
|
||||
converted_items = convert_list(
|
||||
ordered_items,
|
||||
items,
|
||||
self.current_meta["part"],
|
||||
self.current_meta["schema"]
|
||||
)
|
||||
|
||||
labels = normalized_labels(ordered_items)
|
||||
labels = normalized_labels(items)
|
||||
false_labels = [
|
||||
label for label in labels if label not in self.valid_labels
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user