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

Allow Jpeg and URLs for image inputs in Motion Detector #4

Closed
wants to merge 2 commits into from

Conversation

blaise-muhirwa
Copy link
Contributor

No description provided.

@blaise-muhirwa blaise-muhirwa requested a review from robotrapta July 3, 2023 19:20
Copy link
Member

@robotrapta robotrapta left a comment

Choose a reason for hiding this comment

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

Why do we want this here? Is it just to make testing easier? Then it should go in the tests. I can imagine scenarios where you'd want a file off local disk, but for real-world usage I can't think of any good reason to want a remote image from http.

Also putting this functionality here messes with encapsulation. This library is chock full of ways to get images into memory from various places. Adding a small sampling of redundant methods in this one place doesn't make a lot of sense to me.

if filename.startswith("http"):
image = Image.open(requests.get(filename, stream=True).raw)
return np.array(image)
elif filename.endswith("jpeg"):
Copy link
Member

Choose a reason for hiding this comment

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

This is quite arbitrary. Not jpg?

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

Successfully merging this pull request may close these issues.

Have MotionDetection's motion_detected Method Take Image File Paths
2 participants