Getting Started with Daft: Your Guide to Distributed Dataframes for Multimodal Data

Aug 12, 2021 | Data Science

Welcome to our in-depth guide on Daft, a powerful distributed query engine made for large-scale data processing in Python, and implemented in Rust. If you’re looking to harness the power of data frames integrating complex and multimodal data, you’ve come to the right place. In this article, we will walk you through the essential steps to get started with Daft, along with some troubleshooting ideas.

About Daft

Daft was crafted with three main principles:

  • Any Data: Daft can accommodate complex modalities like images, tensors, and even URLs, offering exceptional performance thanks to its Arrow-based memory representation.
  • Interactive Computing: Whether you’re using notebooks or REPLs, Daft automates caching and query optimization to enhance your data experimentation.
  • Distributed Computing: The app fluidly integrates with Ray, allowing you to run dataframes across multiple machines when your local resources aren’t sufficient.

Installation

To get started, you can easily install Daft using pip:

pip install getdaft

For advanced installations, such as installing from source or incorporating additional dependencies like Ray and AWS utilities, refer to our Installation Guide.

Quickstart

Ready to dive deeper? Check out our 10-minute quickstart. Here’s a snippet to illustrate loading images from an AWS S3 bucket and resizing them:

import daft

# Load a dataframe from filepaths in an S3 bucket
df = daft.from_glob_path('s3://daft-public-data/laion-sample-images/*')

# Download column of image URLs as a column of bytes
# Decode the column of bytes into a column of images
df = df.with_column('image', df['path'].url.download().image.decode())

# Resize each image into 32x32
df = df.with_column('resized', df['image'].image.resize(32, 32))

df.show(3)

Think of this code like a chef preparing a delightful dish. First, we gather ingredients (images) from a storage (S3 bucket). Next, we carefully remove their packaging (download them as bytes), unwrap them to get the fresh product (decode), and finally chop them into bite-sized pieces (resize) for presentation. This intricate process reveals how Daft handles raw data to transform it into something usable.

Troubleshooting

If you run into issues during installation or usage, here are some troubleshooting tips:

  • Ensure you have the latest version of Python installed.
  • Verify that the paths to your data files are correct.
  • If you’re experiencing performance issues, consider optimizing your dataset or breaking it down into more manageable pieces.

For any further questions or to share experiences, connect with the community at GitHub Discussions. For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

More Resources

Explore additional resources to further enhance your understanding of Daft:

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Conclusion

Daft streamlines data processing, making it efficient and user-friendly. By following the steps outlined in this guide, you can harness the power of Daft for your own multimodal data projects.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox