Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.

Conversation

@saitejamalyala
Copy link
Contributor

  • write verified field to the json file while saving the annotation in createMl format
  • open annotation in json format

labelImg.py Outdated
# Save as Pascal voc xml
self.default_save_dir = default_save_dir
self.label_file_format = settings.get(SETTING_LABEL_FILE_FORMAT, LabelFileFormat.PASCAL_VOC)
self.label_file_format = settings.get(SETTING_LABEL_FILE_FORMAT, LabelFileFormat.CREATE_ML)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could keep PASCAL_VOC as default, as we should keep the behavior as the same as before?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, For sure

labelImg.py Outdated
self.load_pascal_xml_by_filename(xml_path)
elif os.path.isfile(txt_path):
self.load_yolo_txt_by_filename(txt_path)
elif os.path.isfile(txt_path):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    elif os.path.isfile(txt_path):
                self.load_yolo_txt_by_filename(txt_path)
    elif os.path.isfile(txt_path):
                self.load_create_ml_json_by_filename(json_path, file_path)

The second elif will never happen

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed this, Last elif should be
elif os.path.isfile(json_path): self.load_create_ml_json_by_filename(json_path, file_path)

if dir_path is not None and len(dir_path) > 1:
self.default_save_dir = dir_path

self.show_bounding_box_from_annotation_file(self.file_path)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if there are existing annotations in the new directory, it shows the bbox annotations for the current file ?


output_image_dict = {
"image": self.filename,
"verified": True if self.verified else False,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks verbose.

"verified": True if self.verified else False,

can be simplified to "verified": self.verified?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ofc, fixed now

@saitejamalyala saitejamalyala requested a review from tzutalin July 4, 2022 15:48
output_dict = json.loads(input_data)
self.verified = True

self.verified = output_dict[0].get("verified", False)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more question. What is output_dict? is it always expected to have a value in the list? should it have a empty check before assigning to self.verified like

output_dict[0].get("verified", False) if len(output_dict) else False

Copy link
Contributor Author

@saitejamalyala saitejamalyala Jul 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's done now. Also changed the name to output_list, as output_dict is misleading.

Copy link
Contributor

@tzutalin tzutalin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more comment about output_dict

@saitejamalyala saitejamalyala requested a review from tzutalin July 5, 2022 15:31
Copy link
Contributor

@tzutalin tzutalin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@tzutalin tzutalin merged commit 5bc7fb9 into HumanSignal:master Jul 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants