-
Notifications
You must be signed in to change notification settings - Fork 2
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
Labels
Comments
Or perhaps teach programme how to read a pre-trained (and well-trained) xml file, such as with OpenCV. |
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 |
jakewilliami
added a commit
that referenced
this issue
Sep 28, 2020
jakewilliami
changed the title
Save learning to xml file
Read pretrained data from file
Sep 28, 2020
jakewilliami
added a commit
that referenced
this issue
Sep 28, 2020
I should also mention this is the data we want to read from. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: