Step 1: Hello World
Installing Deep Lake and accessing your first Deep Lake Dataset.
How to Install Deep Lake and Get Started
Installing Deep Lake
! pip install deeplakeFetching Your First Deep Lake Dataset
import deeplake
dataset_path = 'hub://activeloop/mnist-train'
ds = deeplake.load(dataset_path) # Returns a Deep Lake Dataset but does not download data locallyReading Samples From a Deep Lake Dataset
# Indexing
img = ds.images[0].numpy() # Fetch the 1st image and return a NumPy array
label = ds.labels[0].numpy(aslist=True) # Fetch the 1st label and store it as a
# as a list
text_labels = ds.labels[0].data()['text'] # Fetch the first labels and return them as text
# Slicing
imgs = ds.images[0:100].numpy() # Fetch 100 images and return a NumPy array
# The method above produces an exception if
# the images are not all the same size
labels = ds.labels[0:100].numpy(aslist=True) # Fetch 100 labels and store
# them as a list of NumPy arraysWas this helpful?