Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Want to know where the labels.txt files used in the author's training are generated? #263

Open
goldwater668 opened this issue Jul 31, 2021 · 1 comment

Comments

@goldwater668
Copy link

Want to know where the \data\retinaface_labels\train\labels.txt files used in the author's training are generated?

@Gopal518
Copy link

@goldwater668 labels.txt file is used in vision/datasets/voc_dataset.py.
below is the snippet of code : which will check your custom label.txt is available that make classes according to that else take "face" and "Background" as default.
# if the labels file exists, read in the class names
label_file_name = self.root / "labels.txt"

    if os.path.isfile(label_file_name):
        class_string = ""
        with open(label_file_name, 'r') as infile:
            for line in infile:
                class_string += line.rstrip()

        # classes should be a comma separated list

        classes = class_string.split(',')
        # prepend BACKGROUND as first class
        classes.insert(0, 'BACKGROUND')
        classes = [elem.replace(" ", "") for elem in classes]
        self.class_names = tuple(classes)
        logging.info("VOC Labels read from file: " + str(self.class_names))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants