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

Read pretrained data from file #20

Open
jakewilliami opened this issue Aug 31, 2020 · 7 comments · May be fixed by #77
Open

Read pretrained data from file #20

jakewilliami opened this issue Aug 31, 2020 · 7 comments · May be fixed by #77
Labels
enhancement New feature or request help-wanted

Comments

@jakewilliami
Copy link
Owner

No description provided.

@jakewilliami jakewilliami added enhancement New feature or request future Not pressing labels Aug 31, 2020
@jakewilliami
Copy link
Owner Author

Or perhaps teach programme how to read a pre-trained (and well-trained) xml file, such as with OpenCV.

@jakewilliami
Copy link
Owner Author

jakewilliami commented Sep 3, 2020

See:

    if os.path.isfile('votes.pkl'):
        images = []
        print('loading preprocessed votes..')
        with open('votes.pkl', 'rb') as file:
            votes = pickle.load(file)
            f_votes = next(iter(votes.values())).tolist()
            for img, _ in f_votes:
                images.append(img)
        images = np.array(images)

    else:
        print('Generating data from scratch')
        # construct initial weights
        pos_weight = 1. / (2 * len(positives))
        neg_weight = 1. / (2 * len(negatives))
        for p in positives:
            p.set_weight(pos_weight)
        for n in negatives:
            n.set_weight(neg_weight)

            # pickle our work from before
            print('storing generated votes..')
            with open('votes.pkl', 'wb') as file:
                pickle.dump(votes, file)


 with open('classifiers.pckl', 'wb') as file:
                pickle.dump(classifiers, file)

https://stackoverflow.com/questions/29364135/equivalent-to-pickle-in-julia

From Simon-Hohberg/Viola-Jones@2bcc06c

@jakewilliami
Copy link
Owner Author

jakewilliami commented Sep 28, 2020

Commit e7295f8 closes the original issue. However, it does not address the reading of well-trained xml files (i.e., from OpenCV). Keeping this open for future development.

@jakewilliami jakewilliami changed the title Save learning to xml file Read pretrained data from file Sep 28, 2020
@jakewilliami jakewilliami added help-wanted and removed future Not pressing labels Jan 27, 2021
@jakewilliami
Copy link
Owner Author

@jakewilliami
Copy link
Owner Author

jakewilliami commented Nov 8, 2022

This may be helpful.

Edit: it seems like that is maybe based on this.

@jakewilliami
Copy link
Owner Author

I should also mention this is the data we want to read from.

@jakewilliami
Copy link
Owner Author

I think I need to do some reading to answer some questions about the structure of the XML data[1], [2], [3]

@jakewilliami jakewilliami linked a pull request Jan 30, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help-wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants