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

final from directory function for categorical image data #459

Merged
merged 33 commits into from Feb 15, 2021

Conversation

sparkingdark
Copy link
Contributor

@sparkingdark sparkingdark commented Jan 16, 2021

🚀 🚀 Pull Request

All Submissions:

New Feature Submissions:

  • Does your submission pass all tests?
  • Does your submission not lower the coverage-rate?
  • Have you lint your code locally prior to submission; including black style?
  • Have you describe your new feature in the 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

@github-actions
Copy link

Locust summary

Git references

Initial: ace631f
Terminal: f23cd0a

hub/api/tests/test_dataset.py
Changes:
hub/api/dataset.py
Changes:

@sparkingdark sparkingdark mentioned this pull request Jan 16, 2021
13 tasks
@sparkingdark sparkingdark changed the title final from directory final from directory function for categorical image data Jan 16, 2021
max_shape = [max(width), max(height), max(mode)]
return max_shape
except Exception:
print("some exception happened")
Copy link
Contributor

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."""
Copy link
Contributor

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.

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")):
Copy link
Contributor

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.

@sparkingdark
Copy link
Contributor Author

@mynameisvinn now check that i correct it with autopep8 for proper formatting.

@mynameisvinn
Copy link
Contributor

mynameisvinn commented Feb 3, 2021

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 descriptive. "Check your data for fix" does not help me understand the root problem.
  • Don't throw generic exceptions. You can subclass existing exceptions.

@sparkingdark
Copy link
Contributor Author

sparkingdark commented Feb 3, 2021 via email

@sparkingdark
Copy link
Contributor Author

@mynameisvinn any update?

@mikayelh
Copy link
Collaborator

Hey @sparkingdark - @mynameisvinn was out for the Chinese new year - sorry for that. He'll review it shortly :)

@mynameisvinn
Copy link
Contributor

Looks good, merging!

@mynameisvinn mynameisvinn merged commit d130e59 into activeloopai:master Feb 15, 2021
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.

None yet

3 participants