Skip to content

Commit

Permalink
fix: fix variable issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sokovninn committed Dec 11, 2023
1 parent 2757a96 commit 6e8938c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/datadreamer/pipelines/generate_dataset_from_scratch.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ def save_det_annotations_to_json(
file_name="annotations.json",
):
annotations = {}
for image_path, bboxes, labels_list in zip(image_paths, boxes_list, labels_list):
for image_path, bboxes, labels in zip(image_paths, boxes_list, labels_list):
image_name = os.path.basename(image_path)
annotations[image_name] = {
"boxes": bboxes.tolist(),
"labels": labels_list.tolist(),
"labels": labels.tolist(),
}
annotations["class_names"] = class_names

Expand All @@ -165,10 +165,10 @@ def save_clf_annotations_to_json(
image_paths, labels_list, class_names, save_dir, file_name="annotations.json"
):
annotations = {}
for image_path, labels_list in zip(image_paths, labels_list):
for image_path, labels in zip(image_paths, labels_list):
image_name = os.path.basename(image_path)
annotations[image_name] = {
"labels": labels_list.tolist(),
"labels": labels.tolist(),
}
annotations["class_names"] = class_names

Expand Down Expand Up @@ -241,7 +241,7 @@ def main():
if args.task == "classification":
# Classification annotation
labels_list = []
for i, (image_path, prompt_objs) in enumerate(zip(image_paths, prompt_objects)):
for prompt_objs in prompt_objects:
labels = []
for obj in prompt_objs:
labels.append(args.class_names.index(obj))
Expand Down

0 comments on commit 6e8938c

Please sign in to comment.