ComeçarComece de graça

Loading and processing photos

Let's say you are training a machine learning model to read American sign language images and translate them into text. The first part of this is loading images, and you have a lot of them. Thankfully, Dask can help you load and process these images lazily.

Este exercício faz parte do curso

Parallel Programming with Dask in Python

Ver curso

Instruções do exercício

  • Import the image subpackage inside dask.array.
  • Load all of the .jpeg images inside the directory data/asl.
  • Slice out the zeroth image from the array and use the .compute() method to load it into memory.

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# Import the image subpackage from dask.array
from ____ import ____

# Lazily load in all jpegs inside all subdirectories inside data/asl
image_array = image.____(____)

# Load only the zeroth image into memory
zeroth_image = ____

# Plot the image
plt.imshow(zeroth_image)
plt.show()
Editar e executar o código