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
final from directory function for categorical image data #459
final from directory function for categorical image data #459
Conversation
Locust summaryGit referencesInitial: ace631fTerminal: f23cd0a hub/api/tests/test_dataset.pyChanges:
hub/api/dataset.pyChanges:
|
hub/api/dataset.py
Outdated
max_shape = [max(width), max(height), max(mode)] | ||
return max_shape | ||
except Exception: | ||
print("some exception happened") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a helpful message.
print("some exception happened") | ||
|
||
def make_schema(path_to_dir, labels, dtype): | ||
"""| make_schema internal function to generate the schema internally.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doc string needs to be improved.
hub/api/dataset.py
Outdated
for i in os.listdir(path_to_dir): | ||
for j in os.listdir(os.path.join(path_to_dir, i)): | ||
|
||
if j.endswith((".png", ".jpg", ".jpeg")): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about tiff
? Or bmp
? There are many image file types.
@mynameisvinn now check that i correct it with autopep8 for proper formatting. |
I tried this: from hub import Dataset
mnist = Dataset("activeloop/mnist")
mnist.from_directory(path_to_dir="images/") and got the following exception: >>> check your data for fix Since A few suggestions:
|
You doing it wrong this is for uploading datasets to hub not to load a
preloaded dataset for that hub.load is enough.
…On Wed, Feb 3, 2021, 19:40 v ***@***.***> wrote:
I tried this:
from hub import Dataset
mnist = Dataset("activeloop/mnist")mnist.from_directory(path_to_dir="images/")
and got the following exception:
>>> check your data for fix
Since path_to_dir is the only required argument, I don't understand why
it threw this exception.
A few suggestions:
- Please make exceptions more description. "Check your data for fix"
means nothing.
- Don't throw generic exceptions. You can subclass existing exceptions
<https://github.com/sparkingdark/Hub/blob/final_from_directory/hub/exceptions.py>
.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#459 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AL7XHCB4S73FPW2II32PIW3S5FKLVANCNFSM4WE7FYIA>
.
|
@mynameisvinn any update? |
Hey @sparkingdark - @mynameisvinn was out for the Chinese new year - sorry for that. He'll review it shortly :) |
Looks good, merging! |
🚀 🚀 Pull Request
All Submissions:
New Feature Submissions:
tests
?coverage-rate
?black
style?docs
?Changes to Core Features:
Have you added an explanation of what your changes do and why you'd like us to include them?
Have you written new
tests
for your core changes, as applicable?Have you successfully ran
tests
with your changes locally?Have you keep the
coverage-rate
constant?Have you keep the
coverage-rate
up?Are the
docs
up to date?change labels
added a static method from_directory
please review @davidbuniat @AbhinavTuli @mynameisvinn