rois-codh / kmnist

Repository for Kuzushiji-MNIST, Kuzushiji-49, and Kuzushiji-Kanji
Creative Commons Attribution Share Alike 4.0 International
695 stars 96 forks source link

docs : readme update for possible hub description use #22

Open Leon-Gee opened 2 years ago

Leon-Gee commented 2 years ago

hello i was hoping to help contributing with the aceess of this dataset through the open source hub package. i made an easy 2 line description of code on how to do this:

# Load kmnist-training set in python
import hub
ds = hub.load("hub://activeloop/kmnist-train")

# Load kmnist-test set in python
#ds = hub.load("hub://activeloop/kmnist-test")

# Checking out the first number and his label
import matplotlib.pyplot as plt
img = ds.images[0].numpy() 
plt.imshow(img)
plt.title(f"{ds.labels[0].numpy(aslist=True)}")
plt.show()

# train a model in pytorch
for sample in ds.pytorch():
    # ... model code here ...

# train a model in tensorflow
for sample in ds.tensorflow():
    # ... model code here ...
Leon-Gee commented 2 years ago

If you would like me to review it let me know it:)