Open pushkarnimkar opened 4 years ago
I like it, would you want to make a pull request?
Sure! I'll need some help though as I've never worked on internals of any widget before.
The use-case I was looking for is somewhat like this: I should be able to take multiple images from webcam (as training set) till my model builds enough confidence on the subject (for facial recognition). I was not actually looking for UI element of the widget in this case. So, I actually needed to take multiple images from webcam without any button click. I faced some issue when trying to do that. I had to eventually switch to button-based system.
For example, following snippet:
for _ in range(10):
recorder.recording = True
time.sleep(0.5)
recorder.recording = False
time.sleep(0.5)
print(hash(recorder.image.value))
Prints the same hash which corresponds to previous state of the widget (initially it prints out zero as hash(b'')
is 0
.
Please tell me if this is not the correct way of taking multiple images in a loop. If this is a problem, I'll like to help in fixing this too.
Creating
MediaStream
classes using awith
context can be useful as it ensures that media devices will be closed at the end of context.Example syntax: